libdrmconf  0.10.4
A library to program DMR radios.
openrtx_interface.hh
1 #ifndef OPENRTXINTERFACE_HH
2 #define OPENRTXINTERFACE_HH
3 
4 #include "radiointerface.hh"
5 #include "dfu_libusb.hh"
6 
11 {
12  Q_OBJECT
13 
14 public:
15  explicit OpenRTXInterface(const USBDeviceDescriptor &descr, const ErrorStack &err=ErrorStack(), QObject *parent = nullptr);
16 
17  bool isOpen() const;
18  void close();
19 
21 
22  bool read_start(uint32_t bank, uint32_t addr, const ErrorStack &err=ErrorStack());
23  bool read(uint32_t bank, uint32_t addr, uint8_t *data, int nbytes, const ErrorStack &err=ErrorStack());
24  bool read_finish(const ErrorStack &err=ErrorStack());
25 
26  bool write_start(uint32_t bank, uint32_t addr, const ErrorStack &err=ErrorStack());
27  bool write(uint32_t bank, uint32_t addr, uint8_t *data, int nbytes, const ErrorStack &err=ErrorStack());
28  bool write_finish(const ErrorStack &err=ErrorStack());
29 
30  bool reboot(const ErrorStack &err=ErrorStack());
31 
32 
33 };
34 
35 #endif // OPENRTXINTERFACE_HH
This class implements DFU protocol to access radios.
Definition: dfu_libusb.hh:17
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Implements the communication interface to radios running the OpenRTX firmware.
Definition: openrtx_interface.hh:11
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.
Definition: openrtx_interface.cc:29
bool reboot(const ErrorStack &err=ErrorStack())
Some radios need to be rebooted after being read or programmed.
Definition: openrtx_interface.cc:60
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.
Definition: openrtx_interface.cc:45
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.
Definition: openrtx_interface.cc:50
RadioInfo identifier(const ErrorStack &err=ErrorStack())
Returns a device identifier.
Definition: openrtx_interface.cc:22
bool read_finish(const ErrorStack &err=ErrorStack())
This function ends a series of read operations.
Definition: openrtx_interface.cc:39
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).
Definition: openrtx_interface.cc:34
bool write_finish(const ErrorStack &err=ErrorStack())
This function ends a series of write operations.
Definition: openrtx_interface.cc:55
bool isOpen() const
Return true if a connection to the device has been established.
Definition: openrtx_interface.cc:11
void close()
Closes the connection to the device.
Definition: openrtx_interface.cc:16
Provides some information about a radio model.
Definition: radioinfo.hh:16
Abstract radio interface.
Definition: radiointerface.hh:21
Base class for all radio interface descriptors representing a unique interface to a connected radio.
Definition: usbdevice.hh:197