Changeset 926 for trunk/MagicSoft/Cosy/candrv
- Timestamp:
- 09/10/01 14:32:27 (23 years ago)
- Location:
- trunk/MagicSoft/Cosy/candrv
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/candrv/canopen.cc
r920 r926 184 184 } 185 185 186 void CanOpen::SendSDO(BYTE_t node, WORD_t idx, BYTE_t subidx, BYTE_t val) 187 { 188 fSdoList.Add(node, idx, subidx); 186 void CanOpen::SendSDO(BYTE_t node, WORD_t idx, BYTE_t subidx, BYTE_t val, bool store) 187 { 188 if (store) 189 fSdoList.Add(node, idx, subidx); 189 190 190 191 SendCanFrame(CobId(node, kSDO_TX), kSDO_RX1, … … 192 193 } 193 194 194 void CanOpen::SendSDO(BYTE_t node, WORD_t idx, BYTE_t subidx, WORD_t val) 195 { 196 fSdoList.Add(node, idx, subidx); 195 void CanOpen::SendSDO(BYTE_t node, WORD_t idx, BYTE_t subidx, WORD_t val, bool store) 196 { 197 if (store) 198 fSdoList.Add(node, idx, subidx); 197 199 198 200 SendCanFrame(CobId(node, kSDO_TX), kSDO_RX2, … … 201 203 } 202 204 203 void CanOpen::SendSDO(BYTE_t node, WORD_t idx, BYTE_t subidx, LWORD_t val) 204 { 205 fSdoList.Add(node, idx, subidx); 205 void CanOpen::SendSDO(BYTE_t node, WORD_t idx, BYTE_t subidx, LWORD_t val, bool store) 206 { 207 if (store) 208 fSdoList.Add(node, idx, subidx); 206 209 207 210 SendCanFrame(CobId(node, kSDO_TX), kSDO_RX4, -
trunk/MagicSoft/Cosy/candrv/nodedrv.cc
r925 r926 7 7 #include "MLogManip.h" 8 8 9 NodeDrv::NodeDrv(BYTE_t nodeid, MLog &out) : Log(out), fNetwork(NULL), fId(32), fError(0)9 NodeDrv::NodeDrv(BYTE_t nodeid, const char *name, MLog &out) : Log(out), fNetwork(NULL), fId(32), fError(0) 10 10 { 11 11 if (nodeid>31) … … 16 16 17 17 fId = nodeid; 18 19 if (name) 20 { 21 fName = new char[strlen(name)+1]; 22 strcpy(fName, name); 23 } 24 else 25 { 26 fName = new char[9]; 27 sprintf(fName, "Node#%d", nodeid); 28 } 29 } 30 31 NodeDrv::~NodeDrv() 32 { 33 delete fName; 18 34 } 19 35 … … 80 96 } 81 97 82 void NodeDrv::SendSDO(WORD_t idx, BYTE_t subidx, BYTE_t val )98 void NodeDrv::SendSDO(WORD_t idx, BYTE_t subidx, BYTE_t val, bool store) 83 99 { 84 fNetwork->SendSDO(fId, idx, subidx, val );100 fNetwork->SendSDO(fId, idx, subidx, val, store); 85 101 } 86 102 87 void NodeDrv::SendSDO(WORD_t idx, BYTE_t subidx, WORD_t val )103 void NodeDrv::SendSDO(WORD_t idx, BYTE_t subidx, WORD_t val, bool store) 88 104 { 89 fNetwork->SendSDO(fId, idx, subidx, val );105 fNetwork->SendSDO(fId, idx, subidx, val, store); 90 106 } 91 107 92 void NodeDrv::SendSDO(WORD_t idx, BYTE_t subidx, LWORD_t val )108 void NodeDrv::SendSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, bool store) 93 109 { 94 fNetwork->SendSDO(fId, idx, subidx, val );110 fNetwork->SendSDO(fId, idx, subidx, val, store); 95 111 } 96 112 97 113 void NodeDrv::SendSDO(WORD_t idx, BYTE_t val) 98 114 { 99 fNetwork->SendSDO(fId, idx, val );115 fNetwork->SendSDO(fId, idx, val, true); 100 116 } 101 117 102 118 void NodeDrv::SendSDO(WORD_t idx, WORD_t val) 103 119 { 104 fNetwork->SendSDO(fId, idx, val );120 fNetwork->SendSDO(fId, idx, val, true); 105 121 } 106 122 107 123 void NodeDrv::SendSDO(WORD_t idx, LWORD_t val) 108 124 { 109 fNetwork->SendSDO(fId, idx, val );125 fNetwork->SendSDO(fId, idx, val, true); 110 126 } 111 127 112 void NodeDrv::RequestSDO(WORD_t idx, BYTE_t subidx =0)128 void NodeDrv::RequestSDO(WORD_t idx, BYTE_t subidx) 113 129 { 114 130 fNetwork->RequestSDO(fId, idx, subidx); -
trunk/MagicSoft/Cosy/candrv/nodedrv.h
r925 r926 13 13 BYTE_t fId; 14 14 15 char *fName; 16 15 17 int fError; 16 18 … … 21 23 22 24 public: 23 NodeDrv(BYTE_t nodeid, MLog &out=gLog); 25 NodeDrv(BYTE_t nodeid, const char *name=NULL, MLog &out=gLog); 26 virtual ~NodeDrv(); 24 27 25 BYTE_t GetId() { return fId; } 26 Network *GetNetwork() { return fNetwork; } 28 BYTE_t GetId() const { return fId; } 29 char *GetNodeName() const { return fName; } 30 Network *GetNetwork() { return fNetwork; } 27 31 28 32 virtual void InitDevice(Network *net); … … 47 51 BYTE_t m4=0, BYTE_t m5=0, BYTE_t m6=0, BYTE_t m7=0); 48 52 49 void SendSDO(WORD_t idx, BYTE_t subidx, BYTE_t val );50 void SendSDO(WORD_t idx, BYTE_t subidx, WORD_t val );51 void SendSDO(WORD_t idx, BYTE_t subidx, LWORD_t val );53 void SendSDO(WORD_t idx, BYTE_t subidx, BYTE_t val, bool store=true); 54 void SendSDO(WORD_t idx, BYTE_t subidx, WORD_t val, bool store=true); 55 void SendSDO(WORD_t idx, BYTE_t subidx, LWORD_t val, bool store=true); 52 56 53 57 void SendSDO(WORD_t idx, BYTE_t val);
Note:
See TracChangeset
for help on using the changeset viewer.