Paparazzi UAS  v5.15_devel-88-gb3ad7fe
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
udp.c File Reference

arch independent UDP API More...

#include "mcu_periph/udp.h"
#include <string.h>
+ Include dependency graph for udp.c:

Go to the source code of this file.

Functions

void udp_periph_init (struct udp_periph *p, char *host, int port_out, int port_in, bool broadcast)
 Initialize the UDP peripheral. More...
 
bool WEAK udp_check_free_space (struct udp_periph *p, long *fd, uint16_t len)
 Check if there is enough free space in the transmit buffer. More...
 
void WEAK udp_put_byte (struct udp_periph *p, long fd, uint8_t data)
 Add one data byte to the tx buffer. More...
 
void WEAK udp_put_buffer (struct udp_periph *p, long fd, const uint8_t *data, uint16_t len)
 

Detailed Description

arch independent UDP API

Definition in file udp.c.

Function Documentation

bool WEAK udp_check_free_space ( struct udp_periph p,
long *  fd,
uint16_t  len 
)

Check if there is enough free space in the transmit buffer.

Parameters
ppointer to UDP peripheral
lenhow many bytes of free space to check for
Returns
TRUE if enough space for len bytes

Definition at line 83 of file udp.c.

References udp_periph::tx_insert_idx, and UDP_TX_BUFFER_SIZE.

Referenced by udp_periph_init().

+ Here is the caller graph for this function:

void udp_periph_init ( struct udp_periph p,
char *  host,
int  port_out,
int  port_in,
bool  broadcast 
)
void WEAK udp_put_buffer ( struct udp_periph p,
long  fd,
const uint8_t data,
uint16_t  len 
)

Definition at line 103 of file udp.c.

References udp_periph::tx_buf, udp_periph::tx_insert_idx, and UDP_TX_BUFFER_SIZE.

Referenced by udp_periph_init().

+ Here is the caller graph for this function:

void WEAK udp_put_byte ( struct udp_periph p,
long  fd,
uint8_t  data 
)

Add one data byte to the tx buffer.

Parameters
ppointer to UDP peripheral
databyte to add to tx buffer

Definition at line 93 of file udp.c.

References udp_periph::tx_buf, udp_periph::tx_insert_idx, and UDP_TX_BUFFER_SIZE.

Referenced by udp_periph_init().

+ Here is the caller graph for this function: