Receiving and Parsing UDP Payload

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?

  1. It looks as though the payload is encoded as a hex string, so the first thing would be to use hubitat.helper.HexUtils.hexStringToByteArray() on the payload value. You can turn it into a string using new String(theByteArray)

  2. This is where you may be out of luck, unless things have changed since I first started working with UDP.

Not to my knowledge.