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

Last change on this file since 1494 was 1140, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 935 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, 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
19 void InitNodes();
20 void StopNodes();
21
22public:
23 Network(const char *dev, const int baud, MLog &out=gLog);
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 bool HasError() const;
34
35 ClassDef(Network, 0) // collection of nodes (nodedrv)
36};
37
38#endif
Note: See TracBrowser for help on using the repository browser.