Ignore:
Timestamp:
04/11/05 10:58:30 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy/candrv
Files:
4 edited

Legend:

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

    r2518 r6923  
    278278// --------------------------------------------------------------------------
    279279//
     280// Print all errors which are currently set
     281//
     282void Network::PrintError() const
     283{
     284    for (int i=0; i<32; i++)
     285    {
     286        if (!fNodes[i])
     287            continue;
     288
     289        if (!fNodes[i]->HasError())
     290            continue;
     291
     292        lout << "- Node #" << dec << i << " '" << fNodes[i]->GetNodeName() << "' ";
     293
     294        if (fNodes[i]->GetError() <= 0)
     295            lout << "Error occured." << endl;
     296        else
     297            lout << "has error #" << fNodes[i]->GetError() << endl;
     298    }
     299}
     300
     301// --------------------------------------------------------------------------
     302//
    280303// returns true if one of the nodes has the error-flag set (HasError).
    281304//
     
    354377            fNodes[i]->CheckConnection();
    355378}
    356 
  • trunk/MagicSoft/Cosy/candrv/network.h

    r4105 r6923  
    3737    virtual void Stop();
    3838
     39    void PrintError() const;
     40
    3941    bool HasError() const;
    4042    bool HasZombie() const;
  • trunk/MagicSoft/Cosy/candrv/nodedrv.cc

    r4105 r6923  
    416416// queue and no waiting is done, false is returned..
    417417//
    418 bool NodeDrv::WaitForSdo(WORD_t idx, BYTE_t subidx, WORDS_t timeout)
     418bool NodeDrv::WaitForSdo(WORD_t idx, BYTE_t subidx, WORDS_t timeout, bool zombie)
    419419{
    420420    bool rc = fNetwork->WaitForSdo(fId, idx, subidx, fIsZombie?-1:timeout);
    421 
    422     if (!rc)
    423     {
    424         lout << "NodeDrv::WaitForSdo: 0x" << hex << idx << "/" << dec << (int)subidx << " " << GetNodeName() << " --> ZOMBIE!" << endl;
     421    if (rc)
     422        return true;
     423
     424    lout << " + " << GetNodeName() << ": NodeDrv::WaitForSdo: 0x" << hex << idx << "/" << dec << (int)subidx << " --> ZOMBIE! " << MTime() << endl;
     425    if (zombie)
    425426        SetZombie();
    426     }
    427 /*
    428     if (HasError())
    429     {
    430         lout << "NodeDrv::WaitForSdo: HasError 0x" << hex << idx << "/" << dec << (int)subidx << " " << GetNodeName() << " --> ZOMBIE!" << endl;
    431         fIsZombie = kTRUE;
    432     }
    433 */
    434     return fIsZombie ? false : rc;
     427    return false;
    435428}
    436429
  • trunk/MagicSoft/Cosy/candrv/nodedrv.h

    r4105 r6923  
    106106
    107107    // void WaitForSdos();
    108     bool WaitForSdo(WORD_t idx, BYTE_t subidx=0, WORDS_t timeout=500);
     108    bool WaitForSdo(WORD_t idx, BYTE_t subidx=0, WORDS_t timeout=500, bool zombie=true);
    109109
    110110    void EnableCanMsg(BYTE_t fcode);
Note: See TracChangeset for help on using the changeset viewer.