Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
linux named pipe handling More...
#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 |
linux named pipe handling
Definition in file pipe_arch.c.
#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.
Referenced by pipe_periph_init().
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.
Referenced by pipe_periph_init(), and pipe_receive().
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.
Referenced by pipe_periph_init().
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.
Referenced by pipe_thread().
void pipe_send_message | ( | struct pipe_periph * | p, |
long | fd | ||
) |
Send a message.
Definition at line 160 of file pipe_arch.c.
References p.
Referenced by pipe_periph_init().
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().