source: trunk/MagicSoft/Cosy/candrv/network.h@ 5135

Last change on this file since 5135 was 4105, checked in by tbretz, 21 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, 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
28public:
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 bool HasError() const;
40 bool HasZombie() const;
41
42 bool RebootZombies();
43 void CheckConnections();
44
45 ClassDef(Network, 0) // collection of nodes (nodedrv)
46};
47
48#endif
Note: See TracBrowser for help on using the repository browser.