![]() |
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
arch independent UDP API More...
#include "std.h"
#include "mcu_periph/udp_arch.h"
#include "pprzlink/pprzlink_device.h"
Go to the source code of this file.
Data Structures | |
struct | udp_periph |
Macros | |
#define | UDP_RX_BUFFER_SIZE 256 |
#define | UDP_TX_BUFFER_SIZE 256 |
Functions | |
void | udp_periph_init (struct udp_periph *p, char *host, int port_out, int port_in, bool broadcast) |
Initialize the UDP peripheral. | |
int | udp_check_free_space (struct udp_periph *p, long *fd, uint16_t len) |
Check if there is enough free space in the transmit buffer. | |
void | udp_put_byte (struct udp_periph *p, long fd, uint8_t data) |
Add one data byte to the tx buffer. | |
int | udp_char_available (struct udp_periph *p) |
Get number of bytes available in receive buffer. | |
uint8_t | udp_getch (struct udp_periph *p) |
Get the last character from the receive buffer. | |
void | udp_arch_periph_init (struct udp_periph *p, char *host, int port_out, int port_in, bool broadcast) |
Initialize the UDP peripheral. | |
void | udp_send_message (struct udp_periph *p, long fd) |
Send a message. | |
void | udp_send_raw (struct udp_periph *p, long fd, uint8_t *buffer, uint16_t size) |
Send a packet from another buffer. | |
void | udp_receive (struct udp_periph *p) |
Read bytes from UDP. | |
void | udp_put_buffer (struct udp_periph *p, long fd, const uint8_t *data, uint16_t len) |
arch independent UDP API
Definition in file udp.h.
struct udp_periph |
Data Fields | ||
---|---|---|
struct link_device | device | Generic device interface. |
void * | network | UDP network. |
uint8_t | rx_buf[UDP_RX_BUFFER_SIZE] | Receive buffer. |
uint16_t | rx_extract_idx | |
uint16_t | rx_insert_idx | |
uint8_t | tx_buf[UDP_TX_BUFFER_SIZE] | Transmit buffer. |
uint16_t | tx_insert_idx |
|
extern |
Initialize the UDP peripheral.
Allocate UdpSocket struct and create and bind the UDP socket.
Definition at line 71 of file udp_arch.c.
References foo, p, and udp_socket_create().
Referenced by udp_periph_init().
|
extern |
Get number of bytes available in receive buffer.
p | pointer to UDP peripheral |
Definition at line 83 of file udp_arch.c.
References foo, p, udp_mutex, and UDP_RX_BUFFER_SIZE.
Referenced by udp_periph_init(), and udp_receive().
|
extern |
Check if there is enough free space in the transmit buffer.
p | pointer to UDP peripheral |
len | how many bytes of free space to check for |
Definition at line 83 of file udp.c.
References p, and UDP_TX_BUFFER_SIZE.
Referenced by udp_periph_init().
|
extern |
Get the last character from the receive buffer.
p | pointer to UDP peripheral |
Definition at line 99 of file udp_arch.c.
References foo, p, udp_mutex, and UDP_RX_BUFFER_SIZE.
Referenced by udp_periph_init().
|
extern |
Initialize the UDP peripheral.
Definition at line 60 of file udp.c.
References foo, p, udp_periph::rx_insert_idx, udp_arch_periph_init(), udp_char_available(), udp_check_free_space(), udp_getch(), udp_put_buffer(), udp_put_byte(), and udp_send_message().
Definition at line 104 of file udp.c.
References foo, p, and UDP_TX_BUFFER_SIZE.
Referenced by udp_periph_init().
|
extern |
Add one data byte to the tx buffer.
p | pointer to UDP peripheral |
data | byte 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().
|
extern |
Read bytes from UDP.
Definition at line 111 of file udp_arch.c.
References foo, p, udp_char_available(), udp_mutex, and UDP_RX_BUFFER_SIZE.
Referenced by udp_thread().
|
extern |
Send a message.
Definition at line 144 of file udp_arch.c.
Referenced by udp_periph_init().
|
extern |
Send a packet from another buffer.
Definition at line 169 of file udp_arch.c.