libdrmconf
0.8.1
A library to program DMR radios.
|
1 #ifndef HIDINTERFACE_HH
2 #define HIDINTERFACE_HH
6 #include "radiointerface.hh"
9 #include "hid_macos.hh"
11 #include "hid_libusb.hh"
33 explicit HID(
int vid,
int pid, QObject *parent =
nullptr);
53 bool read(uint32_t bank, uint32_t addr,
unsigned char *data,
int nbytes);
65 bool write(uint32_t bank, uint32_t addr,
unsigned char *data,
int nbytes);
83 #endif // HIDINTERFACE_HH
bool selectMemoryBank(MemoryBank bank)
Internal used function to select a memory bank.
Definition: hid_interface.cc:222
void close()
Closes the connection to the device.
Definition: hid_interface.cc:39
Implements the HID radio interface using libusb.
Definition: hid_libusb.hh:9
@ MEMBANK_CODEPLUG_LOWER
Lower memory bank (EEPROM).
Definition: hid_interface.hh:25
HID(int vid, int pid, QObject *parent=nullptr)
Connects to the radio with given vendor and product ID.
Definition: hid_interface.cc:20
const QString & errorMessage() const
Retruns the last error message.
Definition: hid_interface.hh:70
bool read(uint32_t bank, uint32_t addr, unsigned char *data, int nbytes)
Reads a block of data from the device at the given block number.
Definition: hid_interface.cc:113
bool read_finish()
This function ends a series of read operations.
Definition: hid_interface.cc:139
bool write_start(uint32_t bank, uint32_t addr)
Starts the write process into the specified bank and at the given address.
Definition: hid_interface.cc:162
@ MEMBANK_CALLSIGN_UPPER
Callsign DB memory upper bank (also FLASH).
Definition: hid_interface.hh:28
@ MEMBANK_NONE
No bank selected.
Definition: hid_interface.hh:24
bool isOpen() const
Returns true if the connection was established.
Definition: hid_interface.cc:34
MemoryBank
Possible memory banks to select.
Definition: hid_interface.hh:23
QString identifier()
Returns radio identifier string.
Definition: hid_interface.cc:46
bool write_finish()
This function ends a series of write operations.
Definition: hid_interface.cc:201
Abstract radio interface.
Definition: radiointerface.hh:18
bool read_start(uint32_t bank, uint32_t addr)
Starts the read process from the specified bank and at the given address.
Definition: hid_interface.cc:103
Implements a radio interface for radios using the HID USB schema.
Definition: hid_interface.hh:17
@ MEMBANK_CODEPLUG_UPPER
Upper memory bank (FLASH).
Definition: hid_interface.hh:26
QString _errorMessage
Holds the error message.
Definition: hid_libusb.hh:52
bool write(uint32_t bank, uint32_t addr, unsigned char *data, int nbytes)
Writes a block of data to the device at the given block number.
Definition: hid_interface.cc:172
@ MEMBANK_CALLSIGN_LOWER
Callsign DB memory lower bank (also FLASH).
Definition: hid_interface.hh:27
virtual ~HID()
Destructor.
Definition: hid_interface.cc:27