Loading...
Searching...
No Matches

Messaging API. More...

Detailed Description

Messaging API.

Author
Carl Seifert carl..nosp@m.seif.nosp@m.ert@t.nosp@m.u-dr.nosp@m.esden.nosp@m..de

Definition in file messaging.h.

#include <stdint.h>
#include "net/unicoap.h"
+ Include dependency graph for messaging.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  unicoap_exchange_arg_t
 Argument passed to exchange-layer processing function. More...
 

Private Messaging API

#define UNICOAP_MESSAGING_FLAGS_DEFAULT   (0)
 The messaging flags the stack uses when no source for messaging flags is available.
 
enum  unicoap_messaging_flags_t { UNICOAP_MESSAGING_FLAG_RELIABLE = 0x01 , UNICOAP_MESSAGING_FLAG_TRACK = 0x80 }
 Messaging layer result after initial treatment of an inbound message. More...
 
enum  unicoap_preprocessing_result_t {
  UNICOAP_PREPROCESSING_ERROR_INVALID_CODE_CLASS = -0x1001 , UNICOAP_PREPROCESSING_ERROR_UNSUPPORTED = -0x1002 , UNICOAP_PREPROCESSING_ERROR_RESPONSE_UNEXPECTED = -0x1004 , UNICOAP_PREPROCESSING_ERROR_NOTIFICATION_UNEXPECTED = -0x100c ,
  UNICOAP_PREPROCESSING_ERROR_TRUNCATED = -0x1010 , UNICOAP_PREPROCESSING_ERROR_REQUEST = -0x1020 , UNICOAP_PREPROCESSING_SUCCESS_RESPONSE = 0x1001 , UNICOAP_PREPROCESSING_SUCCESS_REQUEST = 0x1002
}
 Result of unicoap_exchange_preprocess. More...
 
enum  unicoap_messaging_rfc7252_event_type_t { UNICOAP_MESSAGING_RFC7252_EVENT_RX = 1 , UNICOAP_MESSAGING_RFC7252_EVENT_TRUNCATED = 1 << 1 , UNICOAP_MESSAGING_RFC7252_EVENT_SESSION_ESTABLISHED = 1 << 2 }
 RFC 7252 event used to notify messaging layer of a change. More...
 
unicoap_preprocessing_result_t unicoap_exchange_preprocess (unicoap_packet_t *packet, unicoap_messaging_flags_t *flags, unicoap_exchange_arg_t *arg, bool truncated)
 Performs initial processing of a CoAP packet after it has been parsed.
 
int unicoap_exchange_process (unicoap_packet_t *packet, unicoap_exchange_arg_t arg)
 Processes message.
 
int unicoap_messaging_process_rfc7252 (const uint8_t *pdu, size_t size, unicoap_messaging_rfc7252_event_type_t event, unicoap_packet_t *packet)
 Internal RFC 7252 messaging inbound processor.
 
int unicoap_messaging_send (unicoap_packet_t *packet, unicoap_messaging_flags_t flags, void *exchange)
 Forwards packet to messaging layer and the corresponding driver for further message processing, encoding, and transport I/O.
 
int unicoap_messaging_send_rfc7252 (unicoap_packet_t *packet, unicoap_messaging_flags_t flags, void *exchange)
 Sends CoAP over UDP or DTLS packet, see unicoap_messaging_send.
 
void unicoap_generate_token (uint8_t *token)
 Generates new token.
 
static unicoap_messaging_flags_t _messaging_flags_resource (unicoap_resource_flags_t resource_flags)
 Retrieves the part of a resource flags bitfield relevant for the messaging driver.
 
static unicoap_messaging_flags_t _messaging_flags_client (unicoap_request_flags_t request_flags)
 Retrieves the part of a request flags bitfield relevant for the messaging driver.
 

Server

int unicoap_server_process_request (unicoap_packet_t *packet, const unicoap_resource_t *resource)
 Informs the unicoap server a new packet has been preprocessed and can be handled.
 
int unicoap_server_send_response_body (unicoap_packet_t *packet, const unicoap_resource_t *resource)
 Sends entire response body, may be split into parts and then sent.
 

Client

int unicoap_client_process_response (unicoap_packet_t *packet, unicoap_client_memo_t *memo)
 Informs the unicoap client a new packet has been preprocessed and can be handled.
 
int unicoap_client_send_request_part (unicoap_packet_t *packet, unicoap_client_memo_t *memo, unicoap_request_flags_t request_flags)
 Sends part of request body, such as single request in a block-wise transfer.
 
int unicoap_client_send_request_body (unicoap_message_t *request, unicoap_endpoint_t *endpoint, unicoap_callback_t callback, unicoap_request_parameters_t *parameters, unicoap_request_flags_t flags)
 Sends entire request body, may be split into parts and then sent.