Changed FIFO pipes to UDP.

This commit is contained in:
Nffj84
2024-07-04 15:20:48 +03:00
parent 5af90ac918
commit 89c68aeb67
10 changed files with 99 additions and 346 deletions
+3 -18
View File
@@ -2,26 +2,11 @@
#include <cstdint>
#define FIFO_WHO_AM_I "AI"
#define FIFO_TO_GIMBAL "/tmp/fifo_to_a8_gimbal"
#define FIFO_FROM_GIMBAL "/tmp/fifo_from_a8_gimbal"
//#define FIFO_TEST
#define UDP_WHO_AM_I "AI"
#define UDP_PORT 26662
class RemoteControl
{
public:
RemoteControl();
~RemoteControl();
void sendData(uint16_t top, uint16_t left, uint16_t bottom, uint16_t right);
#ifdef FIFO_TEST
void startTest(void);
#endif
private:
void createNamedPipe(void);
#ifdef FIFO_TEST
float randomFloatBetween(float min, float max);
int mFifoFdIn;
#endif
int mFifoFdOut;
static uint8_t sendData(uint16_t top, uint16_t left, uint16_t bottom, uint16_t right);
};