coap_context_t, coap_fixed_point_t, coap_mcast_set_hops, coap_mid_t, coap_new_message_id, coap_pdu_get_token,
coap_pdu_t, coap_response_t, coap_response_t_COAP_RESPONSE_FAIL, coap_response_t_COAP_RESPONSE_OK, coap_send,
coap_session_get_addr_remote, coap_session_get_ifindex, coap_session_get_max_retransmit, coap_session_get_proto,
coap_session_get_state, coap_session_get_type, coap_session_init_token, coap_session_max_pdu_size,
coap_session_new_token, coap_session_send_ping, coap_session_set_ack_random_factor, coap_session_set_ack_timeout,
coap_session_state_t_COAP_SESSION_STATE_ESTABLISHED, coap_session_state_t_COAP_SESSION_STATE_HANDSHAKE,
coap_session_state_t_COAP_SESSION_STATE_NONE, coap_session_t, coap_session_type_t_COAP_SESSION_TYPE_CLIENT,
use libcoap_sys::{coap_session_get_psk_hint, coap_session_get_psk_identity, coap_session_get_psk_key};
/// fractional part is a value from 0-999 and represents the first three digits after the comma.
let random_factor = unsafe { coap_session_get_ack_random_factor(self.inner_ref().raw_session) };
/// fractional part is a value from 0-999 and represents the first three digits after the comma.
// In some cases the default hoplimit of 1 is not enough to reach the destination. Choose limit accordingly
unsafe { coap_session_new_token(self.inner_mut().raw_session, &mut length, token.as_mut_ptr()) }
fn send<P: Into<CoapMessage>>(&self, pdu: P) -> Result<CoapMessageId, MessageConversionError> {
fn send_request(&self, mut req: CoapRequest) -> Result<CoapRequestHandle, MessageConversionError> {
coap_session_new_token(self.inner_mut().raw_session, &mut token_len, token_tmp.as_mut_ptr());
fn poll_handle(&self, handle: &CoapRequestHandle) -> std::collections::vec_deque::IntoIter<CoapResponse> {
/// Any future responses to the request associated with this handle will be responded to with an
/// Therefore, callers of this function should ensure that the created session instance does not
/// The provided pointer must be valid, the provided session's app data must be a valid argument
/// to [`CoapFfiRcCell<CoapClientSessionInner>::clone_raw_rc`](crate::mem::CoapFfiRcCell::clone_raw_rc)
/// or [`CoapFfiRcCell<CoapServerSessionInner>::clone_raw_rc`](crate::mem::CoapFfiRcCell::clone_raw_rc)
coap_session_type_t_COAP_SESSION_TYPE_CLIENT => CoapClientSession::from_raw(raw_session).into(),
/// Can be used in calls to [CoapSessionCommon::poll_handle()] to check for responses to the sent
let token: CoapToken = CoapToken::from(std::slice::from_raw_parts(raw_token.s, raw_token.length));
if let Ok(message) = CoapMessage::from_raw_pdu(received).and_then(CoapResponse::from_message) {