Ignore:
Timestamp:
01/14/03 12:08:46 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/devdrv/macs.cc

    r1702 r1703  
    4848    case 0x100a:
    4949        lout << "- " << GetNodeName() << ": Using Software Version V" << dec << (int)(val>>16) << "." << (int)(val&0xff) << endl;
     50        fSoftVersion = val;
     51        return;
     52
     53    case 0x100b:
     54        // Do not display, this is used for CheckConnection
     55        // lout << "Node ID: " << dec << val << endl;
    5056        return;
    5157
     
    221227}
    222228
    223 void Macs::InitDevice(Network *net)
    224 {
    225     lout << "- " << GetNodeName() << ": MAC Init device." << endl;
    226     NodeDrv::InitDevice(net);
    227     lout << "- " << GetNodeName() << ": MAC Init device...done." << endl;
    228 
    229 //    SendSDO(0x4003, (LWORD_t)('E'<<24 | 'X'<<16 | 'I'<<8 'T'));
    230 //    WaitForSdo(0x4003, 0);
    231 
    232 /*
    233     lout << "- Requesting SDO 0x2002 (vel) of " << (int)GetId() << endl;
    234     RequestSDO(0x2002);
    235     WaitForSdo(0x2002);
    236 
    237     lout << "- Requesting SDO 0x2003 of " << (int)GetId() << endl;
    238     RequestSDO(0x2003);
    239     WaitForSdo(0x2003);
    240 
    241     lout << "- Requesting SDO 0x2004 of " << (int)GetId() << endl;
    242     RequestSDO(0x2004);
    243     WaitForSdo(0x2004);
    244     */
     229void Macs::CheckConnection()
     230{
     231    RequestSDO(0x100b);
     232    WaitForSdo(0x100b);
     233
     234    // FIXME! Not statically linked!
     235    //    if (fSoftVersion<0x00000035)
     236    //        fIsZombie = true;
     237}
     238
     239
     240void Macs::Init()
     241{
    245242    lout << "- " << GetNodeName() << ": Requesting Mac Software Version." << endl;
    246243    RequestSDO(0x100a);
    247244    WaitForSdo(0x100a);
    248245
    249     if (IsZombie())
    250         return;
     246    if (fIsZombie)
     247    {
     248        lout << GetNodeName() << " - InitDevice failed!" << endl;
     249        return;
     250    }
    251251
    252252    EnableTimeout(kFALSE);
     
    259259    SendSDO(0x3000, string('o', 'n'));
    260260    WaitForSdo(0x3000);
    261 
    262261
    263262//    SetHome(250000);
     
    413412    // or by a positioning command (POSA, ...)
    414413    //
    415     lout << "- " << GetNodeName() << ": Starting Posistion Sync Mode." << endl;
     414    lout << "- " << GetNodeName() << ": Starting Position Sync Mode." << endl;
    416415    SendSDO(0x3007, 1, string('s', 'y', 'n', 'c'));
    417416    WaitForSdo(0x3007, 1);
     
    547546}
    548547
     548// FIXME? Handling of fIsZombie?
    549549void Macs::HandleError()
    550550{
Note: See TracChangeset for help on using the changeset viewer.