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 }
 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...
 
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_exchange_release_endpoint_state (const unicoap_endpoint_t *endpoint)
 Releases all buffers and state allocated in connection with the given endpoint.
 
int unicoap_messaging_process_rfc7252 (const uint8_t *pdu, size_t size, bool truncated, unicoap_packet_t *packet)
 Internal RFC 7252 messaging inbound processor.
 
int unicoap_messaging_send (unicoap_packet_t *packet, unicoap_messaging_flags_t flags)
 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)
 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.
 

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.