예제 #1
0
//---------------------------------------------------------------------------
//
// Function:    EplObduCalReadEntry()
//
// Description: Function encapsulate access of function EplObdReadEntry
//
// Parameters:  uiIndex_p       = Index oof the OD entry to read
//              uiSubIndex_p    = Subindex to read
//              pDstData_p      = pointer to the buffer for data
//              Offset_p        = offset in data for read access
//              pSize_p         = IN: Size of the buffer
//                                OUT: number of readed Bytes
//
// Return:      tEplKernel      =   errorcode
//
// State:
//
//---------------------------------------------------------------------------
tEplKernel EplObduCalReadEntry(unsigned int uiIndex_p,
			       unsigned int uiSubIndex_p,
			       void *pDstData_p, tEplObdSize *pSize_p)
{
	tEplKernel Ret;

#if(((EPL_MODULE_INTEGRATION) & (EPL_MODULE_OBDK)) != 0)
	Ret = EplObdReadEntry(uiIndex_p, uiSubIndex_p, pDstData_p, pSize_p);
#else
	Ret = kEplSuccessful;
#endif

	return Ret;
}
static tEplKernel EplErrorHandlerkLinkArray(
                                DWORD*      pdwValue_p,
                                unsigned int uiValueCount_p,
                                unsigned int uiIndex_p)
{
tEplKernel      Ret = kEplSuccessful;
tEplVarParam    VarParam;
tEplObdSize     EntrySize;
BYTE            bIndexEntries;

    EntrySize = (tEplObdSize)  sizeof(bIndexEntries);
    Ret = EplObdReadEntry (
                            uiIndex_p,
                            0x00,
                            (void GENERIC*) &bIndexEntries,
                            &EntrySize );

    if ((Ret != kEplSuccessful) || (bIndexEntries == 0x00))
    {
        // Object doesn't exist or invalid entry number
        Ret = kEplObdIndexNotExist;
        goto Exit;
    }

    if (bIndexEntries < uiValueCount_p)
    {
        uiValueCount_p = bIndexEntries;
    }

    VarParam.m_Size = sizeof(DWORD);
    VarParam.m_uiIndex = uiIndex_p;
    VarParam.m_ValidFlag = kVarValidAll;

    for (VarParam.m_uiSubindex = 0x01; VarParam.m_uiSubindex <= uiValueCount_p; VarParam.m_uiSubindex++)
    {
        VarParam.m_pData = pdwValue_p;
        Ret = EplObdDefineVar(&VarParam);
        if (Ret != kEplSuccessful)
        {
            goto Exit;
        }
        pdwValue_p++;
    }

Exit:
    return Ret;
}