/* Signals that the caller is done with processing a reception PDU. Should be called by a channel after receiving the TBX_MB_EVENT_ID_PDU_RECEIVED event and no longer needing access to the PDU stored in the transport layer context.  */
static void TbxMbRtuReceptionDone(tTbxMbTp transport)
/* Signals that the caller is done with processing a reception PDU. Should be called by a channel after receiving the TBX_MB_EVENT_ID_PDU_RECEIVED event and no longer needing access to the PDU stored in the transport layer context.  */
static void TbxMbRtuReceptionDone(tTbxMbTp transport)
{
  TBX_ASSERT(transport != NULL);
  if (transport != NULL)
  {
    tTbxMbTpCtx * tpCtx = (tTbxMbTpCtx *)transport;
    TBX_ASSERT(tpCtx->type == TBX_MB_RTU_CONTEXT_TYPE);
    TbxCriticalSectionEnter();
    uint8_t currentState = tpCtx->state;
    TbxCriticalSectionExit();
    TBX_ASSERT(currentState == TBX_MB_RTU_STATE_VALIDATION);
    if (currentState == TBX_MB_RTU_STATE_VALIDATION)
    {
      TbxCriticalSectionEnter();
      tpCtx->state = TBX_MB_RTU_STATE_IDLE;
      TbxCriticalSectionExit();
    }
  }
}