HAL_Linux: support direct UDP output from UART drivers

this allows safe operation over WiFi links without MAVProxy
This commit is contained in:
Andrew Tridgell
2014-10-06 15:13:03 +11:00
parent 4e27dbdc42
commit e0e534628b
2 changed files with 173 additions and 96 deletions
File diff suppressed because it is too large Load Diff
+11 -1
View File
@@ -41,6 +41,7 @@ private:
char *_ip;
char *_flag;
bool _connected; // true if a client has connected
bool _packetise; // true if writes should try to be on mavlink boundaries
// we use in-task ring buffers to reduce the system call cost
// of ::read() and ::write() in the main loop
@@ -60,7 +61,16 @@ private:
int _write_fd(const uint8_t *buf, uint16_t n);
int _read_fd(uint8_t *buf, uint16_t n);
void _tcp_start_connection(bool wait_for_connection);
int _parseDevicePath(char* arg);
void _udp_start_connection(void);
enum device_type {
DEVICE_TCP,
DEVICE_UDP,
DEVICE_SERIAL,
DEVICE_UNKNOWN
};
enum device_type _parseDevicePath(const char *arg);
uint64_t _last_write_time;
};