|
libdrmconf 0.13.2
A library to program DMR radios.
|
Abstract radio interface. More...
#include <radiointerface.hh>

Public Member Functions | |
| virtual | ~RadioInterface () |
| Destructor. | |
| virtual bool | isOpen () const =0 |
Return true if a connection to the device has been established. | |
| virtual void | close ()=0 |
| Closes the connection to the device. | |
| virtual RadioInfo | identifier (const ErrorStack &err=ErrorStack())=0 |
| Returns a device identifier. | |
| virtual bool | write_start (uint32_t bank, uint32_t addr, const ErrorStack &err=ErrorStack())=0 |
| Starts the write process into the specified bank and at the given address. | |
| virtual bool | write (uint32_t bank, uint32_t addr, uint8_t *data, int nbytes, const ErrorStack &err=ErrorStack())=0 |
Writes a chunk of data at the address addr. | |
| virtual bool | write_finish (const ErrorStack &err=ErrorStack())=0 |
This function ends a series of write operations. | |
| virtual bool | read_start (uint32_t bank, uint32_t addr, const ErrorStack &err=ErrorStack())=0 |
| Starts the read process from the specified bank and at the given address. | |
| virtual bool | read (uint32_t bank, uint32_t addr, uint8_t *data, int nbytes, const ErrorStack &err=ErrorStack())=0 |
Reads a chunk of data from the block-address bno (block number). | |
| virtual bool | read_finish (const ErrorStack &err=ErrorStack())=0 |
This function ends a series of read operations. | |
| virtual bool | reboot (const ErrorStack &err=ErrorStack()) |
| Some radios need to be rebooted after being read or programmed. | |
| 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. | |
Protected Member Functions | |
| RadioInterface () | |
| Hidden constructor. | |
Abstract radio interface.
A radion interface must provide means to communicate with the device. That is, open a connection to the device, allow for reading and writing specific memory blocks.
This class defines the common interface for all radio-interface classes, irrespective of the actual communication protocol being used by the device.
|
pure virtual |
Closes the connection to the device.
Implemented in AnytoneInterface, GD73Interface, OpenGD77Interface, OpenRTXInterface, RadioddityInterface, TyTInterface, and USBSerial.
|
pure virtual |
Returns a device identifier.
Implemented in DR1801UVInterface, AnytoneGD32Interface, AnytoneSTM32Interface, GD73Interface, OpenGD77Interface, OpenRTXInterface, RadioddityInterface, and TyTInterface.
|
pure virtual |
Return true if a connection to the device has been established.
Implemented in GD73Interface, OpenRTXInterface, RadioddityInterface, TyTInterface, and USBSerial.
|
pure 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. Implemented in AnytoneInterface, DR1801UVInterface, GD73Interface, OpenGD77Interface, OpenRTXInterface, and TyTInterface.
|
pure 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. |
Implemented in AnytoneInterface, DR1801UVInterface, GD73Interface, OpenGD77Interface, OpenRTXInterface, RadioddityInterface, and TyTInterface.
|
pure 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. |
Implemented in AnytoneInterface, DR1801UVInterface, GD73Interface, OpenGD77Interface, OpenRTXInterface, RadioddityInterface, and TyTInterface.
|
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 in AnytoneInterface, OpenGD77Interface, OpenRTXInterface, and TyTInterface.
|
virtual |
Some radios allow to set date and time of the internal clock during codeplug upload.
This function might be re-implemented by interfaces for those radios (e.g., the OpenGD77 one).
| datetime | [in] Specifies the timestamp to set. |
| err | Passes an error stack to put error messages on. |
Reimplemented in OpenGD77Interface.
|
pure 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. Implemented in AnytoneInterface, DR1801UVInterface, GD73Interface, OpenGD77Interface, OpenRTXInterface, and TyTInterface.
|
pure 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. |
Implemented in AnytoneInterface, DR1801UVInterface, GD73Interface, OpenGD77Interface, OpenRTXInterface, RadioddityInterface, and TyTInterface.
|
pure 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. |
Implemented in AnytoneInterface, DR1801UVInterface, GD73Interface, OpenGD77Interface, OpenRTXInterface, RadioddityInterface, and TyTInterface.