[][src]Function libcoap_sys::coap_register_async

pub unsafe extern "C" fn coap_register_async(
    context: *mut coap_context_t,
    session: *mut coap_session_t,
    request: *mut coap_pdu_t,
    flags: c_uchar,
    data: *mut c_void
) -> *mut coap_async_state_t

Allocates a new coap_async_state_t object and fills its fields according to the given @p request. The @p flags are used to control generation of empty ACK responses to stop retransmissions and to release registered @p data when the resource is deleted by coap_free_async(). This function returns a pointer to the registered coap_async_t object or @c NULL on error. Note that this function will return @c NULL in case that an object with the same identifier is already registered.

@param context The context to use. @param session The session that is used for asynchronous transmissions. @param request The request that is handled asynchronously. @param flags Flags to control state management. @param data Opaque application data to register. Note that the storage occupied by @p data is released on destruction only if flag COAP_ASYNC_RELEASE_DATA is set.

@return A pointer to the registered coap_async_state_t object or @c NULL in case of an error.