Sending binary data with telnet


#1

I’m writing a Tekmar driver and need to send/receive binary data over TCP/IP.

The Telnet driver works well for receive, but sending binary data causes the packet to get rewritten during expansion as unicode.

binary data to be sent:
CA050600670100007335

what is actually sent:
c38a05060067010000733535

I suspect the string is being converted to a byte array in the hubitat telnet driver and expanded as unicode.

Is there a way to send binary data with telnet?

pck = unhexify("CA050600670100007335"); 
dump = dump_hex(pck);    
log.debug "${device.label}:  ${dump}"
return new hubitat.device.HubAction(msg, hubitat.device.Protocol.TELNET)

#2

Did you figure out how to telnet data over TCP/IP ?