Changeset 1702 for trunk/MagicSoft/Cosy/candrv
- Timestamp:
- 01/13/03 18:18:15 (22 years ago)
- Location:
- trunk/MagicSoft/Cosy/candrv
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/candrv/network.cc
r1701 r1702 240 240 if (!fNodes[i]->IsZombieNode()) 241 241 fNodeInitialized[i] = TRUE; 242 else243 fNodes[i]=NULL; 242 /*else 243 fNodes[i]=NULL;*/ 244 244 } 245 245 lout << "- All Nodes setup." << endl; … … 288 288 return rc; 289 289 } 290 291 // -------------------------------------------------------------------------- 292 // 293 // returns true if one of the nodes is a zombie node 294 // 295 bool Network::HasZombie() const 296 { 297 for (int i=0; i<32; i++) 298 if (fNodes[i]) 299 if (fNodes[i]->IsZombieNode()) 300 return true; 301 302 return false; 303 } 304 305 // -------------------------------------------------------------------------- 306 // 307 // try to reboot all zombie nodes to get them working again. all other 308 // nodes are left untouched. 309 // 310 bool Network::RebootZombies() 311 { 312 lout << "- Trying to reboot all Zombies..." << endl; 313 for (int i=0; i<32; i++) 314 if (fNodes[i]) 315 if (fNodes[i]->IsZombieNode()) 316 if (!fNodes[i]->Reboot()) 317 { 318 lout << "- Failed to reboot " << fNodes[i]->GetNodeName() << "." << endl; 319 return false; 320 } 321 322 lout << "- All Zombies rebooted." << endl; 323 324 return true; 325 } -
trunk/MagicSoft/Cosy/candrv/network.h
r1140 r1702 32 32 33 33 bool HasError() const; 34 bool HasZombie() const; 35 36 bool RebootZombies(); 34 37 35 38 ClassDef(Network, 0) // collection of nodes (nodedrv) -
trunk/MagicSoft/Cosy/candrv/nodedrv.cc
r1690 r1702 87 87 // -------------------------------------------------------------------------- 88 88 // 89 // This should be called from a master or main thread to get a node out 90 // of the Zombie-Status. Overload it by your needs. 91 // 92 bool NodeDrv::Reboot() 93 { 94 fIsZombie = false; 95 return true; 96 } 97 98 // -------------------------------------------------------------------------- 99 // 89 100 // Init device, sets the pointer to the whole network and enables 90 101 // the Can messages to be passed through the interface: … … 315 326 bool NodeDrv::WaitForSdo(WORD_t idx, BYTE_t subidx, WORDS_t timeout) 316 327 { 317 return fNetwork->WaitForSdo(fId, idx, subidx, timeout); 328 bool rc = fNetwork->WaitForSdo(fId, idx, subidx, timeout); 329 330 if (!rc) 331 fIsZombie = kTRUE; 332 333 return rc; 318 334 } 319 335 -
trunk/MagicSoft/Cosy/candrv/nodedrv.h
r1690 r1702 34 34 void DelError() { fError = 0; } 35 35 36 Bool_t fIsZombie; 36 Bool_t fIsZombie; // A Zombie node is a node which doesn't answer... 37 37 38 38 public: … … 60 60 virtual void HandlePDO3(BYTE_t *data, timeval_t *tv) {}; 61 61 virtual void HandlePDO4(BYTE_t *data, timeval_t *tv) {}; 62 63 virtual bool Reboot(); 62 64 63 65 void SendPDO1(BYTE_t data[8]); -
trunk/MagicSoft/Cosy/candrv/vmodican.cc
r1699 r1702 202 202 const WORD_t cobid = desc>>5; 203 203 204 switch (msg->cmd) 204 switch (msg->cmd) // FROM mican.h 205 205 { 206 206 case M_MSG_LOST: … … 208 208 return; 209 209 210 case M_BCAN_TX_con: /* confirm (+/-) transmission */ 211 cout << "VmodIcan reports: CTXcon=0x35" << endl; 212 cout << "This normally means, that the transmission of the following CAN frame failed:" << hex << endl; 213 cout << "Descr: 0x" << cobid << dec; 214 cout << " Rtr: " << (rtr?"Yes":"No"); 215 cout << " Len: " << (int)len << endl; 216 return; 217 210 218 case M_BCAN_EVENT_ind: 211 cout << "VmodIcan reports: CEVTind=0x37 ," << hex;219 cout << "VmodIcan reports: CEVTind=0x37: " << hex; 212 220 switch (msg->data[0]) // error indicator 213 221 {
Note:
See TracChangeset
for help on using the changeset viewer.