int ITxFormView::HighlightSignalMatrix(int nDlc, const SignalInstanse& ouSignalInstance, ISignal*& pouSigStrct) { int hResult = S_FALSE; if (nullptr == pouSigStrct) { return hResult; } hResult = S_OK; BYTE abySigMask[8] = { 0 }; unsigned int unLength; int nByte = ouSignalInstance.m_nStartBit / 8 + 1; int nSignal = ouSignalInstance.m_nStartBit % 8; pouSigStrct->GetLength(unLength); eEndianess endian; GetEndianess(std::make_pair(pouSigStrct, ouSignalInstance), endian); bCalcBitMaskForSig(abySigMask, 8, nByte, nSignal, unLength, endian); m_odSignalMatrix.vSetMessageLength(nDlc); m_odSignalMatrix.vSetHighlight(abySigMask, nDlc); return hResult; }
void OutStream::Init( MediumAccessor::Ptr accessor ) { if( accessor == NULL ) { _THROW_ EBadParameter( "NULL pointer" ); } _accessor = accessor; uint8 endian = (uint8) GetEndianess(); _accessor->PutData( (const void *) &endian, sizeof(uint8)); }
void ITxFormView::vGetDataBytesFromSignal(unsigned long long u64SignVal, std::pair<ISignal*, SignalInstanse>& Signal, int nDLC, unsigned char* pucData) { unsigned char ucData[MAX_PATH] = {0}; memcpy(ucData, pucData, nDLC); int byteOffsetBy8 = Signal.second.m_nStartBit / 64; int signalStartBitInByte = Signal.second.m_nStartBit % 8; int byteStart = Signal.second.m_nStartBit / 8 - (byteOffsetBy8 * 8) + 1; unsigned int nLength = 0; Signal.first->GetLength(nLength); bool bIntel = false; eEndianess endian = eMotorola; GetEndianess(Signal, endian); if (eIntel == endian) { bIntel = true; } vSetSignalValue(byteStart, signalStartBitInByte, nLength, bIntel, u64SignVal, &ucData[0], nDLC); memcpy(pucData, ucData, nDLC); }
void InStream::Init( MediumAccessor::Ptr accessor ) { if( !accessor ) { _THROW_ EBadParameter( "NULL pointer" ); } _accessor = accessor; uint8 e; _accessor->GetData( &e, sizeof(uint8)); Endianness endianess = (Endianness) e; // if stream's endian is different from curr machine .. swap bytes if( endianess != GetEndianess() ) { _needSwapBytes = 1; } else { _needSwapBytes = 0; } }