libcoap 4.3.5-develop-146e0bb
Loading...
Searching...
No Matches
Datagram (UDP) Support

Internal API for handling CoAP Datagrams (UDP) (RFC7252) More...

+ Collaboration diagram for Datagram (UDP) Support:

Functions

ssize_t coap_socket_send (coap_socket_t *sock, coap_session_t *session, const uint8_t *data, size_t datalen)
 Function interface for data transmission.
 
ssize_t coap_socket_recv (coap_socket_t *sock, coap_packet_t *packet)
 Function interface for reading data.
 
void coap_socket_dgrm_close (coap_socket_t *sock)
 Function interface to close off a datagram socket.
 

Detailed Description

Internal API for handling CoAP Datagrams (UDP) (RFC7252)

Function Documentation

◆ coap_socket_dgrm_close()

void coap_socket_dgrm_close ( coap_socket_t sock)

Function interface to close off a datagram socket.

Internal function.

Parameters
sockSocket to close.

Definition at line 891 of file coap_dgrm_posix.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ coap_socket_recv()

ssize_t coap_socket_recv ( coap_socket_t sock,
coap_packet_t packet 
)

Function interface for reading data.

This function returns the number of bytes that have been read, or a value less than zero on error. In case of an error, *packet is set to NULL.

Internal function.

Parameters
sockSocket to read data from.
packetReceived packet metadata and payload. src and dst should be preset.
Returns
The number of bytes received on success, or a value less than zero on error.

Definition at line 671 of file coap_dgrm_posix.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ coap_socket_send()

ssize_t coap_socket_send ( coap_socket_t sock,
coap_session_t session,
const uint8_t *  data,
size_t  datalen 
)

Function interface for data transmission.

This function returns the number of bytes that have been transmitted, or a value less than zero on error.

Internal function.

Parameters
sockSocket to send data over.
sessionAddressing information for unconnected sockets, or NULL
dataThe data to send.
datalenThe actual length of data.
Returns
The number of bytes written on success, or a value less than zero on error.

Definition at line 478 of file coap_dgrm_posix.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: