Sending binary data with telnet


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:

what is actually sent:

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)


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