Logo
UNICENS V2.1.0-3491
User Manual and API Reference
Ucs_Return_t Ucs_AmsTx_SendMsg ( Ucs_Inst_t self,
Ucs_AmsTx_Msg_t msg_ptr,
Ucs_AmsTx_CompleteCb_t  tx_complete_fptr 
)

Transmits an application message.

Parameters
selfThe instance
msg_ptrReference to the related Tx message object
tx_complete_fptrCallback function that is invoked as soon as the transmission was finished and the transmission result is available. The application must assign a callback function if the transmission result is required or the Tx message object uses external payload which needs to be reused or freed by the application. Otherwise the application is allowed to pass NULL.
Note
It is important that msg_ptr is the reference to an object which was previously obtained from Ucs_AmsTx_AllocMsg(). The application must not pass the reference of a self-created Tx message object to this function.
Returns
Possible return values are shown in the table below.
ValueDescription
UCS_RET_SUCCESSNo error
UCS_RET_ERR_PARAM Invalid parameter is given. Possible reasons are:
  • msg_ptr is NULL
  • destination_address is smaller than 0x10 (reserved for internal communication)
  • data_size of a broad or group-cast message is larger than 45
Either the application must modify the message and retry the function call, or must free the message object via Ucs_AmsTx_FreeUnusedMsg().
UCS_RET_ERR_NOT_INITIALIZEDUNICENS is not initialized.
Message objects that have been allocated during initialized state are no longer valid.