Ucs_AmsTx_Msg_t* Ucs_AmsTx_AllocMsg | ( | Ucs_Inst_t * | self, |
uint16_t | data_size | ||
) |
Allocates an application message object for transmission.
This function retrieves a Tx message object with a payload buffer of the given size. The application must take care that Ucs_AmsTx_Msg_t::data_size of the resulting message object does not exceed the amount of provided payload.
The application is also allowed to provide own payload to the message object. In this case the application is allowed to call this function and pass data_size "0". The application can set Ucs_AmsTx_Msg_t::data_ptr and Ucs_AmsTx_Msg_t::data_size of the returned message object to the application provided payload.
self | The instance |
data_size | Required payload size which needs to be allocated. Valid values: 0..65535. |
NULL
if no Tx message object is available. If the function returns NULL
the application can use ams.tx.message_freed_fptr as trigger to request a message object again.