4#include "openrtx_link.hh"
23 SOH = 0x01, STX = 0x02, EOT = 0x04, ACK = 0x06, NAK = 0x15, CAN = 0x18, CRC = 0x43
54 static uint16_t
crc_ccitt(
const QByteArray &data);
62 unsigned int _maxRetry;
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
An abstract stream encapsulated within OpenRTXLink.
Definition openrtx_link.hh:94
State
Possible states of the state machine.
Definition xmodem.hh:17
CtrlByte
Possible XMODEM control bytes.
Definition xmodem.hh:22
bool receive(QByteArray &buffer, int timeout=-1, const ErrorStack &err=ErrorStack())
Receives an entire file from the device.
Definition xmodem.cc:13
bool rxBytes(uint8_t *data, unsigned int size, int timeout=-1, const ErrorStack &err=ErrorStack())
Receives exactly size bytes from the device.
Definition xmodem.cc:262
bool send(const QByteArray &buffer, int timeout=-1, const ErrorStack &err=ErrorStack())
Sends the contents of buffer to the device.
Definition xmodem.cc:144
bool rxByte(uint8_t &b, int timeout=-1, const ErrorStack &err=ErrorStack())
Recives a single byte from the device.
Definition xmodem.cc:231
static uint16_t crc_ccitt(const QByteArray &data)
Computes the CRC16 checksum.
Definition xmodem.cc:281
bool txByte(uint8_t b, int timeout=-1, const ErrorStack &err=ErrorStack())
Sends a single byte to the device.
Definition xmodem.cc:221
XModem(OpenRTXLinkStream *transferLayer, QObject *parent=nullptr)
Constructs a xmodem connection via the USB device specified by descriptor.
Definition xmodem.cc:5
bool txBytes(const uint8_t *data, unsigned int size, int timeout=-1, const ErrorStack &err=ErrorStack())
Sends exactly size bytes to the device.
Definition xmodem.cc:244