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

Last change on this file since 3204 was 1727, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 1.1 KB
Line 
1#ifndef NETWORK_H
2#define NETWORK_H
3
4#include "canopen.h"
5#include "nodedrv.h"
6
7class Network : public CanOpen
8{
9private:
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 void HandleNodeguard(BYTE_t node, timeval_t *tv);
19 void HandleEmergency(BYTE_t node, timeval_t *tv);
20
21 void InitNodes();
22 void StopNodes();
23
24public:
25 Network(const char *dev, const int baud, MLog &out=gLog);
26
27 void SetNode(NodeDrv *drv);
28
29 NodeDrv *operator[](int i) { return fNodes[i]; }
30 NodeDrv *GetNode(int i) { return fNodes[i]; }
31
32 virtual void Start();
33 virtual void Stop();
34
35 bool HasError() const;
36 bool HasZombie() const;
37
38 bool RebootZombies();
39 void CheckConnections();
40
41 ClassDef(Network, 0) // collection of nodes (nodedrv)
42};
43
44#endif
Note: See TracBrowser for help on using the repository browser.