1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sock/async: introduce function to retrieve session of current DTLS event

This commit is contained in:
János Brodbeck 2021-01-12 19:19:33 +01:00
parent 3fdf9f925e
commit 80d592b1b8
No known key found for this signature in database
GPG Key ID: 65C193B0D8D1BCE6

View File

@ -32,6 +32,24 @@ extern "C" {
#if defined(SOCK_HAS_ASYNC) || defined(DOXYGEN)
#if defined(MODULE_SOCK_DTLS) || defined(DOXYGEN)
/**
* @brief Gets the asynchronous event session from sock object
*
* @pre `(sock != NULL) && (session != NULL)`
*
* @note Only available with @ref SOCK_HAS_ASYNC defined.
* Should only be called within a DTLS event and session is only available
* for the event types @ref SOCK_ASYNC_CONN_RDY and @ref SOCK_ASYNC_CONN_FIN.
* For other event types use @ref sock_dtls_recv() to get the session.
*
* @param[in] sock The DTLS sock object of the current event.
* @param[out] session Session object of the current event.
*
* @return true if the event session is available, false otherwise.
*/
bool sock_dtls_get_event_session(sock_dtls_t *sock,
sock_dtls_session_t *session);
/**
* @brief Gets the asynchronous event context from sock object
*