mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
876 B
C
38 lines
876 B
C
8 years ago
|
|
||
|
#ifndef RINGBUFFER_H
|
||
|
#define RINGBUFFER_H
|
||
|
|
||
|
#include "srslte/config.h"
|
||
|
#include <pthread.h>
|
||
|
#include <stdint.h>
|
||
|
|
||
|
typedef struct {
|
||
|
uint8_t *buffer;
|
||
|
int capacity;
|
||
|
int count;
|
||
|
int wpm;
|
||
|
int rpm;
|
||
|
pthread_mutex_t mutex;
|
||
|
pthread_cond_t cvar;
|
||
|
} srslte_ringbuffer_t;
|
||
|
|
||
|
|
||
|
SRSLTE_API int srslte_ringbuffer_init(srslte_ringbuffer_t *q,
|
||
|
int capacity);
|
||
|
|
||
|
SRSLTE_API void srslte_ringbuffer_free(srslte_ringbuffer_t *q,
|
||
|
int capacity);
|
||
|
|
||
|
SRSLTE_API int srslte_ringbuffer_write(srslte_ringbuffer_t *q,
|
||
|
uint8_t *ptr,
|
||
|
int nof_bytes);
|
||
|
|
||
|
SRSLTE_API int srslte_ringbuffer_read(srslte_ringbuffer_t *q,
|
||
|
uint8_t *ptr,
|
||
|
int nof_bytes);
|
||
|
|
||
|
|
||
|
#endif
|
||
|
|
||
|
|