[udp] expose UDP receiver API (#3477)

This commit is contained in:
Yakun Xu
2019-01-18 06:50:39 -08:00
committed by Jonathan Hui
parent 8112a6376f
commit d57b747c98
4 changed files with 54 additions and 7 deletions
+24
View File
@@ -73,6 +73,30 @@ typedef struct otUdpReceiver
void * mContext; ///< A pointer to application-specific context.
} otUdpReceiver;
/**
* This function adds a UDP receiver.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aUdpReceiver A pointer to the UDP receiver.
*
* @retval OT_ERROR_NONE The receiver is successfully added.
* @retval OT_ERROR_ALREADY The UDP receiver was already added.
*
*/
otError otUdpAddReceiver(otInstance *aInstance, otUdpReceiver *aUdpReceiver);
/**
* This function removes a UDP receiver.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aUdpReceiver A pointer to the UDP receiver.
*
* @retval OT_ERROR_NONE The receiver is successfully removed.
* @retval OT_ERROR_NOT_FOUND The UDP receiver was not added.
*
*/
otError otUdpRemoveReceiver(otInstance *aInstance, otUdpReceiver *aUdpReceiver);
/**
* This callback allows OpenThread to inform the application of a received UDP message.
*