implement trigger interfaces
parent
8cb6e72701
commit
34c00d69de
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue