Exemplo n.º 1
0
/******************************************************************************
    Function Name    :  nCreateKeyWithCodeAndType
    Input(s)         :
    Output           :
    Functionality    :  Creates a key for SmsgDispEntry map
    Member of        :  CMsgContainerCAN
    Friend of        :      -
    Author(s)        :  Anish kumar
    Date Created     :  01.04.2010
******************************************************************************/
__int64 CMsgContainerCAN::nCreateMapIndexKey( LPVOID pMsgData )
{
    STCANDATA* pouCANData = (STCANDATA*)pMsgData;
    STCAN_MSG& sMsg = pouCANData->m_uDataInfo.m_sCANMsg;

    // Form message to get message index in the CMap
    int nMsgID = 0;
    if (IS_ERR_MESSAGE(pouCANData->m_ucDataType))
    {
        nMsgID = MAKE_RX_TX_MESSAGE( usProcessCurrErrorEntry(pouCANData->m_uDataInfo.m_sErrInfo),
                                     IS_RX_MESSAGE(pouCANData->m_ucDataType));
    }
    else
    {
        nMsgID = MAKE_RX_TX_MESSAGE( sMsg.m_unMsgID,
                                     IS_RX_MESSAGE(pouCANData->m_ucDataType));
    }

    nMsgID = MAKE_DEFAULT_MESSAGE_TYPE(nMsgID);
    // For extended message
    if (sMsg.m_ucEXTENDED)
    {
        nMsgID = MAKE_EXTENDED_MESSAGE_TYPE(nMsgID);
    }
    // Apply Channel Information
    __int64 n64MapIndex = MAKE_CHANNEL_SPECIFIC_MESSAGE( nMsgID,
                          sMsg.m_ucChannel );
    return n64MapIndex;
}
Exemplo n.º 2
0
/******************************************************************************
    Function Name    :  nCreateMapIndexKey
    Input(s)         :
    Output           :
    Functionality    :  Creates a key for SmsgDispEntry map
    Member of        :  CMsgContainerJ1939
    Friend of        :      -
    Author(s)        :  Arun kumar K
    Date Created     :  01.02.2011
******************************************************************************/
__int64 CMsgContainerJ1939::nCreateMapIndexKey( LPVOID pMsgData )
{
    STJ1939_MSG* pouJ1939Msg = (STJ1939_MSG*) pMsgData;
    // Form message to get message index in the CMap
    UINT nMsgID = MAKE_RX_TX_MESSAGE(
                      pouJ1939Msg->m_sMsgProperties.m_uExtendedID.m_s29BitId.unGetPGN(),
                      IS_RX_MESSAGE(pouJ1939Msg->m_sMsgProperties.m_eDirection));

    // For extended message
    nMsgID = MAKE_EXTENDED_MESSAGE_TYPE(nMsgID);
    // Apply Channel Information
    __int64 n64MapIndex = MAKE_CHANNEL_SPECIFIC_MESSAGE( nMsgID,
                          pouJ1939Msg->m_sMsgProperties.m_byChannel);

    n64MapIndex = MAKE_SOURCE_SPECIFIC_MESSAGE( n64MapIndex,
                  pouJ1939Msg->m_sMsgProperties.m_uExtendedID.m_s29BitId.m_bySrcAddress);

    n64MapIndex = MAKE_DEST_SPECIFIC_MESSAGE( n64MapIndex,
                  pouJ1939Msg->m_sMsgProperties.m_uExtendedID.m_s29BitId.m_uPGN.m_sPGN.m_byPDU_Specific);

    n64MapIndex = MAKE_TYPE_SPECIFIC_MESSAGE( n64MapIndex,
                  pouJ1939Msg->m_sMsgProperties.m_eType);

    return n64MapIndex;
}
Exemplo n.º 3
0
__int64 sTCANDATA::GetSlotID(sTCANDATA& pDatCAN)
{				
    STCAN_MSG &sMsg = pDatCAN.m_uDataInfo.m_sCANMsg;
    // Form message to get message index in the CMap
    int nMsgID = MAKE_RX_TX_MESSAGE( sMsg.m_unMsgID, 
									IS_RX_MESSAGE(pDatCAN.m_ucDataType));

    nMsgID = MAKE_DEFAULT_MESSAGE_TYPE(nMsgID);
    // For extended message
    if (sMsg.m_ucEXTENDED)
    {
        nMsgID = MAKE_EXTENDED_MESSAGE_TYPE(nMsgID);
    }
    // Apply Channel Information
    __int64 n64MapIndex = MAKE_CHANNEL_SPECIFIC_MESSAGE( nMsgID,
                                                         sMsg.m_ucChannel );	
	return n64MapIndex;
};
Exemplo n.º 4
0
__int64 tagSTJ1939_MSG::GetSlotID(STJ1939_MSG& pouJ1939Msg)
{
    // Form message to get message index in the CMap
    UINT nMsgID = MAKE_RX_TX_MESSAGE(
                      pouJ1939Msg.m_sMsgProperties.m_uExtendedID.m_s29BitId.unGetPGN(),
                      IS_RX_MESSAGE(pouJ1939Msg.m_sMsgProperties.m_eDirection));

    // For extended message
    nMsgID = MAKE_EXTENDED_MESSAGE_TYPE(nMsgID);
    // Apply Channel Information
    __int64 n64MapIndex = MAKE_CHANNEL_SPECIFIC_MESSAGE( nMsgID,
                          pouJ1939Msg.m_sMsgProperties.m_byChannel);

    n64MapIndex = MAKE_SOURCE_SPECIFIC_MESSAGE( n64MapIndex,
                  pouJ1939Msg.m_sMsgProperties.m_uExtendedID.m_s29BitId.m_bySrcAddress);

    n64MapIndex = MAKE_DEST_SPECIFIC_MESSAGE( n64MapIndex,
                  pouJ1939Msg.m_sMsgProperties.m_uExtendedID.m_s29BitId.m_uPGN.m_sPGN.m_byPDU_Specific);

    n64MapIndex = MAKE_TYPE_SPECIFIC_MESSAGE( n64MapIndex,
                  pouJ1939Msg.m_sMsgProperties.m_eType);

    return n64MapIndex;
};