Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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...
 
int 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

◆ udp_check_free_space()

int 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
number of bytes available or 0 if not enough

Definition at line 83 of file udp.c.

References p, and UDP_TX_BUFFER_SIZE.

Referenced by udp_periph_init().

+ Here is the caller graph for this function:

◆ udp_periph_init()

void udp_periph_init ( struct udp_periph p,
char *  host,
int  port_out,
int  port_in,
bool  broadcast 
)

Initialize the UDP peripheral.

Definition at line 60 of file udp.c.

References p, udp_arch_periph_init(), udp_char_available(), udp_check_free_space(), udp_getch(), udp_put_buffer(), udp_put_byte(), and udp_send_message().

+ Here is the call graph for this function:

◆ udp_put_buffer()

void WEAK udp_put_buffer ( struct udp_periph p,
long  fd,
const uint8_t data,
uint16_t  len 
)

Definition at line 104 of file udp.c.

References p, and UDP_TX_BUFFER_SIZE.

Referenced by udp_periph_init().

+ Here is the caller graph for this function:

◆ udp_put_byte()

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 94 of file udp.c.

References p, and UDP_TX_BUFFER_SIZE.

Referenced by udp_periph_init().

+ Here is the caller graph for this function: