Changeset 8862 for trunk/MagicSoft/Cosy/candrv
- Timestamp:
- 02/13/08 19:44:39 (17 years ago)
- Location:
- trunk/MagicSoft/Cosy/candrv
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/candrv/canopen.cc
r8813 r8862 88 88 // In case of a PDO the conditional semaphore corresponding to this PDO 89 89 // is raised (WaitForNextPDO) 90 // HandleSDO: handles a SDO message91 // HandlePDO1/2/3/4: handles received PDOs90 // HandleSDO: handles a SDO message 91 // HandlePDO1/2/3/4: handles received PDOs 92 92 // 93 93 void CanOpen::HandleCanMessage(WORD_t cobid, const BYTE_t *data, const timeval_t &tv) … … 127 127 const WORD_t subidx = data[3]; 128 128 129 cout << "SND NODE: " << (int)node << " " << flush;129 //cout << "SDO_rx: node=" << (int)node << hex << " cmd=0x" << (int)cmd << " idx=0x" << idx << " subidx=0x" << subidx << dec << endl; 130 130 HandleSDO(node, cmd, idx, subidx, dat, tv); 131 131 -
trunk/MagicSoft/Cosy/candrv/ethernet.cc
r8856 r8862 39 39 ClassImp(Ethernet); 40 40 41 #undef DEBUG 42 41 43 using namespace std; 42 44 … … 54 56 // 55 57 Ethernet::Ethernet(const char *addr, const int tx, const int rx, CanOpen *receiver) 56 : MTcpIpI(rx), Interface(receiver), fTxAddress(addr), fTxPort(tx)58 : MTcpIpI(rx),/* MTcpIpO(addr, tx),*/ Interface(receiver), fTxAddress(addr), fTxPort(tx) 57 59 { 58 60 gLog << inf2 << "- Ethernet initialized." << endl; … … 81 83 msg.data[1] = 0; 82 84 85 const TString address = MTcpIpO::GetSocketAddress(rx); 86 83 87 while (!IsThreadCanceled()) 84 88 { … … 100 104 if (len==0) 101 105 { 102 // THIS MEANS CONNECTIION LOST!!!! 103 cout << "============> LEN==0 (CONNECTION LOST?)" << endl; 104 break; // This break is for TEST PURPOSE FIXME!!! 106 gLog << warn << "WARNING - Connection lost (received 0bytes) to " << address << endl; 107 //break; // This break is for TEST PURPOSE FIXME!!! 105 108 continue; 106 109 } … … 109 112 if (len>1) 110 113 { 111 cout << "Data too long!!!" << endl;114 gLog << err << "Data received from " << address << " is more than one byte!" << endl; 112 115 break; 113 116 } … … 117 120 if (c>=MSGLEN) 118 121 { 119 cout << " Received datatoo long (> " << MSGLEN << ")" << endl;122 cout << "Data received from " << address << " too long (> " << MSGLEN << ")" << endl; 120 123 break; 121 124 } … … 133 136 continue; 134 137 138 #ifdef DEBUG 135 139 cout << "*** RcvdCanFrame len=" << dec << msg.len << ": "; 136 140 for (int i=0; i<msg.len; i++) 137 141 cout << "0x" << setfill('0') << setw(2) << hex << (int)((msg.data+2)[i]) << " "; 138 cout << endl; 142 cout << dec << endl; 143 #endif 139 144 140 145 pos = -1; … … 192 197 */ 193 198 199 #ifdef DEBUG 194 200 // FIXME: MUST BECOME NON-BLOCKING!!!!! 195 cout << "*** Send CanFrame over IP " << endl;201 cout << "*** Send CanFrame over IP " << endl; 196 202 // FIXME: MUST BECOME NON-BLOCKING!!!!! 203 #endif 197 204 198 205 MTcpIpO::SendFrame(fTxAddress, fTxPort, (char*)(msg.data+1), msg.len-1); 206 //Send((char*)(msg.data+1), msg.len-1); 199 207 200 208 /* -
trunk/MagicSoft/Cosy/candrv/ethernet.h
r8856 r8862 10 10 #endif 11 11 12 class Ethernet : public MTcpIpI, public Interface12 class Ethernet : public MTcpIpI, /*public MTcpIpO,*/ public Interface 13 13 { 14 14 private: -
trunk/MagicSoft/Cosy/candrv/interface.cc
r8854 r8862 56 56 void Interface::HandleMessage(const Message &msg) const 57 57 { 58 if ( fReceiver)58 if (!fReceiver) 59 59 return; 60 60 -
trunk/MagicSoft/Cosy/candrv/network.cc
r8835 r8862 132 132 for (int i=0; i<8; i++) 133 133 gLog << " 0x" << (int)data[i]; 134 gLog << endl;134 gLog << dec << endl; 135 135 return; 136 136 } … … 150 150 for (int i=0; i<8; i++) 151 151 gLog << " 0x" << (int)data[i]; 152 gLog << endl;152 gLog << dec << endl; 153 153 return; 154 154 } … … 168 168 for (int i=0; i<8; i++) 169 169 gLog << " 0x" << (int)data[i]; 170 gLog << endl;170 gLog << dec << endl; 171 171 return; 172 172 } … … 186 186 for (int i=0; i<8; i++) 187 187 gLog << " 0x" << (int)data[i]; 188 gLog << endl;188 gLog << dec << endl; 189 189 return; 190 190 }
Note:
See TracChangeset
for help on using the changeset viewer.