Contiki-NG
|
Topics | |
CoAP transport implementation for uIP | |
Functions | |
void | coap_endpoint_copy (coap_endpoint_t *dest, const coap_endpoint_t *src) |
Copy a CoAP endpoint from one memory area to another. | |
int | coap_endpoint_cmp (const coap_endpoint_t *e1, const coap_endpoint_t *e2) |
Compare two CoAP endpoints. | |
void | coap_endpoint_log (const coap_endpoint_t *ep) |
Print a CoAP endpoint via the logging module. | |
void | coap_endpoint_print (const coap_endpoint_t *ep) |
Print a CoAP endpoint. | |
int | coap_endpoint_snprint (char *str, size_t size, const coap_endpoint_t *ep) |
Print a CoAP endpoint to a string. | |
int | coap_endpoint_parse (const char *text, size_t size, coap_endpoint_t *ep) |
Parse a CoAP endpoint. | |
int | coap_endpoint_is_secure (const coap_endpoint_t *ep) |
Check if a CoAP endpoint is secure (encrypted). | |
int | coap_endpoint_is_connected (const coap_endpoint_t *ep) |
Check if a CoAP endpoint is connected. | |
int | coap_endpoint_connect (coap_endpoint_t *ep) |
Request a connection to a CoAP endpoint. | |
void | coap_endpoint_disconnect (coap_endpoint_t *ep) |
Request that any connection to a CoAP endpoint is discontinued. | |
uint8_t * | coap_databuf (void) |
Returns a common data buffer that can be used when generating CoAP messages for transmission. | |
int | coap_sendto (const coap_endpoint_t *ep, const uint8_t *data, uint16_t len) |
Send a message to the specified CoAP endpoint. | |
void | coap_transport_init (void) |
Initialize the CoAP transport. | |
The CoAP transport API defines a common interface for sending/receiving CoAP messages.
uint8_t * coap_databuf | ( | void | ) |
Returns a common data buffer that can be used when generating CoAP messages for transmission.
The buffer size is at least COAP_MAX_PACKET_SIZE bytes.
In Contiki-NG, this corresponds to the uIP buffer.
Definition at line 322 of file coap-uip.c.
References uip_appdata.
Referenced by coap_separate_accept().
int coap_endpoint_cmp | ( | const coap_endpoint_t * | e1, |
const coap_endpoint_t * | e2 ) |
Compare two CoAP endpoints.
e1 | A pointer to the first CoAP endpoint. |
e2 | A pointer to the second CoAP endpoint. |
Definition at line 163 of file coap-uip.c.
int coap_endpoint_connect | ( | coap_endpoint_t * | ep | ) |
Request a connection to a CoAP endpoint.
ep | A pointer to a CoAP endpoint. |
Definition at line 287 of file coap-uip.c.
void coap_endpoint_copy | ( | coap_endpoint_t * | dest, |
const coap_endpoint_t * | src ) |
Copy a CoAP endpoint from one memory area to another.
dest | A pointer to a CoAP endpoint to copy to. |
src | A pointer to a CoAP endpoint to copy from. |
Definition at line 154 of file coap-uip.c.
References uip_ipaddr_copy.
Referenced by coap_separate_accept().
void coap_endpoint_disconnect | ( | coap_endpoint_t * | ep | ) |
Request that any connection to a CoAP endpoint is discontinued.
ep | A pointer to a CoAP endpoint. |
Definition at line 312 of file coap-uip.c.
int coap_endpoint_is_connected | ( | const coap_endpoint_t * | ep | ) |
Check if a CoAP endpoint is connected.
ep | A pointer to a CoAP endpoint. |
Definition at line 250 of file coap-uip.c.
References routing_driver::node_is_reachable, and uip_is_addr_linklocal.
Referenced by coap_sendto().
int coap_endpoint_is_secure | ( | const coap_endpoint_t * | ep | ) |
Check if a CoAP endpoint is secure (encrypted).
ep | A pointer to a CoAP endpoint. |
Definition at line 244 of file coap-uip.c.
Referenced by coap_sendto().
void coap_endpoint_log | ( | const coap_endpoint_t * | ep | ) |
Print a CoAP endpoint via the logging module.
ep | A pointer to the CoAP endpoint to log. |
Definition at line 94 of file coap-uip.c.
References log_6addr().
int coap_endpoint_parse | ( | const char * | text, |
size_t | size, | ||
coap_endpoint_t * | ep ) |
Parse a CoAP endpoint.
text | The string to parse. |
size | The max number of characters in the string. |
ep | A pointer to the CoAP endpoint to write to. |
Definition at line 201 of file coap-uip.c.
References start(), UIP_HTONS, and uiplib_ipaddrconv.
void coap_endpoint_print | ( | const coap_endpoint_t * | ep | ) |
Print a CoAP endpoint.
ep | A pointer to the CoAP endpoint to print. |
Definition at line 110 of file coap-uip.c.
References uiplib_ipaddr_print().
int coap_endpoint_snprint | ( | char * | str, |
size_t | size, | ||
const coap_endpoint_t * | ep ) |
Print a CoAP endpoint to a string.
The output is always null-terminated unless size is zero.
str | The string to write to. |
size | The max number of characters to write. |
ep | A pointer to the CoAP endpoint to print. |
Definition at line 126 of file coap-uip.c.
References uiplib_ipaddr_snprint().
int coap_sendto | ( | const coap_endpoint_t * | ep, |
const uint8_t * | data, | ||
uint16_t | len ) |
Send a message to the specified CoAP endpoint.
ep | A pointer to a CoAP endpoint |
data | A pointer to data to send |
len | The size of the data to send |
Definition at line 369 of file coap-uip.c.
References coap_endpoint_is_connected(), and coap_endpoint_is_secure().
Referenced by coap_separate_accept().
void coap_transport_init | ( | void | ) |
Initialize the CoAP transport.
This function initializes the CoAP transport implementation and should only be called by the CoAP engine.
Definition at line 328 of file coap-uip.c.
References coap_keystore_simple_init(), and process_start().