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, struct timeval *tv);
|
---|
14 | void HandlePDO1(BYTE_t node, BYTE_t *data, struct timeval *tv);
|
---|
15 | void HandlePDO2(BYTE_t node, BYTE_t *data, struct timeval *tv);
|
---|
16 | void HandlePDO3(BYTE_t node, BYTE_t *data, struct timeval *tv);
|
---|
17 | void HandlePDO4(BYTE_t node, BYTE_t *data, struct timeval *tv);
|
---|
18 |
|
---|
19 | void InitNodes();
|
---|
20 | void StopNodes();
|
---|
21 |
|
---|
22 | public:
|
---|
23 | Network(const char *dev, const int baud, ostream &out=cout);
|
---|
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 |
|
---|
34 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.