Interface to Baofeng Dm-32UV devices.
More...
#include <dm32uv_interface.hh>
|
| | DM32UVInterface (const USBDeviceDescriptor &descr, const ErrorStack &err=ErrorStack(), QObject *parent=nullptr) |
| | Constructs a new DM32UV interface for the given USB descriptor.
|
| RadioInfo | identifier (const ErrorStack &err=ErrorStack()) override |
| | Returns the radio info, after identifying the radio.
|
|
bool | getAddressMap (DM32UV::AddressMap &map, const ErrorStack &err=ErrorStack(), void(*progress)(unsigned int percent)=nullptr) |
| | Reads the obfuscation address map from the device.
|
| bool | read_start (uint32_t bank, uint32_t address, const ErrorStack &err=ErrorStack()) override |
| | Starts the read process from the specified bank and at the given address.
|
| bool | read (uint32_t bank, uint32_t address, uint8_t *data, int nbytes, const ErrorStack &err=ErrorStack()) override |
| | Reads a chunk of data from the block-address bno (block number).
|
| bool | read_finish (const ErrorStack &err=ErrorStack()) override |
| | This function ends a series of read operations.
|
| bool | write_start (uint32_t bank, uint32_t address, const ErrorStack &err=ErrorStack()) override |
| | Starts the write process into the specified bank and at the given address.
|
| bool | write (uint32_t bank, uint32_t address, uint8_t *data, int nbytes, const ErrorStack &err=ErrorStack()) override |
| | Writes a chunk of data at the address addr.
|
| bool | write_finish (const ErrorStack &err=ErrorStack()) override |
| | This function ends a series of write operations.
|
|
virtual | ~USBSerial () |
| | Destructor.
|
| bool | isOpen () const override |
| | If true, the device has been found and is open.
|
| void | close () override |
| | Closes the interface to the device.
|
|
virtual | ~RadioInterface () |
| | Destructor.
|
| 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.
|
|
|
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 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.
|
|
| enum class | State {
Closed
, Open
, Connected
, SystemInfo
,
Program
, Error
} |
| | Possible states, the interface might be in.
|
|
|
bool | request_identifier (const ErrorStack &err=ErrorStack()) |
|
bool | enter_program_mode (const ErrorStack &err=ErrorStack()) |
| | Enters program mode.
|
|
template<class Request, class Response> |
| bool | sendReceive (const Request &req, Response &res, const ErrorStack &err=ErrorStack()) |
| | Helper function to send a request and receives the associated response.
|
|
bool | send (const char *data, qint64 n, int timeout, const ErrorStack &err=ErrorStack()) |
| | Send some data.
|
|
bool | receive (char *data, qint64 n, int timeout, const ErrorStack &err=ErrorStack()) |
| | Receives some data.
|
| | 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.
|
|
QString | formatPinoutSignals () |
| | Serializes the pinout signals.
|
|
| RadioInterface () |
| | Hidden constructor.
|
|
|
State | _state |
| | Current state, the interface is in.
|
|
RadioInfo | _info |
| | Radio info, identifying the radio.
|
|
QString | _firmwareVersion |
| | Firmware version string.
|
|
QPair< uint32_t, uint32_t > | _codeplugMemory |
| | Codeplug memory range.
|
|
QPair< uint32_t, uint32_t > | _callsignMemory |
| | Callsign memory range.
|
|
|
void | onError (QSerialPort::SerialPortError error_t) |
| | Callback for serial interface errors.
|
|
void | onClose () |
| | Callback when closing interface.
|
|
void | signalingChanged () |
| | Signaling callback.
|
◆ DM32UVInterface()
Constructs a new DM32UV interface for the given USB descriptor.
The constructor also enters the SYSINFO state and identifies the radio.
◆ identifier()
Returns the radio info, after identifying the radio.
Implements RadioInterface.
◆ read()
| bool DM32UVInterface::read |
( |
uint32_t | bank, |
|
|
uint32_t | addr, |
|
|
uint8_t * | data, |
|
|
int | nbytes, |
|
|
const ErrorStack & | err = ErrorStack() ) |
|
overridevirtual |
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 DM32UVInterface::read_start |
( |
uint32_t | bank, |
|
|
uint32_t | addr, |
|
|
const ErrorStack & | err = ErrorStack() ) |
|
overridevirtual |
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.
◆ write()
| bool DM32UVInterface::write |
( |
uint32_t | bank, |
|
|
uint32_t | addr, |
|
|
uint8_t * | data, |
|
|
int | nbytes, |
|
|
const ErrorStack & | err = ErrorStack() ) |
|
overridevirtual |
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 DM32UVInterface::write_start |
( |
uint32_t | bank, |
|
|
uint32_t | addr, |
|
|
const ErrorStack & | err = ErrorStack() ) |
|
overridevirtual |
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.
The documentation for this class was generated from the following files:
- /builddir/build/BUILD/qdmr-0.14.1-build/qdmr-0.14.1/lib/dm32uv_interface.hh
- /builddir/build/BUILD/qdmr-0.14.1-build/qdmr-0.14.1/lib/dm32uv_interface.cc