VOS_VOID IPS_MNTN_FillMsg(OM_APP_TRACE_STRU *pstAppTrace, VOS_UINT32 ulMsgName, VOS_UINT32 ulMsgLen) { if (VOS_NULL_PTR == pstAppTrace) { return; } /* 填充信息 */ pstAppTrace->stAppHeader.ucFuncType = OM_TRANS_FUNC; pstAppTrace->stAppHeader.usLength = (VOS_UINT16)(ulMsgLen - VOS_OM_HEADER_LEN); OM_AcpuAddSNTime(&(pstAppTrace->stAppHeader.ulSn), &(pstAppTrace->stAppHeader.ulTimeStamp)); pstAppTrace->usPrimId = (VOS_UINT16)ulMsgName; pstAppTrace->usToolId = 0; }
VOS_VOID OM_SndPrintfToOm(VOS_CHAR *pcData, VOS_UINT32 ulLength) { VOS_UINT32 ulRet; OM_APP_TRACE_STRU *pstAppMsg; /* 分配消息空间 */ pstAppMsg = (OM_APP_TRACE_STRU*)VOS_MemAlloc(WUEPS_PID_OM, DYNAMIC_MEM_PT, ulLength + OM_APP_TRACE_LEN); if (VOS_NULL_PTR == pstAppMsg) { g_ulPrintfErrType = OM_ERR_MALLOC; return; } /* 拷贝消息内容 */ VOS_MemCpy(pstAppMsg->aucPara, pcData, ulLength); /* 添加消息头部字段 */ pstAppMsg->stAppHeader.ucFuncType = OM_PRINTF_FUNC; pstAppMsg->stAppHeader.usLength = ((VOS_UINT16)ulLength + OM_APP_TRACE_LEN) - VOS_OM_HEADER_LEN; pstAppMsg->usPrimId = OM_APP_OM_PRINTF_IND; pstAppMsg->usToolId = 0; /* 添加消息序号和时间戳 */ OM_AcpuAddSNTime(&(pstAppMsg->stAppHeader.ulSn), &(pstAppMsg->stAppHeader.ulTimeStamp)); /* 调用OM API将数据放入OM链路 ringbuffer*/ ulRet = OM_AcpuSendData((OM_RSP_PACKET_STRU*)pstAppMsg, (VOS_UINT16)(ulLength + OM_APP_TRACE_LEN)); if (VOS_OK != ulRet) { g_ulPrintfErrType = OM_ERR_SENDTOOMBUF; } VOS_MemFree(WUEPS_PID_OM, pstAppMsg); return; }