libcoap  4.3.0rc1
coap_io_riot.c File Reference
#include "coap2/coap_internal.h"
#include <errno.h>
#include "net/gnrc.h"
#include "net/gnrc/ipv6.h"
#include "net/gnrc/netreg.h"
#include "net/udp.h"
#include "coap_riot.h"
+ Include dependency graph for coap_io_riot.c:

Go to the source code of this file.

Functions

ssize_t coap_network_send (coap_socket_t *sock, const coap_session_t *session, const uint8_t *data, size_t datalen)
 
static udp_hdr_t * get_udp_header (gnrc_pktsnip_t *pkt)
 
ssize_t coap_network_read (coap_socket_t *sock, struct coap_packet_t *packet)
 Function interface for reading data. More...
 
void coap_riot_startup (void)
 This function must be called in the RIOT CoAP thread for RIOT-specific initialization. More...
 
static uint16_t get_port (const coap_address_t *addr)
 Returns the port of addr in network byte order or 0 on error. More...
 
static coap_socket_tfind_socket (coap_fd_t fd, coap_socket_t *sockets[], unsigned int num_sockets)
 
static bool address_equals (const coap_address_t *a, const ipv6_addr_t *b)
 
int coap_io_process (coap_context_t *ctx, uint32_t timeout_ms)
 The main I/O processing function. More...
 

Variables

static msg_t _msg_q [LIBCOAP_MSG_QUEUE_SIZE]
 

Function Documentation

◆ address_equals()

static bool address_equals ( const coap_address_t a,
const ipv6_addr_t *  b 
)
static

Definition at line 174 of file coap_io_riot.c.

+ Here is the caller graph for this function:

◆ coap_network_read()

ssize_t coap_network_read ( coap_socket_t sock,
struct 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.

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 71 of file coap_io_riot.c.

+ Here is the call graph for this function:

◆ coap_network_send()

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

Definition at line 42 of file coap_io_riot.c.

+ Here is the call graph for this function:

◆ coap_riot_startup()

void coap_riot_startup ( void  )

This function must be called in the RIOT CoAP thread for RIOT-specific initialization.

Definition at line 144 of file coap_io_riot.c.

◆ find_socket()

static coap_socket_t* find_socket ( coap_fd_t  fd,
coap_socket_t sockets[],
unsigned int  num_sockets 
)
static

Definition at line 165 of file coap_io_riot.c.

+ Here is the caller graph for this function:

◆ get_port()

static uint16_t get_port ( const coap_address_t addr)
static

Returns the port of addr in network byte order or 0 on error.

Definition at line 152 of file coap_io_riot.c.

+ Here is the caller graph for this function:

◆ get_udp_header()

static udp_hdr_t* get_udp_header ( gnrc_pktsnip_t *  pkt)
static

Definition at line 65 of file coap_io_riot.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ _msg_q

msg_t _msg_q[LIBCOAP_MSG_QUEUE_SIZE]
static

Definition at line 141 of file coap_io_riot.c.