Squashed 'DCPlugin/' changes from 01140c5..d992ee3

d992ee3 Added dc_getStatus() to send info to ISMAS
b7d8fab Added dc_getStatus() to send info to ISMAS
7129805 Added dc_getStatus() to send info to ISMAS

git-subtree-dir: DCPlugin
git-subtree-split: d992ee3fad831f8bc159b87e687390a233b41afb
This commit is contained in:
Gerhard Hoffmann 2023-04-18 15:07:55 +02:00
parent 2c6fa31cff
commit 8a216c43c0
3 changed files with 151 additions and 158 deletions

View File

@ -124,6 +124,8 @@ public:
T_datif *myDatif;
virtual QStringList dc_getStatus() const;
// ------------------------------------------------------------------------------
// Level 0 commands, interface
// open, close, change serial interface

View File

@ -2,12 +2,9 @@
#define INTERFACE_H
#include <QtPlugin>
#include <QStringList>
struct T_emp
{
struct T_emp {
// Fixdata from EMP:
uint8_t shaft; // = changer level
uint16_t countryCode;
@ -34,11 +31,9 @@ struct T_emp
uint8_t pollingRunning;
uint8_t paymentRunning;
};
struct Trtc_DateTime
{
struct Trtc_DateTime {
uint8_t rtc_hour;
uint8_t rtc_min;
uint8_t rtc_sec;
@ -48,8 +43,7 @@ struct Trtc_DateTime
uint8_t rtc_dayOfWeek;
};
struct Tprn_hw_state
{
struct Tprn_hw_state {
// hardware (IO's)
bool powerRdBk; // prn pwr is on
bool rsSwOk; // serial switch (printer or modem) is set to printer
@ -66,8 +60,7 @@ struct Tprn_hw_state
bool badResponse;
};
struct Tprn_currentSettings
{
struct Tprn_currentSettings {
uint8_t currFont;
uint8_t currSize;
uint8_t currHeigth;
@ -80,8 +73,7 @@ struct Tprn_hw_state
bool nowAligned;
};
struct T_dynDat
{
struct T_dynDat {
uint8_t licensePlate[8];
uint8_t vendingPrice[8];
uint8_t parkingEnd[8];
@ -92,10 +84,7 @@ struct Tprn_hw_state
uint8_t dynDat7[8];
};
struct T_vaultRecord
{
struct T_vaultRecord {
// Kassenbeleg (Abrechnungsdatensatz = Kassenwechsel-Datensatz)
char startbuffer[4]; // Psa> // never move or change this 1st entry
uint16_t AccountingNumber;
@ -126,7 +115,6 @@ struct T_vaultRecord
uint32_t VKcoinsInserted[16]; // nur für Wechsler, soviel wurde eingeworfen
uint32_t VKcoinsReturned[6]; // nur für Wechsler, Anzahl Münzen pro Typ, soviel wurde zurückgegeben
//88
// Service, Tür offen:
uint16_t ServCoinsInserted[16]; // nur für Wechsler, soviel wurde eingeworfen
uint16_t ServCoinsReturned[6]; // nur für Wechsler, Anzahl Münzen pro Typ, soviel wurde zurückgegeben
@ -136,12 +124,10 @@ struct T_vaultRecord
uint16_t resint5;
uint16_t resint6;
// 56
char label4buffer[4]; // box>
uint16_t coinsInVault[16];
uint16_t billsInStacker[8];
// 48
char label5buffer[4]; // val>
// actually constant unless exchange rate is changed
uint16_t coinDenomination[16]; // 5..50000 (z.B. 2? sind in Ungarn 760Ft)
@ -149,17 +135,12 @@ struct T_vaultRecord
uint16_t tubeDenom[6];
uint16_t exchangeRate;
uint16_t resint9;
// 64
char endofblock[4]; // end>
// 316 byte Block im Speicher
};
struct T_moduleCondition
{
struct T_moduleCondition {
// store conditon of all system components, hold in RAM
// 0 means unknown, not yet tested/used
// 1 means OK
@ -205,11 +186,9 @@ struct T_moduleCondition
uint8_t res11;
uint8_t res12;
uint8_t res13;
};
struct T_dynamicCondition
{
struct T_dynamicCondition {
char allDoorsDebounced;
char openedAuthorized;
uint8_t CBinDebounced;
@ -256,8 +235,7 @@ struct T_dynamicCondition
//54
};
struct T_extTime
{
struct T_extTime {
uint8_t Hours;
uint8_t Min;
uint8_t Sec;
@ -283,19 +261,16 @@ struct T_extTime
uint8_t res4;
uint16_t res5;
uint32_t MinutesOfMillenium;
};
class hwinf
{
class hwinf {
public:
enum class DownloadResult {OK, ERROR, TIMEOUT, NOP};
enum class FileTypeJson {CONFIG=1, DEVICE, CASH, SERIAL, TIME, PRINTER};
virtual ~hwinf() {}
virtual QStringList dc_getStatus() const = 0;
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
// Use serial interface and protocol stack in Cashagent-Library

View File

@ -169,6 +169,22 @@ bool hwapi::dc_openSerial(int BaudNr, QString BaudStr,
return false;
}
QStringList hwapi::dc_getStatus() const {
QStringList status;
if (m_sharedMem) {
SharedMemBuffer const *shMem = SharedMemBuffer::getDataConst();
status += QString("comport : %1").arg(shMem->rs.comportName);
status += QString("baudrate : %1").arg(shMem->rs.baudNr);
status += QString("baudNr : %1").arg(shMem->rs.baudStr);
status += QString("connect : %1").arg(shMem->rs.connect);
status += QString("port open: %1").arg(shMem->rs.portIsOpen);
// to be continued
}
return status;
}
bool hwapi::dc_closeSerial(void) const {
epi_closeSerial();
for (int i = 0; i < 10; ++i) {