mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 09:58:28 -04:00
AP_HAL_Linux: added SerialDevice interface
Adds the interface that will be used for encapsulating various mediums that can be used in the Linux port.
This commit is contained in:
parent
9b25217757
commit
7160c88d39
19
libraries/AP_HAL_Linux/SerialDevice.h
Normal file
19
libraries/AP_HAL_Linux/SerialDevice.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef __AP_HAL_LINUX_SERIALDEVICE_H__
|
||||
#define __AP_HAL_LINUX_SERIALDEVICE_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
class SerialDevice {
|
||||
public:
|
||||
virtual ~SerialDevice() {}
|
||||
|
||||
virtual bool open() = 0;
|
||||
virtual bool close() = 0;
|
||||
virtual ssize_t write(const uint8_t *buf, uint16_t n) = 0;
|
||||
virtual ssize_t read(uint8_t *buf, uint16_t n) = 0;
|
||||
virtual void set_blocking(bool blocking) = 0;
|
||||
virtual void set_speed(uint32_t speed) = 0;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user