I'm using sendHubCommand for UDP communications from an App. Two questions:
#1
I call -
def myHubAction = new hubitat.device.HubAction("\n", hubitat.device.Protocol.LAN, [type: hubitat.device.HubAction.Type.LAN_TYPE_UDPCLIENT, destinationAddress: "${hubIp}:30007", callback: parseMsg])
When parseMsg gets called I have a log.debug which shows:
[deviceNetworkId:null, description:index:00, mac:9E65F90939E9, ip:c0a856df, port:7537, type:LAN_TYPE_UDPCLIENT, payload:7B2242223A2242483334363434227D0A]
The docs for the API I'm using say the payload should be JSON... how do I convert that? FYI the parseMsg seems to be receiving a string not an object as the parameter?
#2
The API returns more than one message over UDP... I get the first one, how do I get the remaining messages? I read some conflicting information, is this even possible?