Пример #1
0
HRESULT InitializeDIL(void)
{   		
    HRESULT hResult = S_OK;
    if (g_pouDIL_CAN_Interface == NULL)
    {		
        hResult = DIL_GetInterface(CAN, (void**)&g_pouDIL_CAN_Interface);
		hResult = DIL_GetInterface(J1939, (void**) &sg_pouIJ1939DIL);
    }
    else
    {
        g_pouDIL_CAN_Interface->DILC_PerformClosureOperations();        
    }
    if (hResult == S_OK)
    {        				
        if ((hResult = g_pouDIL_CAN_Interface->DILC_SelectDriver(g_dwDriverId, NULL, &g_ouWrapperLogger)) == S_OK)
        {			
            g_pouDIL_CAN_Interface->DILC_PerformInitOperations();
            INT nCount = defNO_OF_CHANNELS;
            if (g_pouDIL_CAN_Interface->DILC_ListHwInterfaces(g_asINTERFACE_HW, nCount) == S_OK)
            {
                HRESULT hResult = g_pouDIL_CAN_Interface->DILC_SelectHwInterfaces(g_asINTERFACE_HW, nCount);

				g_nChannelCount = nCount;
                if ((hResult == HW_INTERFACE_ALREADY_SELECTED) || (hResult == S_OK))
                {
                    hResult = g_pouDIL_CAN_Interface->DILC_RegisterClient(TRUE, g_dwClientID, _T("CAN_MONITOR"));
                    if ((hResult == S_OK)|| (hResult == ERR_CLIENT_EXISTS))
                    {				
		                g_pouDIL_CAN_Interface->DILC_SetConfigData(g_asControllerDetails, 
															sizeof(SCONTROLLER_DETAILS) * nCount);

                    }
                    else
                    {
						//AfxMessageBox("registering client failed");
                    }
                }
                else
                {
                    //AfxMessageBox("Selecting hardware interface failed");
                }
            }
            else
            {
				hResult = S_FALSE;
                //AfxMessageBox("Listing hardware interfaces failed");
            }
        }
        else
        {
		if ( hResult!=DAL_ALREADY_SELECTED )
		{
			//AfxMessageBox("Driver selection failed");	
		}            	
        }
    }
    return hResult;    
}
CFrameProcessor_J1939::CFrameProcessor_J1939()
{
    // Get hold of J1939 DIL interface
    HRESULT Result = DIL_GetInterface(J1939, (void**) &m_pouDIL_J1939);
    ASSERT(S_OK == Result);
    ASSERT(NULL != m_pouDIL_J1939);

    m_sJ1939ProcParams.m_pILog = NULL;
    m_sJ1939ProcParams.dwClientID = 0x0;

    // Allocate necessary amount of memory.

    m_sJ1939Data.m_unDLC = MAX_DATA_LEN_J1939;
    m_sJ1939Data.m_pbyData = new BYTE[m_sJ1939Data.m_unDLC];// For basic data object
    ASSERT(NULL != m_sJ1939Data.m_pbyData);

    // For raw data bytes. It should be equal to the size of m_sJ1939Data
    m_pbyJ1939Data = new BYTE[m_sJ1939Data.unGetSize()];
    ASSERT(NULL != m_pbyJ1939Data);

    USHORT Length = ushCalculateStrLen(true, MAX_DATA_LEN_J1939);
    m_sCurrFormatDat.m_pcDataHex = new char[Length];
    ASSERT(NULL != m_sCurrFormatDat.m_pcDataHex);
    memset(m_sCurrFormatDat.m_pcDataHex, '\0', Length * sizeof(char));
    Length = ushCalculateStrLen(false, MAX_DATA_LEN_J1939);
    m_sCurrFormatDat.m_pcDataDec = new char[Length];
    ASSERT(NULL != m_sCurrFormatDat.m_pcDataDec);
    memset(m_sCurrFormatDat.m_pcDataDec, '\0', Length * sizeof(char));
    m_sDataCopyThread.m_hActionEvent = m_ouVSEBufJ1939.getNotifyEvent();
    m_bIsJ1939DataLogged = FALSE;
}
Пример #3
0
CFrameProcessor_CAN::CFrameProcessor_CAN()
{
    DIL_GetInterface(CAN, (void**)&m_pouDilCanInterface);
    m_sCANProcParams.m_pILog = NULL;
    m_sCANProcParams.m_pouCANBuffer = NULL;
    m_sDataCopyThread.m_hActionEvent = m_ouFSEBufCAN.hGetNotifyingEvent();
}
Пример #4
0
void CTxEthernetDataStore::vUpdateTxList(int nChannel)
{
    if ( nChannel < 0 || nChannel > CHANNEL_ALLOWED )
    {
        return;
    }
    list<ETHERNET_FRAME_DATA>::iterator itrFrameData = m_ouEthernet_Frame_Data.begin();
    while ( itrFrameData != m_ouEthernet_Frame_Data.end() )
    {
        if ( bExistInTxList(nChannel, *itrFrameData) == false )
        {
            itrFrameData = m_ouEthernet_Frame_Data.erase (itrFrameData);

            DIL_GetInterface(ETHERNET, (void**)&m_pouDIL_Ethernet_Interface);
            if ( m_pouDIL_Ethernet_Interface != NULL )
            {
                //g_pouDIL_LIN_Interface->DILL_SendMsg(
            }
        }
        else
        {
            itrFrameData++;
        }
    }
}
Пример #5
0
CLINScheduleDataStore::CLINScheduleDataStore()
{
    m_pouDIL_LIN_Interface = NULL;
    m_ouClusterConfig = NULL;
    m_bValidWndSize = FALSE;
    DIL_GetInterface( LIN, (void**)&m_pouDIL_LIN_Interface );
}
Пример #6
0
void CMainPanel::vInitializeMainPanel()
{


    DIL_GetInterface(CAN, (void**)&Panel_DIL_CAN_Interface);
    Panel_DIL_CAN_Interface->DILC_RegisterClient(TRUE, g_dwClientID, _T("CAN_MONITOR"));
}
Пример #7
0
HRESULT CSignalWatch_LIN::SW_DoInitialization(void* RefObj, void* ouCluster)
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState());

    cluster= (ClusterConfig*)ouCluster;
    SW_UpdateMsgInterpretObj(RefObj);

    //Create the signal watch window for CAN
    if (m_pouSigWnd == nullptr)
    {
        m_pouSigWnd = new CSigWatchDlg(AfxGetMainWnd(), LIN);
        m_pouSigWnd->Create(IDD_DLG_SIGNAL_WATCH, nullptr);
        m_pouSigWnd->SetWindowText("Signal Watch - LIN");
    }

    CBaseDIL_LIN* pouDIL_LIN;
    if (DIL_GetInterface(LIN, (void**)&pouDIL_LIN) == S_OK)
    {
        DWORD dwClientId = 0;
        pouDIL_LIN->DILL_RegisterClient(TRUE, dwClientId, LIN_MONITOR_NODE);
        pouDIL_LIN->DILL_ManageMsgBuf(MSGBUF_ADD, dwClientId, &(m_ouLinBufFSE));
    }
    //Start the read thread
    return bStartSigWatchReadThread()? S_OK: S_FALSE;
}
Пример #8
0
CBaseDIL_CAN* CGlobalObj::GetICANDIL()
{
    if (sm_pouDilCanInterface == nullptr)
    {
        DIL_GetInterface(CAN, (void**)&(sm_pouDilCanInterface));
    }
    return sm_pouDilCanInterface;
}
Пример #9
0
CBaseDIL_LIN* CGlobalObj::GetILINDIL()
{
    if (sm_pouDilLinInterface == nullptr)
    {
        DIL_GetInterface(LIN, (void**)&(sm_pouDilLinInterface));
    }
    return sm_pouDilLinInterface;
}
Пример #10
0
HRESULT CTxFlexRayDataStore::bSetDILInterfacePtr()
{
    HRESULT hResult = S_OK;
    if (g_pouDIL_FLEXRAY_Interface == nullptr)
    {
        hResult = DIL_GetInterface(FLEXRAY, (void**)&g_pouDIL_FLEXRAY_Interface);
    }
    return hResult;
}
Пример #11
0
BOOL CTxEthernetDataStore::bSetDILInterfacePtr(CBaseDIL_ETHERNET* pEthernetDIL)
{
    HRESULT hResult = S_OK;
    if (m_pouDIL_Ethernet_Interface == NULL)
    {
		hResult = DIL_GetInterface(ETHERNET, (void**)&m_pouDIL_Ethernet_Interface);
    }
    return (BOOL)hResult;
}
Пример #12
0
/******************************************************************************
    Function Name    :  bGetDilInterFace
    Input(s)         :
    Output           :
    Functionality    :  Get Dil interface pointer
    Member of        :  CMsgContainerJ1939
    Friend of        :      -
    Author(s)        :  Arun kumar K
    Date Created     :  20.01.2011
******************************************************************************/
BOOL CMsgContainerJ1939::bGetDilInterFace()
{
    BOOL bFound = FALSE;;
    DIL_GetInterface( J1939, (void**)&m_pouDIL_J1939 );
    if (nullptr != m_pouDIL_J1939)
    {
        bFound = TRUE;
    }
    return bFound;
}
CFrameProcessor_LIN::CFrameProcessor_LIN():m_ouFormatMsgLIN(m_ouRefTimer)
{
    DIL_GetInterface(LIN, (void**)&m_pouDilLINInterface);

    m_sLINProcParams.m_pILog = NULL;
    m_sLINProcParams.m_pouLINBuffer = NULL;
    m_bIsLINDataLogged = FALSE;

    m_sDataCopyThread.m_hActionEvent = m_ouFSEBufLIN.hGetNotifyingEvent();
}
Пример #14
0
/******************************************************************************
Function Name  :  TSX_DoInitialization
Input(s)       :  -
Output         :  HRESULT
Functionality  :  Registers to CAN DIL
Member of      :  CTSExecutionCAN
Friend of      :  -
Author(s)      :  Venkatanarayana Makam
Date Created   :  01/04/2011
Modifications  :
******************************************************************************/
HRESULT CTSExecutionCAN::TSX_DoInitialization(void)
{
    if (DIL_GetInterface(CAN, (void**)&m_pouDIL_CAN) == S_OK)
    {
        m_pouDIL_CAN->DILC_RegisterClient(TRUE, m_dwClientId, CAN_MONITOR_NODE);
        m_pouDIL_CAN->DILC_ManageMsgBuf(MSGBUF_ADD, m_dwClientId, &m_ouCanBufFSE);
        return S_OK;
    }
    return S_FALSE;
}
Пример #15
0
/******************************************************************************
    Function Name    :  bGetDilInterFace
    Input(s)         :
    Output           :
    Functionality    :  Get Dil interface pointer
    Member of        :  CMsgContainerLIN
    Friend of        :      -
    Author(s)        :  Anish kumar
    Date Created     :  26.05.2010
******************************************************************************/
BOOL CMsgContainerLIN::bGetDilInterFace()
{
    BOOL bFound = FALSE;;
    DIL_GetInterface(LIN, (void**)&m_pouDIL_LIN_Interface);
    if (NULL != m_pouDIL_LIN_Interface)
    {
        bFound = TRUE;
    }
    return bFound;
}
Пример #16
0
/******************************************************************************
    Function Name    :  bGetDilInterFace
    Input(s)         :
    Output           :
    Functionality    :  Get Dil interface pointer
    Member of        :  CMsgContainerCAN
    Friend of        :      -
    Author(s)        :  Anish kumar
    Date Created     :  26.05.2010
******************************************************************************/
BOOL CMsgContainerCAN::bGetDilInterFace()
{
    BOOL bFound = FALSE;;
    DIL_GetInterface( CAN, (void**)&m_pouDIL_CAN_Interface );
    if (nullptr != m_pouDIL_CAN_Interface)
    {
        bFound = TRUE;
    }
    return bFound;
}
Пример #17
0
CFrameProcessor_CAN::CFrameProcessor_CAN():m_ouFormatMsgCAN(m_ouRefTimer)
{
    DIL_GetInterface( CAN, (void**)&m_pouDilCanInterface );
    m_eBusType = CAN;
    m_sCANProcParams.m_pILog = nullptr;
    m_sCANProcParams.m_pouCANBuffer = nullptr;
    m_bIsDataLogged = FALSE;

    m_sDataCopyThread.m_hActionEvent = m_ouFSEBufCAN.hGetNotifyingEvent();
}
Пример #18
0
BOOL CUDSMainWnd::OnInitDialog()
{
    CDialog::OnInitDialog();

    /* Get CAN DIL interface */
    DIL_GetInterface(CAN, (void**)&g_pouDIL_CAN_Interface);
    g_pouDIL_CAN_Interface->DILC_RegisterClient(TRUE, g_dwClientID, _("CAN_MONITOR"));

    m_omCheckTP.SetCheck(BST_UNCHECKED);
    vInitializeUDSfFields();
    return TRUE;
}
Пример #19
0
/**
 * \return contain Error information
 *
 * Does the client registration with driver and starts the Read
 * Thread.
 */
