libdrmconf
0.12.0
A library to program DMR radios.
|
Implements the actual interface to the DR-1801UV, which builds upon the AuctusA6Interface
.
More...
#include <dr1801uv_interface.hh>
Classes | |
struct | CodeplugWriteResponse |
Response to a codeplug write. More... | |
struct | PrepareReadRequest |
Request to set transfer speed and load codeplug into RAM for transfer. More... | |
struct | PrepareReadResponse |
Response to a PREPARE_CODEPLUG_READ command. More... | |
struct | PrepareWriteRequest |
Request to prepare a codeplug write. More... | |
struct | PrepareWriteResponse |
Response to a prepare-write request. More... | |
Public Member Functions | |
DR1801UVInterface (const USBDeviceDescriptor &descriptor, const ErrorStack &err=ErrorStack(), QObject *parent=nullptr) | |
Constructs an interface to the BTECH DR-1801UV from the specifeid USB descriptor. | |
RadioInfo | identifier (const ErrorStack &err) |
Returns a device identifier. | |
bool | readCodeplug (Codeplug &codeplug, std::function< void(unsigned int, unsigned int)> progress, const ErrorStack &err=ErrorStack()) |
Reads the codeplug from the device blocking. | |
bool | writeCodeplug (const Codeplug &codeplug, std::function< void(unsigned int, unsigned int)> progress, const ErrorStack &err=ErrorStack()) |
Writes the codeplug to the device blocking. | |
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. More... | |
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). More... | |
bool | read_finish (const ErrorStack &err=ErrorStack()) |
This function ends a series of read operations. More... | |
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. More... | |
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 . More... | |
bool | write_finish (const ErrorStack &err=ErrorStack()) |
This function ends a series of write operations. More... | |
Public Member Functions inherited from AuctusA6Interface | |
State | state () const |
Returns the interface state. | |
Public Member Functions inherited from USBSerial | |
virtual | ~USBSerial () |
Destructor. | |
bool | isOpen () const |
If true , the device has been found and is open. | |
void | close () |
Closes the interface to the device. | |
Public Member Functions inherited from RadioInterface | |
virtual | ~RadioInterface () |
Destructor. | |
virtual bool | reboot (const ErrorStack &err=ErrorStack()) |
Some radios need to be rebooted after being read or programmed. More... | |
Static Public Member Functions | |
static USBDeviceInfo | interfaceInfo () |
Returns some information about this interface. | |
static QList< USBDeviceDescriptor > | detect (bool saveOnly=true) |
Tries to find all interfaces connected AnyTone radios. | |
Static Public Member Functions inherited from USBSerial | |
static QList< USBDeviceDescriptor > | detect (uint16_t vid, uint16_t pid, bool isSave=true) |
Searches for all USB serial ports with the specified VID/PID. | |
static QList< USBDeviceDescriptor > | detect () |
Searches for all USB serial ports. | |
Protected Types | |
enum | DefaultTransferSpeed { DefaultSpeed = QSerialPort::Baud9600 , ReadSpeed = QSerialPort::Baud115200 , WriteSpeed = QSerialPort::Baud9600 } |
Some default speeds. More... | |
enum | Command { REQUEST_INFO = 0x0000 , ENTER_PROGRAMMING_MODE = 0x0104 , CHECK_PROG_PASSWORD = 0x002b , PREPARE_CODEPLUG_READ = 0x0100 , START_READ_DATA = 0x0101 , PREPARE_CODEPLUG_WRITE = 0x0102 , CODEPLUG_WRITTEN = 0x0103 } |
Implemented commands. More... | |
Protected Member Functions | |
bool | enterProgrammingMode (const ErrorStack &err=ErrorStack()) |
Puts the device into programming mode. | |
bool | getDeviceInfo (QString &info, const ErrorStack &err=ErrorStack()) |
Reads some information about the device. | |
bool | checkProgrammingPassword (const ErrorStack &err=ErrorStack()) |
Checks the if a programming password is set. | |
bool | prepareReading (uint32_t baudrate, PrepareReadResponse &response, const ErrorStack &err=ErrorStack()) |
Prepares reading the codeplug. | |
bool | startReading (const ErrorStack &err=ErrorStack()) |
Starts the read operation. More... | |
bool | prepareWriting (uint32_t size, uint32_t baudrate, uint16_t crc, const ErrorStack &err=ErrorStack()) |
Repares the codeplug write. | |
bool | receiveWriteACK (const ErrorStack &err=ErrorStack()) |
Receives the ACK for writing the codeplug. | |
Protected Member Functions inherited from AuctusA6Interface | |
AuctusA6Interface (const USBDeviceDescriptor &descriptor, const ErrorStack &err=ErrorStack(), QObject *parent=nullptr) | |
Hidden constructor. | |
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. | |
bool | send (uint16_t command, const uint8_t *params, uint8_t plen, const ErrorStack &err=ErrorStack()) |
Internal used method to send a command. | |
bool | receive (uint16_t &command, uint8_t *response, uint8_t &rlen, const ErrorStack &err=ErrorStack()) |
Internal used method to receive a response. | |
bool | read (uint8_t *data, qint64 n, unsigned int timeout_ms, const ErrorStack &err=ErrorStack()) |
Reads exactly n bytes or timeouts. | |
Protected Member Functions inherited from USBSerial | |
USBSerial (const USBDeviceDescriptor &descriptor, QSerialPort::BaudRate rate=QSerialPort::Baud115200, const ErrorStack &err=ErrorStack(), QObject *parent=nullptr) | |
Constructs an opens new serial interface to the devices identified by the given vendor and product IDs. More... | |
QString | formatPinoutSignals () |
Serializes the pinout singals. | |
Protected Member Functions inherited from RadioInterface | |
RadioInterface () | |
Hidden constructor. | |
Protected Attributes | |
QString | _identifier |
Holds the device identifier, once read. | |
Protected Attributes inherited from AuctusA6Interface | |
State | _state |
Holds the state of the interface. | |
Additional Inherited Members | |
Public Types inherited from AuctusA6Interface | |
enum | State { CLOSED , IDLE , READ_THROUGH , WRITE_THROUGH , ERROR } |
Possible states of the interface. More... | |
Protected Slots inherited from USBSerial | |
void | onError (QSerialPort::SerialPortError error_t) |
Callback for serial interface errors. | |
void | onClose () |
Callback when closing interface. | |
void | signalingChanged () |
Signaling callback. | |
Implements the actual interface to the DR-1801UV, which builds upon the AuctusA6Interface
.
|
protected |
Implemented commands.
|
protected |
|
virtual |
Reads a chunk of data from the block-address bno
(block number).
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. |
true
on success. Implements RadioInterface.
|
virtual |
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).
err | Passes an error stack to put error messages on. |
Implements RadioInterface.
|
virtual |
Starts the read process from the specified bank and at the given address.
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.
|
protected |
Starts the read operation.
Once the operation is complete, the device will close the connection.
|
virtual |
Writes a chunk of data
at the address addr
.
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. |
true
on success. Implements RadioInterface.
|
virtual |
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).
err | Passes an error stack to put error messages on. |
Implements RadioInterface.
|
virtual |
Starts the write process into the specified bank and at the given address.
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.