libdrmconf
0.12.0
A library to program DMR radios.
|
Implements the interfact to a radio running the Open GD77 firmware. More...
#include <opengd77_interface.hh>
Classes | |
struct | CommandRequest |
Represents a command message. More... | |
struct | ReadRequest |
Represents a read message. More... | |
struct | ReadResponse |
Represents a read response message. More... | |
struct | WriteRequest |
Represents a write message. More... | |
struct | WriteResponse |
Represents a write-response message. More... | |
Public Member Functions | |
OpenGD77Interface (const USBDeviceDescriptor &descr, const ErrorStack &err=ErrorStack(), QObject *parent=nullptr) | |
Constructs a new interface to a specific OpenGD77 device. More... | |
virtual | ~OpenGD77Interface () |
Destructor. | |
void | close () |
Closes the interface to the device. | |
RadioInfo | identifier (const ErrorStack &err=ErrorStack()) |
Returns an identifier of the radio. | |
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... | |
bool | reboot (const ErrorStack &err=ErrorStack()) |
Some radios need to be rebooted after being read or programmed. More... | |
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. | |
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. | |
Static Public Attributes | |
static const uint32_t | EEPROM = 0 |
The EEPROM memory bank. | |
static const uint32_t | FLASH = 1 |
The Flash memory bank. | |
Protected Member Functions | |
bool | readEEPROM (uint32_t addr, uint8_t *data, uint16_t len, const ErrorStack &err=ErrorStack()) |
Write some data to EEPROM at the given address. | |
bool | writeEEPROM (uint32_t addr, const uint8_t *data, uint16_t len, const ErrorStack &err=ErrorStack()) |
Read some data from EEPROM at the given address. | |
bool | readFlash (uint32_t addr, uint8_t *data, uint16_t len, const ErrorStack &err=ErrorStack()) |
Read some data from Flash at the given address. | |
bool | setFlashSector (uint32_t addr, const ErrorStack &err=ErrorStack()) |
Select the correct Flash sector for the given address. More... | |
bool | writeFlash (uint32_t addr, const uint8_t *data, uint16_t len, const ErrorStack &err=ErrorStack()) |
Write some data to the given Flash memory. | |
bool | finishWriteFlash (const ErrorStack &err=ErrorStack()) |
Finalize writing to the Flash memory. More... | |
bool | sendShowCPSScreen (const ErrorStack &err=ErrorStack()) |
Send a "show CPS screen" message. | |
bool | sendClearScreen (const ErrorStack &err=ErrorStack()) |
Send a "clear screen" message. | |
bool | sendDisplay (uint8_t 1, uint8_t y, const char *message, uint8_t iSize, uint8_t alignment, uint8_t inverted, const ErrorStack &err=ErrorStack()) |
Send a "display some text" message. | |
bool | sendRenderCPS (const ErrorStack &err=ErrorStack()) |
Send a "render CPS screen" message. | |
bool | sendCloseScreen (const ErrorStack &err=ErrorStack()) |
Send a "close screen" message. | |
bool | sendCommand (CommandRequest::Option option, const ErrorStack &err=ErrorStack()) |
Sends some command message with the given options. | |
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 | |
int32_t | _sector |
The current Flash sector, set to -1 if none is currently selected. | |
Additional Inherited Members | |
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 interfact to a radio running the Open GD77 firmware.
This interface uses a USB serial-port to communicate with the device. To find the corresponding port, the device-specific VID 0x1fc9
and PID 0x0094
are used. Hence no udev rules are needed to access these devices. The user, however, should be a member of the dialout
group to get access to the serial interfaces.
|
explicit |
Constructs a new interface to a specific OpenGD77 device.
|
protected |
Finalize writing to the Flash memory.
If not send after writing to a sector, the changes are lost.
|
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.
|
virtual |
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.
err | Passes an error stack to put error messages on. |
Reimplemented from RadioInterface.
|
protected |
Select the correct Flash sector for the given address.
This command must be sent before writing to the flash memory.
|
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.