Added internal helpers for supporting dcUpdate:

DownloadResult sendNextAddress(int bNum) const;
    DownloadResult sendNextDataBlock(QByteArray const &b, int bNum) const;
    DownloadResult sendStatus(int ret) const;
    DownloadResult dc_downloadBinary(QByteArray const &binary) const;
    bool startBootloader() const;
    bool stopBootloader() const;
    bool openSerial(int br, QString baudrate, QString comPort) const;
    bool closeSerial(QString comport) const;
    bool resetDeviceController() const;
    QByteArray loadBinaryDCFile(QString filename) const;
    bool downloadBinaryToDC(QString const &bFile) const;

Redeclared returning "bool":
    dc_openSerial
    dc_closeSerial
    bl_checkDL.
    Added dc_updateDC(...).
This commit is contained in:
Gerhard Hoffmann 2023-04-05 14:08:16 +02:00
parent d0e1be11b6
commit e7723f669f

View File

@ -165,12 +165,23 @@ class hwapi : public QObject,
Q_PLUGIN_METADATA(IID "Atb.Psa2020.software.HWapi/1.0" ) //FILE "HWapi.json")
Q_INTERFACES(hwinf)
DownloadResult sendNextAddress(int bNum) const;
DownloadResult sendNextDataBlock(QByteArray const &b, int bNum) const;
DownloadResult sendStatus(int ret) const;
DownloadResult dc_downloadBinary(QByteArray const &binary) const;
bool startBootloader() const;
bool stopBootloader() const;
bool openSerial(int br, QString baudrate, QString comPort) const;
bool closeSerial(QString comport) const;
bool resetDeviceController() const;
QByteArray loadBinaryDCFile(QString filename) const;
bool downloadBinaryToDC(QString const &bFile) const;
public:
explicit hwapi(QWidget *parent = nullptr);
T_datif *myDatif;
// ------------------------------------------------------------------------------
// Level 0 commands, interface
// open, close, change serial interface
@ -178,13 +189,13 @@ public:
// start automatic READ requests
// ------------------------------------------------------------------------------
void dc_openSerial(int BaudNr, QString BaudStr, QString ComName, uint8_t connect) const override;
bool dc_openSerial(int BaudNr, QString BaudStr, QString ComName, uint8_t connect) const override;
// BaudNr: 0:1200 1:9600 2:19200 3:38400 4:57600 5:115200
// BaudStr: for exapmle "19200"
// ComName: for example "COM48"
// connect: 0, 1
void dc_closeSerial(void) const override;
bool dc_closeSerial(void) const override;
bool dc_isPortOpen(void) const override ;
@ -192,7 +203,8 @@ public:
// select if READ-Requests are sent manually one by one or automatically
// automatically request ALL digital and analog sensors, get time/date, get status information
bool dc_updateDC(QString binFileName, QString baudrate,
QString comPort) const override;
// ------------------------------------------------------------------------------
// Level 1, control device-controller (functions of µC)
@ -246,15 +258,6 @@ public:
QString dc_getState(void) const override;
// neu, 25.8.21
QString dc_getTxt4RsDiagWin(void) const override;
void dc_clrTxt4RsDiagWin(void) const override;
@ -975,7 +978,7 @@ public:
void bl_rebootDC(void) const override;
void bl_startBL(void) const override;
void bl_checkBL(void) const override;
bool bl_checkBL(void) const override;
bool bl_isUp(void) const override;
// return true is bl is up and running
// also initializes "sendFile"