Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "mcu_periph/pipe.h"
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <pthread.h>
#include <sys/select.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "rt_priority.h"
Go to the source code of this file.
Macros | |
#define | PIPE_THREAD_PRIO 10 |
Functions | |
static void * | pipe_thread (void *data) |
check for new pipe packets to receive. More... | |
void | pipe_arch_init (void) |
void | pipe_arch_periph_init (struct pipe_periph *p, char *read_name, char *write_name) |
Initialize the PIPE peripheral. More... | |
int | pipe_char_available (struct pipe_periph *p) |
Get number of bytes available in receive buffer. More... | |
uint8_t | pipe_getch (struct pipe_periph *p) |
Get the last character from the receive buffer. More... | |
void | pipe_receive (struct pipe_periph *p) |
Read bytes from PIPE. More... | |
void | pipe_send_message (struct pipe_periph *p, long fd) |
Send a message. More... | |
void | pipe_send_raw (struct pipe_periph *p, long fd, uint8_t *buffer, uint16_t size) |
Send a packet from another buffer. More... | |
Variables | |
static pthread_mutex_t | pipe_mutex = PTHREAD_MUTEX_INITIALIZER |
#define PIPE_THREAD_PRIO 10 |
Definition at line 42 of file pipe_arch.c.
void pipe_arch_init | ( | void | ) |
Definition at line 48 of file pipe_arch.c.
References pipe_mutex, and pipe_thread().
void pipe_arch_periph_init | ( | struct pipe_periph * | p, |
char * | read_name, | ||
char * | write_name | ||
) |
Initialize the PIPE peripheral.
Allocate UdpSocket struct and create and bind the PIPE socket.
Definition at line 76 of file pipe_arch.c.
References p.
int pipe_char_available | ( | struct pipe_periph * | p | ) |
Get number of bytes available in receive buffer.
p | pointer to PIPE peripheral |
Definition at line 104 of file pipe_arch.c.
References p, pipe_mutex, and PIPE_RX_BUFFER_SIZE.
uint8_t pipe_getch | ( | struct pipe_periph * | p | ) |
Get the last character from the receive buffer.
p | pointer to PIPE peripheral |
Definition at line 120 of file pipe_arch.c.
References p, pipe_mutex, and PIPE_RX_BUFFER_SIZE.
void pipe_receive | ( | struct pipe_periph * | p | ) |
Read bytes from PIPE.
Definition at line 132 of file pipe_arch.c.
References p, pipe_char_available(), pipe_mutex, and PIPE_RX_BUFFER_SIZE.
void pipe_send_message | ( | struct pipe_periph * | p, |
long | fd | ||
) |
void pipe_send_raw | ( | struct pipe_periph * | p, |
long | fd, | ||
uint8_t * | buffer, | ||
uint16_t | size | ||
) |
|
static |
check for new pipe packets to receive.
Definition at line 193 of file pipe_arch.c.
References fd, get_rt_prio(), pipe_receive(), and PIPE_THREAD_PRIO.
Referenced by pipe_arch_init().
|
static |
Definition at line 46 of file pipe_arch.c.
Referenced by pipe_arch_init(), pipe_char_available(), pipe_getch(), and pipe_receive().