3 ms·
> reading 8 bytes from the device, binary scan of the returned value, converting from the hex format It is not necessary to round trip through a hex encoding.
by pwg 10y ago
> reading 8 bytes from the device, binary scan of the returned value, converting from the hex format
It is not necessary to round trip through a hex encoding. Tcl's binary scan is capable of converting an 8 byte value directly into a 64-bit signed or unsigned integer. You can even request big or little endian interpretation of the bytes.
Check the "w" conversion flag in the man-page. For unsigned you'd add the "u" flag. For big-endian conversion use the "W" flag instead.