riot_sys::bindgen

Function gcoap_obs_init

Source
pub unsafe extern "C" fn gcoap_obs_init(
    pdu: *mut coap_pkt_t,
    buf: *mut u8,
    len: size_t,
    resource: *const coap_resource_t,
) -> c_int
Expand description

@brief Initializes a CoAP Observe notification packet on a buffer, for the observer registered for a resource

First verifies that an observer has been registered for the resource.

@post If this function returns @see GCOAP_OBS_INIT_OK you have to call @ref gcoap_obs_send() afterwards to release a mutex.

@param[out] pdu Notification metadata @param[out] buf Buffer containing the PDU @param[in] len Length of the buffer @param[in] resource Resource for the notification

@return GCOAP_OBS_INIT_OK on success @return GCOAP_OBS_INIT_ERR on error @return GCOAP_OBS_INIT_UNUSED if no observer for resource