-
Notifications
You must be signed in to change notification settings - Fork 1
/
OneWireIOServer.h
45 lines (33 loc) · 1008 Bytes
/
OneWireIOServer.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
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef ONEWIREIO_ONEWIREIOSERVER_H
#define ONEWIREIO_ONEWIREIOSERVER_H
#include <CDPSystem/Base/CDPProperty.h>
#include <IO/IOServer.h>
#include <IO/ServerIO/ChannelManager.h>
namespace OneWireIO {
class OneWireSensor;
class OneWireIOServer : public IOServer, public OSAPIThread
{
public:
OneWireIOServer();
~OneWireIOServer();
void Create(const char* fullName) override;
void CreateModel() override;
void Configure(const char* componentXML) override;
void FillNodeChildren(CDP::StudioAPI::NodeStream &serializer) const override;
bool IsCommProblem() override;
void Activate() override;
void Suspend() override;
bool HandleXMLElement(XMLElementEx *pEx) override;
unsigned int NumberOfNodesOnline() override;
protected:
void Main(void) override;
private:
ServerIO::ChannelManager* m_channelManager;
std::vector<OneWireSensor*> m_owSensors;
std::vector<OneWireSensor*> m_owSensorsRetry;
CDPTimer m_retryTimer;
double m_periodMs;
bool m_commProblem;
};
}
#endif