Compare commits

..

2 Commits
2.1.1 ... 2.2.0

3 changed files with 41 additions and 1 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() void ATBDeviceControllerPlugin::startPhysicalLayer()
{ {
if (!this->isMaster) return; if (!this->isMaster) return;

View File

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

View File

@@ -5,6 +5,7 @@
#include <QSettings> #include <QSettings>
#include <QString> #include <QString>
#include <QJsonObject>
#include "ATBAPPplugin.h" #include "ATBAPPplugin.h"
@@ -39,6 +40,12 @@ public:
virtual nsDeviceControllerInterface::PLUGIN_STATE initDCPlugin(QObject *eventReceiver, virtual nsDeviceControllerInterface::PLUGIN_STATE initDCPlugin(QObject *eventReceiver,
const QSettings & settings) = 0; const QSettings & settings) = 0;
/**
* e.g. send location
*/
virtual void sendDeviceParameter(const QJsonObject & jsonObject) = 0;
// TASKS: Cash handling ------------------------------------------------------- // TASKS: Cash handling -------------------------------------------------------
/** /**
* enables coin input * enables coin input
@@ -196,7 +203,7 @@ signals:
Q_DECLARE_INTERFACE(DeviceControllerInterface, Q_DECLARE_INTERFACE(DeviceControllerInterface,
"eu.atb.ptu.plugin.DeviceControllerInterface/1.1.3") "eu.atb.ptu.plugin.DeviceControllerInterface/1.1.4")
namespace nsDeviceControllerInterface { namespace nsDeviceControllerInterface {