#ifndef RINGBUFFER_H #define RINGBUFFER_H #include #include #include #ifdef __cplusplus extern "C" { #endif #define DATA_LENGTH 48 #define BUFFER_LENGTH 16 struct BufferRecord { size_t length; uint8_t data[DATA_LENGTH]; }; struct RingBuffer { size_t marks; size_t delay; size_t index; struct BufferRecord records[BUFFER_LENGTH]; }; void PokeData(struct RingBuffer* buffer, uint32_t number, uint8_t* data, size_t length); void ProcessBuffer(struct RingBuffer* buffer, int handle, struct sockaddr_in* address); #ifdef __cplusplus } #endif #endif