1 #ifndef DR1801UVINTERFACE_HH
2 #define DR1801UVINTERFACE_HH
4 #include "auctus_a6_interface.hh"
30 bool writeCodeplug(
const Codeplug &codeplug, std::function<
void(
unsigned int,
unsigned int)> progress,
45 static QList<USBDeviceDescriptor>
detect(
bool saveOnly=
true);
77 void setBaudrate(uint32_t baudrate);
88 bool isSuccessful()
const;
90 uint32_t getSize()
const;
104 void updateCRC(
const uint8_t *data,
size_t length);
112 bool isSuccessful()
const;
121 bool isSuccessful()
const;
Implements the communication interface to radios using the Auctus A6 chip.
Definition: auctus_a6_interface.hh:20
This class defines the interface all device-specific code-plugs must implement.
Definition: codeplug.hh:19
Implements the actual interface to the DR-1801UV, which builds upon the AuctusA6Interface.
Definition: dr1801uv_interface.hh:15
bool checkProgrammingPassword(const ErrorStack &err=ErrorStack())
Checks the if a programming password is set.
Definition: dr1801uv_interface.cc:368
bool prepareReading(uint32_t baudrate, PrepareReadResponse &response, const ErrorStack &err=ErrorStack())
Prepares reading the codeplug.
Definition: dr1801uv_interface.cc:390
DR1801UVInterface(const USBDeviceDescriptor &descriptor, const ErrorStack &err=ErrorStack(), QObject *parent=nullptr)
Constructs an interface to the BTECH DR-1801UV from the specifeid USB descriptor.
Definition: dr1801uv_interface.cc:80
RadioInfo identifier(const ErrorStack &err)
Returns a device identifier.
Definition: dr1801uv_interface.cc:107
bool getDeviceInfo(QString &info, const ErrorStack &err=ErrorStack())
Reads some information about the device.
Definition: dr1801uv_interface.cc:311
bool write_finish(const ErrorStack &err=ErrorStack())
This function ends a series of write operations.
Definition: dr1801uv_interface.cc:291
static USBDeviceInfo interfaceInfo()
Returns some information about this interface.
Definition: dr1801uv_interface.cc:297
bool read_finish(const ErrorStack &err=ErrorStack())
This function ends a series of read operations.
Definition: dr1801uv_interface.cc:272
bool prepareWriting(uint32_t size, uint32_t baudrate, uint16_t crc, const ErrorStack &err=ErrorStack())
Repares the codeplug write.
Definition: dr1801uv_interface.cc:415
QString _identifier
Holds the device identifier, once read.
Definition: dr1801uv_interface.hh:144
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: dr1801uv_interface.cc:266
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: dr1801uv_interface.cc:260
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: dr1801uv_interface.cc:279
bool readCodeplug(Codeplug &codeplug, std::function< void(unsigned int, unsigned int)> progress, const ErrorStack &err=ErrorStack())
Reads the codeplug from the device blocking.
Definition: dr1801uv_interface.cc:119
bool enterProgrammingMode(const ErrorStack &err=ErrorStack())
Puts the device into programming mode.
Definition: dr1801uv_interface.cc:348
Command
Implemented commands.
Definition: dr1801uv_interface.hh:59
@ PREPARE_CODEPLUG_WRITE
Prepares writing the codeplug.
Definition: dr1801uv_interface.hh:65
@ ENTER_PROGRAMMING_MODE
Puts the device into the programming mode.
Definition: dr1801uv_interface.hh:61
@ CHECK_PROG_PASSWORD
Checks the programming password.
Definition: dr1801uv_interface.hh:62
@ START_READ_DATA
Actually starts reading the codeplug.
Definition: dr1801uv_interface.hh:64
@ PREPARE_CODEPLUG_READ
Sets baud rate and prepares codeplug read.
Definition: dr1801uv_interface.hh:63
@ CODEPLUG_WRITTEN
Send by the device once the codeplug was written.
Definition: dr1801uv_interface.hh:66
@ REQUEST_INFO
Returns some information about the device.
Definition: dr1801uv_interface.hh:60
bool receiveWriteACK(const ErrorStack &err=ErrorStack())
Receives the ACK for writing the codeplug.
Definition: dr1801uv_interface.cc:442
bool writeCodeplug(const Codeplug &codeplug, std::function< void(unsigned int, unsigned int)> progress, const ErrorStack &err=ErrorStack())
Writes the codeplug to the device blocking.
Definition: dr1801uv_interface.cc:186
bool startReading(const ErrorStack &err=ErrorStack())
Starts the read operation.
Definition: dr1801uv_interface.cc:470
DefaultTransferSpeed
Some default speeds.
Definition: dr1801uv_interface.hh:49
@ DefaultSpeed
Initial speed, used to send commands.
Definition: dr1801uv_interface.hh:51
@ WriteSpeed
Speed for writing the codeplug.
Definition: dr1801uv_interface.hh:55
@ ReadSpeed
Speed for reading the codeplug.
Definition: dr1801uv_interface.hh:53
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: dr1801uv_interface.cc:285
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Provides some information about a radio model.
Definition: radioinfo.hh:16
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
static QList< USBDeviceDescriptor > detect()
Searches for all USB serial ports.
Definition: usbserial.cc:133
Response to a codeplug write.
Definition: dr1801uv_interface.hh:116
uint16_t unknown
Some unkown data.
Definition: dr1801uv_interface.hh:118
uint8_t success
Response code.
Definition: dr1801uv_interface.hh:117
Request to set transfer speed and load codeplug into RAM for transfer.
Definition: dr1801uv_interface.hh:70
uint32_t baudrate
The transfer speed.
Definition: dr1801uv_interface.hh:72
Response to a PREPARE_CODEPLUG_READ command.
Definition: dr1801uv_interface.hh:82
uint8_t success
If successful, set to 0x01.
Definition: dr1801uv_interface.hh:83
uint32_t size
Contains the size of the codeplug in big-endian.
Definition: dr1801uv_interface.hh:84
Request to prepare a codeplug write.
Definition: dr1801uv_interface.hh:95
uint32_t baudRate
The baud rate for the transfer.
Definition: dr1801uv_interface.hh:99
uint32_t size
Contains the size of the codeplug in big-endian.
Definition: dr1801uv_interface.hh:97
uint16_t _unknown0
Just set to 0x0001.
Definition: dr1801uv_interface.hh:96
uint16_t checksum
A checksum over the codeplug to be written.
Definition: dr1801uv_interface.hh:98
Response to a prepare-write request.
Definition: dr1801uv_interface.hh:108
uint16_t responseCode
Response code.
Definition: dr1801uv_interface.hh:109