source: trunk/Cosy/candrv/network.h@ 10305

Last change on this file since 10305 was 8836, checked in by tbretz, 17 years ago
*** empty log message ***
File size: 1.2 KB
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
11class Network : public CanOpen
12{
13private:
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, const timeval &tv);
18 void HandlePDO1(BYTE_t node, const BYTE_t *data, const timeval_t &tv);
19 void HandlePDO2(BYTE_t node, const BYTE_t *data, const timeval_t &tv);
20 void HandlePDO3(BYTE_t node, const BYTE_t *data, const timeval_t &tv);
21 void HandlePDO4(BYTE_t node, const BYTE_t *data, const timeval_t &tv);
22 void HandleNodeguard(BYTE_t node, const timeval_t &tv);
23 void HandleEmergency(BYTE_t node, const timeval_t &tv);
24
25 void InitNodes();
26 void StopNodes();
27
28public:
29 Network();
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 void Start();
37 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.