From 34c00d69de41abcc67e594c2e6c8601aa9306ca1 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 11 Apr 2018 23:25:02 +0200 Subject: [PATCH] implement trigger interfaces --- udpcommander/devicepluginudpcommander.cpp | 4 ++-- udpcommander/devicepluginudpcommander.json | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/udpcommander/devicepluginudpcommander.cpp b/udpcommander/devicepluginudpcommander.cpp index b91fb048..bf92c4a0 100644 --- a/udpcommander/devicepluginudpcommander.cpp +++ b/udpcommander/devicepluginudpcommander.cpp @@ -99,7 +99,7 @@ DeviceManager::DeviceSetupStatus DevicePluginUdpCommander::setupDevice(Device *d DeviceManager::DeviceError DevicePluginUdpCommander::executeAction(Device *device, const Action &action) { if (device->deviceClassId() == udpCommanderDeviceClassId) { - if (action.actionTypeId() == udpCommanderOutputDataActionTypeId) { + if (action.actionTypeId() == udpCommanderTriggerActionTypeId) { QUdpSocket *udpSocket = m_commanderList.key(device); int port = device->paramValue(udpCommanderPortParamTypeId).toInt(); QHostAddress address = QHostAddress(device->paramValue(udpCommanderAddressParamTypeId).toString()); @@ -151,7 +151,7 @@ void DevicePluginUdpCommander::readPendingDatagrams() } qCDebug(dcUdpCommander()) << device->name() << "got command from" << sender.toString() << senderPort; - Event ev = Event(udpReceiverDataReceivedEventTypeId, device->id()); + Event ev = Event(udpReceiverTriggeredEventTypeId, device->id()); ParamList params; params.append(Param(udpReceiverDataParamTypeId, datagram)); ev.setParams(params); diff --git a/udpcommander/devicepluginudpcommander.json b/udpcommander/devicepluginudpcommander.json index 5c660715..c3cbd1f7 100644 --- a/udpcommander/devicepluginudpcommander.json +++ b/udpcommander/devicepluginudpcommander.json @@ -13,6 +13,7 @@ "displayName": "UDP Receiver", "name": "udpReceiver", "deviceIcon": "Network", + "interfaces": ["inputtrigger"], "basicTags": ["Service", "Sensor"], "createMethods": ["user"], "paramTypes": [ @@ -29,7 +30,7 @@ "eventTypes": [ { "id": "5fecbba3-ffbb-456b-872c-a2f571c681cb", - "name": "dataReceived", + "name": "triggered", "displayName": "Data received", "paramTypes": [ { @@ -48,6 +49,7 @@ "displayName": "UDP Commander", "deviceIcon": "Network", "basicTags": ["Service", "Sensor"], + "interfaces": ["outputtrigger"], "createMethods": ["user"], "paramTypes": [ { @@ -71,7 +73,7 @@ "actionTypes": [ { "id": "6bc52462-b192-46a4-a6df-92cc5a479c89", - "name": "outputData", + "name": "trigger", "displayName": "Send data", "paramTypes": [ {