Ignore:
Timestamp:
02/13/08 19:44:39 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy/candrv
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/candrv/canopen.cc

    r8813 r8862  
    8888// In case of a PDO the conditional semaphore corresponding to this PDO
    8989// is raised (WaitForNextPDO)
    90 //  HandleSDO:       handles a SDO message
    91 //  HandlePDO1/2/3/4:handles received PDOs
     90//  HandleSDO:        handles a SDO message
     91//  HandlePDO1/2/3/4: handles received PDOs
    9292//
    9393void CanOpen::HandleCanMessage(WORD_t cobid, const BYTE_t *data, const timeval_t &tv)
     
    127127            const WORD_t  subidx = data[3];
    128128
    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;
    130130            HandleSDO(node, cmd, idx, subidx, dat, tv);
    131131
  • trunk/MagicSoft/Cosy/candrv/ethernet.cc

    r8856 r8862  
    3939ClassImp(Ethernet);
    4040
     41#undef DEBUG
     42
    4143using namespace std;
    4244
     
    5456//
    5557Ethernet::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)
    5759{
    5860    gLog << inf2 << "- Ethernet initialized." << endl;
     
    8183    msg.data[1] = 0;
    8284
     85    const TString address = MTcpIpO::GetSocketAddress(rx);
     86
    8387    while (!IsThreadCanceled())
    8488    {
     
    100104        if (len==0)
    101105        {
    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!!!
    105108            continue;
    106109        }
     
    109112        if (len>1)
    110113        {
    111             cout << "Data too long!!!" << endl;
     114            gLog << err << "Data received from " << address << " is more than one byte!" << endl;
    112115            break;
    113116        }
     
    117120            if (c>=MSGLEN)
    118121            {
    119                 cout << "Received data too long (> " << MSGLEN << ")" << endl;
     122                cout << "Data received from " << address << " too long (> " << MSGLEN << ")" << endl;
    120123                break;
    121124            }
     
    133136            continue;
    134137
     138#ifdef DEBUG
    135139        cout << "*** RcvdCanFrame len=" << dec << msg.len << ": ";
    136140        for (int i=0; i<msg.len; i++)
    137141            cout << "0x" << setfill('0') << setw(2) << hex << (int)((msg.data+2)[i]) << " ";
    138         cout << endl;
     142        cout << dec << endl;
     143#endif
    139144
    140145        pos = -1;
     
    192197    */
    193198
     199#ifdef DEBUG
    194200    // FIXME: MUST BECOME NON-BLOCKING!!!!!
    195     cout << "*** Send CanFrame over IP" << endl;
     201    cout << "*** Send CanFrame over IP " << endl;
    196202    // FIXME: MUST BECOME NON-BLOCKING!!!!!
     203#endif
    197204
    198205    MTcpIpO::SendFrame(fTxAddress, fTxPort, (char*)(msg.data+1), msg.len-1);
     206    //Send((char*)(msg.data+1), msg.len-1);
    199207
    200208    /*
  • trunk/MagicSoft/Cosy/candrv/ethernet.h

    r8856 r8862  
    1010#endif
    1111
    12 class Ethernet : public MTcpIpI, public Interface
     12class Ethernet : public MTcpIpI, /*public MTcpIpO,*/ public Interface
    1313{
    1414private:
  • trunk/MagicSoft/Cosy/candrv/interface.cc

    r8854 r8862  
    5656void Interface::HandleMessage(const Message &msg) const
    5757{
    58     if (fReceiver)
     58    if (!fReceiver)
    5959        return;
    6060
  • trunk/MagicSoft/Cosy/candrv/network.cc

    r8835 r8862  
    132132        for (int i=0; i<8; i++)
    133133            gLog << " 0x" << (int)data[i];
    134         gLog << endl;
     134        gLog << dec << endl;
    135135        return;
    136136    }
     
    150150        for (int i=0; i<8; i++)
    151151            gLog << " 0x" << (int)data[i];
    152         gLog << endl;
     152        gLog << dec << endl;
    153153        return;
    154154    }
     
    168168        for (int i=0; i<8; i++)
    169169            gLog << " 0x" << (int)data[i];
    170         gLog << endl;
     170        gLog << dec << endl;
    171171        return;
    172172    }
     
    186186        for (int i=0; i<8; i++)
    187187            gLog << " 0x" << (int)data[i];
    188         gLog << endl;
     188        gLog << dec << endl;
    189189        return;
    190190    }
Note: See TracChangeset for help on using the changeset viewer.