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