libdrmconf 0.15.0
A library to program DMR radios.
Loading...
Searching...
No Matches
openrtx_interface.hh
1#ifndef OPENRTXINTERFACE_HH
2#define OPENRTXINTERFACE_HH
3
4#include "radiointerface.hh"
5#include "packetstream.hh"
6#include "usbserial.hh"
7#include "xmodem.hh"
8
16class OpenRTXInterface : public QObject, public RadioInterface
17{
18 Q_OBJECT
19
20public:
25 explicit OpenRTXInterface(const USBDeviceDescriptor &descr, const ErrorStack &err=ErrorStack(), QObject *parent = nullptr);
26
27 bool isOpen() const;
28 void close();
29
31
32 bool read_start(uint32_t bank, uint32_t addr, const ErrorStack &err=ErrorStack());
33 bool read(uint32_t bank, uint32_t addr, uint8_t *data, int nbytes, const ErrorStack &err=ErrorStack());
34 bool read_finish(const ErrorStack &err=ErrorStack());
35
36 bool write_start(uint32_t bank, uint32_t addr, const ErrorStack &err=ErrorStack());
37 bool write(uint32_t bank, uint32_t addr, uint8_t *data, int nbytes, const ErrorStack &err=ErrorStack());
38 bool write_finish(const ErrorStack &err=ErrorStack());
39
40 bool reboot(const ErrorStack &err=ErrorStack());
41
42public:
46 static QList<USBDeviceDescriptor> detect(bool saveOnly=true);
47
48protected:
52};
53
54#endif // OPENRTXINTERFACE_HH
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
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:57
bool reboot(const ErrorStack &err=ErrorStack())
Some radios need to be rebooted after being read or programmed.
Definition openrtx_interface.cc:88
static USBDeviceInfo interfaceInfo()
Returns some information about this interface.
Definition openrtx_interface.cc:95
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:73
OpenRTXLink * _rtxLink
OpenRTX link interface.
Definition openrtx_interface.hh:51
static QList< USBDeviceDescriptor > detect(bool saveOnly=true)
Tries to find all interfaces connected AnyTone radios.
Definition openrtx_interface.cc:100
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:78
RadioInfo identifier(const ErrorStack &err=ErrorStack())
Returns a device identifier.
Definition openrtx_interface.cc:46
bool read_finish(const ErrorStack &err=ErrorStack())
This function ends a series of read operations.
Definition openrtx_interface.cc:67
OpenRTXInterface(const USBDeviceDescriptor &descr, const ErrorStack &err=ErrorStack(), QObject *parent=nullptr)
Constructor.
Definition openrtx_interface.cc:11
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:62
bool write_finish(const ErrorStack &err=ErrorStack())
This function ends a series of write operations.
Definition openrtx_interface.cc:83
bool isOpen() const
Return true if a connection to the device has been established.
Definition openrtx_interface.cc:35
void close()
Closes the connection to the device.
Definition openrtx_interface.cc:40
Provides some information about a radio model.
Definition radioinfo.hh:16
RadioInterface()
Hidden constructor.
Definition radiointerface.cc:11
Base class for all radio interface descriptors representing a unique interface to a connected radio.
Definition usbdevice.hh:197
Generic information about a possible radio interface.
Definition usbdevice.hh:121