6 #ifndef AUCTUS_A6_INTERFACE_HH
7 #define AUCTUS_A6_INTERFACE_HH
10 #include "usbserial.hh"
44 bool send_receive(uint16_t command,
const uint8_t *params, uint8_t plen,
Implements the communication interface to radios using the Auctus A6 chip.
Definition: auctus_a6_interface.hh:20
bool send_receive(uint16_t command, const uint8_t *params, uint8_t plen, uint8_t *response, uint8_t &rlen, const ErrorStack &err=ErrorStack())
Internal used method to send messages to and receive responses from radio.
Definition: auctus_a6_interface.cc:33
bool receive(uint16_t &command, uint8_t *response, uint8_t &rlen, const ErrorStack &err=ErrorStack())
Internal used method to receive a response.
Definition: auctus_a6_interface.cc:106
bool send(uint16_t command, const uint8_t *params, uint8_t plen, const ErrorStack &err=ErrorStack())
Internal used method to send a command.
Definition: auctus_a6_interface.cc:60
State _state
Holds the state of the interface.
Definition: auctus_a6_interface.hh:56
State
Possible states of the interface.
Definition: auctus_a6_interface.hh:25
@ ERROR
An error state.
Definition: auctus_a6_interface.hh:30
@ CLOSED
Conntection to device is closed.
Definition: auctus_a6_interface.hh:26
@ IDLE
Connection is open and device is ready.
Definition: auctus_a6_interface.hh:27
@ READ_THROUGH
Read from memory. The device just sends some amount of data.
Definition: auctus_a6_interface.hh:28
@ WRITE_THROUGH
Write to memory. The device just receives some amount of data.
Definition: auctus_a6_interface.hh:29
bool read(uint8_t *data, qint64 n, unsigned int timeout_ms, const ErrorStack &err=ErrorStack())
Reads exactly n bytes or timeouts.
Definition: auctus_a6_interface.cc:168
AuctusA6Interface(const USBDeviceDescriptor &descriptor, const ErrorStack &err=ErrorStack(), QObject *parent=nullptr)
Hidden constructor.
Definition: auctus_a6_interface.cc:9
State state() const
Returns the interface state.
Definition: auctus_a6_interface.cc:27
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Base class for all radio interface descriptors representing a unique interface to a connected radio.
Definition: usbdevice.hh:197
Implements a serial connection to a radio via USB.
Definition: usbserial.hh:16