-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCContainer.h
32 lines (30 loc) · 897 Bytes
/
CContainer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* @author Michael Meindl
* @date 5.12.2016
* @brief Container class used for communication between the components.
* The comm-component waits for the read semaphore, reads the values
* and transmits them via the TCP/IP-socket.
* The control-component writes the values - without signaling - and gives the read semaphore.
*/
#ifndef CCONTAINER_H
#define CCONTAINER_H
#include "SContent.h"
#include "CBinarySemaphore.h"
class CContainer
{
public:
bool getContent(bool waitForever,
SContent& content);
void signalReader();
bool writeADCValue(const UInt16 adcValue);
bool writeTorqueValue(const float torque);
bool writeSensor1Data(const SMPU6050Data& sensorData);
bool writeSensor2Data(const SMPU6050Data& sensorData);
bool writeStateData(const SStateVectorData& sensorData);
public:
CContainer();
private:
SContent mContent;
CBinarySemaphore mReadSem;
};
#endif