示例#1
0
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;
}
示例#2
0
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));
}
示例#3
0
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);
}
示例#4
0
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;
	}
	
}