BST_CORE_PID_LUT_STRU *BST_CORE_GetPidHandle ( BST_CORE_PID_ENUM_UINT16 enPid ) { if ( BST_CORE_IsPidValid ( enPid ) ) { if ( g_BstCorePidInputChkLut[enPid].enPid != enPid ) { return BST_NULL_PTR; } else { return &g_BstCorePidInputChkLut[enPid]; } } else { return BST_NULL_PTR; } }
BST_UINT16 BST_CORE_CNPTask::Inquired( BST_CORE_PID_ENUM_UINT16 enParamId, BST_UINT16 usDataSize, BST_VOID *const pData ) { if ( !BST_CORE_IsPidValid ( enParamId ) ) { BST_RLS_LOG1( "BST_CORE_CNPTask::Inquired enParamId=%u is invalid", usDataSize ); return BST_CORE_INVALID_INQUIRED_LEN; } if ( ( BST_NULL_PTR == pData ) || ( 0 == usDataSize ) ) { BST_RLS_LOG2( "BST_CORE_CNPTask::Inquired pData=%p,usDataSize=%u", pData, usDataSize ); return BST_CORE_INVALID_INQUIRED_LEN; } if ( BST_NULL_PTR == m_pSocket ) { BST_RLS_LOG( "BST_CORE_CNPTask::Inquired m_pSocket=NULL" ); return BST_CORE_INVALID_INQUIRED_LEN; } switch ( enParamId ) { case BST_PID_SOCKET_PROPERTY: return InquiredSocketProperty( usDataSize, pData ); case BST_PID_TRAFFIC_FLOW: return InquiredTrafficFlow( usDataSize, pData ); default: return PidInquired ( enParamId, usDataSize, pData ); } }
BST_ERR_ENUM_UINT8 BST_CORE_CNPTask::Configed( BST_CORE_PID_ENUM_UINT16 enParamId, BST_UINT16 usLen, const BST_VOID *const pData, BST_UINT8 **pucNewAddr ) { BST_ERR_ENUM_UINT8 ucRtnVal; if ( !BST_CORE_IsPidValid ( enParamId ) ) { BST_RLS_LOG1( "BST_CORE_CNPTask::Configed enParamId=%d", enParamId ); return BST_ERR_PAR_UNKNOW; } if ( BST_NULL_PTR == pData ) { BST_RLS_LOG( "BST_CORE_CNPTask::Configed pData=NULL" ); return BST_ERR_INVALID_PTR; } if ( BST_NULL_PTR == pucNewAddr ) { BST_RLS_LOG( "BST_CORE_CNPTask::Configed pucNewAddr=NULL" ); return BST_ERR_INVALID_PTR; } ucRtnVal = BST_NO_ERROR_MSG; *pucNewAddr = BST_NULL_PTR; switch ( enParamId ) { case BST_PID_PERIODIC: ucRtnVal = ConfigedPriodic( usLen, pData, pucNewAddr); break; case BST_PID_SOCKET_INFO: ucRtnVal = ConfigedSockeInfo( usLen, pData, pucNewAddr); break; case BST_PID_SOCKET_PROPERTY: ucRtnVal = ConfigedSockeProperty( usLen, pData, pucNewAddr); break; default: ucRtnVal = BST_ERR_PAR_UNKNOW; break; } switch ( ucRtnVal ) { case BST_NO_ERROR_MSG: PidConfiged ( enParamId, usLen, pData, m_CfgedFlag, pucNewAddr ); break; case BST_ERR_PAR_UNKNOW: ucRtnVal = PidConfiged ( enParamId, usLen, pData, m_CfgedFlag, pucNewAddr ); break; default: break; } return ucRtnVal; }