Changeset 10535 for trunk/FACT++


Ignore:
Timestamp:
05/03/11 18:22:01 (14 years ago)
Author:
tbretz
Message:
Added more details to Error.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/HeadersFTM.cc

    r10520 r10535  
    133133void FTM::Error::print(std::ostream &out) const
    134134{
    135     out << "ERROR: Ncalls=" << fNumCalls << endl;
    136     out << Converter::GetHex<unsigned int>(fData, 28, 0, false) << endl;
     135    out << dec;
     136    out << "ERROR: Num Calls   = " << fNumCalls << endl;
     137    out << "       Delimiter   = " << (fDelimiter=='@'?"ok":"wrong") << endl;
     138    out << "       Path        = ";
     139    out << (fSrcAddress &0x3) << ":" << (fSrcAddress >>2) << " --> ";
     140    out << (fDestAddress&0x3) << ":" << (fDestAddress>>2) << endl;
     141    out << "       FirmwareId  = " << hex << fFirmwareId << endl;
     142    out << "       Command     = " << hex << fCommand << endl;
     143    out << "       CRC counter = " << dec << fCrcErrorCounter << endl;
     144    out << "       CRC         = " << hex << fCrcCheckSum << endl;
     145    out << "       Data: " << Converter::GetHex<unsigned int>(fData, 21, 0, false) << endl;
    137146}
  • trunk/FACT++/src/HeadersFTM.h

    r10525 r10535  
    319319        std::vector<uint16_t> HtoN() const
    320320        {
    321             std::cout << "-----><-----" << std::endl;
    322321            return htoncpy(*this);
    323322        }
     
    325324        void operator=(const std::vector<uint16_t> &vec)
    326325        {
    327             std::cout << "-----<>-----" << std::endl;
    328 
    329326            ntohcpy(vec, *this);
    330327        }
     
    606603    struct Error
    607604    {
    608                               //  (same as FtuList)
    609605        uint16_t fNumCalls;   // 0=error, >1 needed repetition but successfull
    610         uint16_t fData[28];
     606
     607        uint16_t fDelimiter;
     608        uint16_t fDestAddress;
     609        uint16_t fSrcAddress;
     610        uint16_t fFirmwareId;
     611        uint16_t fCommand;
     612        uint16_t fData[21];
     613        uint16_t fCrcErrorCounter;
     614        uint16_t fCrcCheckSum;
    611615
    612616        Error() { init(*this); }
     
    637641            fError(e)
    638642        {
    639         }
     643            fError.fDestAddress = (e.fDestAddress&0x3)*10 + ((e.fDestAddress>>2)&0xf);
     644            fError.fSrcAddress  = (e.fSrcAddress &0x3)*10 + ((e.fSrcAddress >>2)&0xf);
     645        }
     646
    640647    }  __attribute__((__packed__));
    641648
Note: See TracChangeset for help on using the changeset viewer.