Implements the communication interface to radios running the OpenRTX firmware.
More...
#include <openrtx_interface.hh>
|
| | OpenRTXInterface (const USBDeviceDescriptor &descr, const ErrorStack &err=ErrorStack(), QObject *parent=nullptr) |
| | Constructor.
|
| bool | isOpen () const |
| | Return true if a connection to the device has been established.
|
| void | close () |
| | Closes the connection to the device.
|
| RadioInfo | identifier (const ErrorStack &err=ErrorStack()) |
| | Returns a device identifier.
|
| bool | read_start (uint32_t bank, uint32_t addr, const ErrorStack &err=ErrorStack()) |
| | Starts the read process from the specified bank and at the given address.
|
| bool | read (uint32_t bank, uint32_t addr, uint8_t *data, int nbytes, const ErrorStack &err=ErrorStack()) |
| | Reads a chunk of data from the block-address bno (block number).
|
| bool | read_finish (const ErrorStack &err=ErrorStack()) |
| | This function ends a series of read operations.
|
| bool | write_start (uint32_t bank, uint32_t addr, const ErrorStack &err=ErrorStack()) |
| | Starts the write process into the specified bank and at the given address.
|
| bool | write (uint32_t bank, uint32_t addr, uint8_t *data, int nbytes, const ErrorStack &err=ErrorStack()) |
| | Writes a chunk of data at the address addr.
|
| bool | write_finish (const ErrorStack &err=ErrorStack()) |
| | This function ends a series of write operations.
|
| bool | reboot (const ErrorStack &err=ErrorStack()) |
| | Some radios need to be rebooted after being read or programmed.
|
|
virtual | ~RadioInterface () |
| | Destructor.
|
| virtual bool | setDateTime (const QDateTime &datetime, const ErrorStack &err=ErrorStack()) |
| | Some radios allow to set date and time of the internal clock during codeplug upload.
|
|
|
static USBDeviceInfo | interfaceInfo () |
| | Returns some information about this interface.
|
|
static QList< USBDeviceDescriptor > | detect (bool saveOnly=true) |
| | Tries to find all interfaces connected AnyTone radios.
|
|
|
| RadioInterface () |
| | Hidden constructor.
|
Implements the communication interface to radios running the OpenRTX firmware.
The protocol is called rtxlink and is documented at https://openrtx.org/#/rtxlink. The protocol has several layers. The lowest is a serial interface either as a VCOM (UBS CDC-ACM) or a proper hardware UART. Ontop of that, there is SLIP. Followed by a simple framing layer, that determines the higher-level protocol.
◆ OpenRTXInterface()
Constructor.
- Parameters
-
| descr | The USB device descriptor. Used to identify a specific USB device. |
| err | The stack of error messages. |
| parent | The QObject parent. |
◆ close()
| void OpenRTXInterface::close |
( |
| ) |
|
|
virtual |
◆ identifier()
◆ isOpen()
| bool OpenRTXInterface::isOpen |
( |
| ) |
const |
|
virtual |
Return true if a connection to the device has been established.
Implements RadioInterface.
◆ read()
| bool OpenRTXInterface::read |
( |
uint32_t | bank, |
|
|
uint32_t | addr, |
|
|
uint8_t * | data, |
|
|
int | nbytes, |
|
|
const ErrorStack & | err = ErrorStack() ) |
|
virtual |
Reads a chunk of data from the block-address bno (block number).
- Parameters
-
| bank | Specifies the memory bank to read from. Usually there is only one bank. Some radios, however, to have several memory banks to hold the codeplug. For example the Open GD77 has EEPROM and Flash memory banks with independent addresses. |
| addr | Specifies the address to read from. |
| data | Pointer where to store the read data. |
| nbytes | Specifies the number of bytes to read. |
| err | Passes an error stack to put error messages on. |
- Returns
true on success.
Implements RadioInterface.
◆ read_finish()
This function ends a series of read operations.
This function will be re-implemented by certain interfaces that need completion of read operations (e.g., HID).
- Parameters
-
| err | Passes an error stack to put error messages on. |
Implements RadioInterface.
◆ read_start()
| bool OpenRTXInterface::read_start |
( |
uint32_t | bank, |
|
|
uint32_t | addr, |
|
|
const ErrorStack & | err = ErrorStack() ) |
|
virtual |
Starts the read process from the specified bank and at the given address.
- Parameters
-
| bank | Specifies the memory bank to read from. Usually there is only one bank. Some radios, however, to have several memory banks to hold the codeplug. For example the Open GD77 has EEPROM and Flash memory banks with independent addresses. |
| addr | Specifies the address to read from. |
| err | Passes an error stack to put error messages on. |
Implements RadioInterface.
◆ reboot()
Some radios need to be rebooted after being read or programmed.
This function will be re-implemented by some interfaces (e.g., DFUDevice) to reboot the radio. By default this function does nothing.
- Parameters
-
| err | Passes an error stack to put error messages on. |
Reimplemented from RadioInterface.
◆ write()
| bool OpenRTXInterface::write |
( |
uint32_t | bank, |
|
|
uint32_t | addr, |
|
|
uint8_t * | data, |
|
|
int | nbytes, |
|
|
const ErrorStack & | err = ErrorStack() ) |
|
virtual |
Writes a chunk of data at the address addr.
- Parameters
-
| bank | Specifies the memory bank to write to. Usually there is only one bank. Some radios, however, to have several memory banks to hold the codeplug. For example the Open GD77 has EEPROM and Flash memory banks with independent addresses. |
| addr | Specifies the address to write to. |
| data | Pointer to the actual data to be written. |
| nbytes | Specifies the number of bytes to write. |
| err | Passes an error stack to put error messages on. |
- Returns
true on success.
Implements RadioInterface.
◆ write_finish()
This function ends a series of write operations.
This function will be implemented by certain interfaces that need completion of write operations (e.g., HID).
- Parameters
-
| err | Passes an error stack to put error messages on. |
Implements RadioInterface.
◆ write_start()
| bool OpenRTXInterface::write_start |
( |
uint32_t | bank, |
|
|
uint32_t | addr, |
|
|
const ErrorStack & | err = ErrorStack() ) |
|
virtual |
Starts the write process into the specified bank and at the given address.
- Parameters
-
| bank | Specifies the memory bank to write to. Usually there is only one bank. Some radios, however, to have several memory banks to hold the codeplug. For example the Open GD77 has EEPROM and Flash memory banks with independent addresses. |
| addr | Specifies the address to write to. |
| err | Passes an error stack to put error messages on. |
Implements RadioInterface.
◆ _rtxLink
OpenRTX link interface.
This is the protocol dispatcher for all implemented data transfer protocols.
The documentation for this class was generated from the following files:
- /builddir/build/BUILD/qdmr-0.15.0-build/qdmr-0.15.0/lib/openrtx_interface.hh
- /builddir/build/BUILD/qdmr-0.15.0-build/qdmr-0.15.0/lib/openrtx_interface.cc