Line | |
---|
1 | #ifndef COSY_Network
|
---|
2 | #define COSY_Network
|
---|
3 |
|
---|
4 | #ifndef COSY_CanOpen
|
---|
5 | #include "canopen.h"
|
---|
6 | #endif
|
---|
7 | #ifndef COSY_NodeDrv
|
---|
8 | #include "nodedrv.h"
|
---|
9 | #endif
|
---|
10 |
|
---|
11 | class Network : public CanOpen
|
---|
12 | {
|
---|
13 | private:
|
---|
14 | NodeDrv *fNodes[32];
|
---|
15 | int fNodeInitialized[32];
|
---|
16 |
|
---|
17 | void HandleSDO(BYTE_t node, BYTE_t cmd, WORD_t idx, BYTE_t subidx, LWORD_t data, timeval *tv);
|
---|
18 | void HandlePDO1(BYTE_t node, BYTE_t *data, timeval_t *tv);
|
---|
19 | void HandlePDO2(BYTE_t node, BYTE_t *data, timeval_t *tv);
|
---|
20 | void HandlePDO3(BYTE_t node, BYTE_t *data, timeval_t *tv);
|
---|
21 | void HandlePDO4(BYTE_t node, BYTE_t *data, timeval_t *tv);
|
---|
22 | void HandleNodeguard(BYTE_t node, timeval_t *tv);
|
---|
23 | void HandleEmergency(BYTE_t node, timeval_t *tv);
|
---|
24 |
|
---|
25 | void InitNodes();
|
---|
26 | void StopNodes();
|
---|
27 |
|
---|
28 | public:
|
---|
29 | Network(const char *dev, const int baud, MLog &out=gLog);
|
---|
30 |
|
---|
31 | void SetNode(NodeDrv *drv);
|
---|
32 |
|
---|
33 | NodeDrv *operator[](int i) { return fNodes[i]; }
|
---|
34 | NodeDrv *GetNode(int i) { return fNodes[i]; }
|
---|
35 |
|
---|
36 | virtual void Start();
|
---|
37 | virtual void Stop();
|
---|
38 |
|
---|
39 | void PrintError() const;
|
---|
40 |
|
---|
41 | bool HasError() const;
|
---|
42 | bool HasZombie() const;
|
---|
43 |
|
---|
44 | bool RebootZombies();
|
---|
45 | void CheckConnections();
|
---|
46 |
|
---|
47 | ClassDef(Network, 0) // collection of nodes (nodedrv)
|
---|
48 | };
|
---|
49 |
|
---|
50 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.