Implement new interface method sendDeviceParameter()

This commit is contained in:
Siegfried Siegert 2024-03-18 17:02:49 +01:00
parent 849305bc8f
commit 6a08cf0b62
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03
2 changed files with 33 additions and 0 deletions

View File

@ -134,6 +134,37 @@ PLUGIN_STATE ATBDeviceControllerPlugin::initDCPlugin(QObject *eventReceiver, con
}
void ATBDeviceControllerPlugin::sendDeviceParameter(const QJsonObject &jsonObject)
{
qCritical() << "ATBDeviceControllerPlugin::sendDeviceParameter:";
// extract location info and store location info in persistent data:
QJsonValue jsonSubVal;
jsonSubVal = jsonObject["Location"];
QString locationString = jsonSubVal.toString("");
if (locationString == "") {
qCritical() << " --> locationString NULL";
return;
}
uint16_t customerNr = PTUSystem::readCustomerNumber();
uint16_t machineNr = PTUSystem::readMachineNumber();
uint16_t borough = PTUSystem::readZoneNumber();
uint16_t zone = PTUSystem::readGroupNumber();
uint16_t alias = 0;
QByteArray locationBa = locationString.toLocal8Bit();
this->hw->sendMachineID(customerNr, machineNr, borough, zone, alias, locationBa.data());
}
void ATBDeviceControllerPlugin::startPhysicalLayer()
{
if (!this->isMaster) return;

View File

@ -44,6 +44,8 @@ public:
// interface:
PLUGIN_STATE initDCPlugin(QObject *eventReceiver, const QSettings & settings);
void sendDeviceParameter(const QJsonObject & jsonObject);
// TASKS: Cash handling -------------------------------------------------------
void requestStartCashInput(const QString & amount);
void requestStopCashInput();