HRESULT CBusStatisticCAN::BSC_DoInitialization(void)
{
    if (DIL_GetInterface(CAN, (void**)&m_pouDIL_CAN) == S_OK)
    {
        DWORD dwClientId = 0;
        m_pouDIL_CAN->DILC_RegisterClient(TRUE, dwClientId, CAN_MONITOR_NODE);
        m_pouDIL_CAN->DILC_ManageMsgBuf(MSGBUF_ADD, dwClientId, &m_ouCanBufFSE);
    }

    vInitialiseBSData();
    sm_pouBSCan = this;
    //Start the read thread
    return bStartBSReadThread()?S_OK:S_FALSE;
}
Пример #20
0
HRESULT CSignalWatch_CAN::SW_DoInitialization()
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    //Create the signal watch window for CAN
    if (m_pouSigWnd == NULL)
    {
        m_pouSigWnd = new CSigWatchDlg;
        m_pouSigWnd->Create(IDD_DLG_SIGNAL_WATCH, NULL);
        m_pouSigWnd->SetWindowText("Signal Watch - CAN");
    }

    CBaseDIL_CAN* pouDIL_CAN;
    if (DIL_GetInterface(CAN, (void**)&pouDIL_CAN) == S_OK)
    {
        DWORD dwClientId = 0;
        pouDIL_CAN->DILC_RegisterClient(TRUE, dwClientId, CAN_MONITOR_NODE);
        pouDIL_CAN->DILC_ManageMsgBuf(MSGBUF_ADD, dwClientId, &(m_ouCanBufFSE));
    }
    //Start the read thread
    return bStartSigWatchReadThread()? S_OK: S_FALSE;
}
Пример #21
0
/*******************************************************************************
  Function Name  : CReplayProcess
  Description    : Standard default constructor
  Member of      : CReplayProcess
  Functionality  : This will initialise local variables
  Author(s)      : Raja N
  Date Created   : 16.7.2005
  Modifications  :
*******************************************************************************/
CReplayProcess::CReplayProcess(const CReplayFile& ouReplayFile) :
    m_ouReplayFile( ouReplayFile ),
    m_pReplayWndPtr( nullptr ),
    m_omBreakPoints( defBREAK_POINT_MAP_SIZE ),
    m_hThread( nullptr ),
    m_bReplayHexON( TRUE ),
    m_wLogReplayTimeMode(0 ),
    m_nCurrentIndex( 0 ),
    m_nUserSelectionIndex( 0 ),
    m_nNoOfMessagesToPlay( 0 ),
    m_bStopReplayThread( TRUE )
{

    m_omSelectedIndex.RemoveAll();
    //DIL related code
    DIL_GetInterface( CAN, (void**)&CReplayProcess::s_pouDIL_CAN_Interface );
    CReplayProcess::s_pouDIL_CAN_Interface->DILC_RegisterClient( TRUE,
            CReplayProcess::s_dwClientID,
            CAN_MONITOR_NODE);
    InitializeCriticalSection(&m_omCritSecFilter);
}
Пример #22
0
//To get the channel baud rate info for each channel
void CLogObjectLIN::Der_GetChannelBaudRateDetails
(void* controllerDetails, int& nNumChannels)
{
    CBaseDIL_LIN* pouDilLINInterface;
    DIL_GetInterface(LIN, (void**)&pouDilLINInterface);
    SCONTROLLER_DETAILS_LIN pouControllerDetails[CHANNEL_ALLOWED];
    INT nSize = 0;

    pouDilLINInterface->DILL_GetConfiguration(pouControllerDetails, nSize);
    SCONTROLLER_DETAILS_LIN* pTempControllerDetails=(SCONTROLLER_DETAILS_LIN*)controllerDetails;

    if (nullptr != controllerDetails && nullptr != pTempControllerDetails)
    {
        for (int nIdx = 0; nIdx < nSize; nIdx++)
        {
            pTempControllerDetails[nIdx] = pouControllerDetails[nIdx];
            //  memcpy(controllerDetails + nIdx, m_pasControllerDetails + nIdx, sizeof(SCONTROLLER_DETAILS));
        }
        nNumChannels = nSize;
    }
}
Пример #23
0
void CConfigMsgLogCANDlg::InitialiseWindow()
{
    CBaseDIL_CAN* pouDilInterface;
    DIL_GetInterface(CAN, (void**)&pouDilInterface);
    m_omComboChannel.ResetContent();
    if (nullptr != pouDilInterface)
    {
        LPARAM lParam = 0;
        if (S_OK == pouDilInterface->DILC_GetControllerParams(lParam, 0, NUMBER_HW))
        {
            m_unChannelCount = (UINT)lParam;
        }
    }

    m_omComboChannel.InsertString(0, _("ALL"));
    for (UINT i = 1; i <= m_unChannelCount; i++)
    {
        CString omChannel;
        omChannel.Format("%d", i);
        m_omComboChannel.InsertString(i, omChannel.GetBuffer(MAX_PATH));
    }
    m_omComboChannel.SetCurSel(0);
}
Пример #24
0
CBaseDILI_J1939* CGlobalObj::GetIJ1939DIL(void)
{
    CBaseDILI_J1939* Result = nullptr;
    DIL_GetInterface(J1939, (void**)&(Result));
    return Result;
}