static osaStatus_t HostInterface_RxQueueMsgGet(hostInterface_packet_t * pHostInterface_packet) { osa_status_t status; status = OSA_MsgQGet(hostInterface_rxQueueHnd, (hostInterface_packet_t *)pHostInterface_packet, gHostInterface_waitTimeout); if(status == kStatus_OSA_Error) { panic(0,0,0,0); } return (osaStatus_t) status; }
static osa_status_t HostInterface_RxQueueMsgGet ( hostInterface_packet_t* pHostInterface_packet ) { osa_status_t status = OSA_MsgQGet(hostInterface_rxQueueHnd, (hostInterface_packet_t *)pHostInterface_packet, gHostInterface_waitTimeout); if ( kStatus_OSA_Error == status ) { catch(2); } return (osa_status_t)status; }
/** * This function gets a message from the head of the Tx message queue. * * @param pHostInterface_packet Pointer to a memory to save the packet. * * @return kStatus_OSA_Success Message successfully obtained from the queue. * kStatus_OSA_Error Process fail. */ static osa_status_t HostInterface_TxQueueMsgGet ( hostInterface_packet_t* pHostInterface_packet ) { osa_status_t status = OSA_MsgQGet(hostInterface_txQueueHnd, (hostInterface_packet_t*)pHostInterface_packet, OSA_WAIT_FOREVER); if ( kStatus_OSA_Error == status ) { catch(2); } return (osa_status_t)status; }
/* Message queue */ uint32_t OS_MsgQ_recv(os_msgq_handle msgq, void* msg, uint32_t flag, uint32_t timeout) { osa_status_t status; uint32_t re; status = OSA_MsgQGet((msg_queue_handler_t)msgq, msg, (!(OS_MSGQ_RECEIVE_BLOCK_ON_EMPTY & flag)) ? 0u : ((0==timeout) ? OSA_WAIT_FOREVER : timeout)); switch(status) { case kStatus_OSA_Success: re = (uint32_t) OS_MSGQ_OK; break; case kStatus_OSA_Timeout: re = (uint32_t) OS_MSGQ_TIMEOUT; break; default: re = (uint32_t) OS_MSGQ_ERROR; break; } return re; }
uint32_t OS_MsgQ_Is_Empty(os_msgq_handle msgq, void* msg) { return (kStatus_OSA_Success == OSA_MsgQGet((msg_queue_handler_t) msgq, msg, 0)) ? 0 : 1; }