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

Last change on this file since 774 was 732, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 878 bytes
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, 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
22public:
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.