(Jul-24-2019, 11:05 AM)Gribouillis Wrote: What I see in the code is that you're sending the output ofcon_dat()
through the socket
labeler_datasend = con_dat(aa_labeler_frame) ... labeler_socket.send(labeler_datasend)I don't understand whatcon_dat()
does but I see that it returns the python typestr
and not a typebytes
because there are statements such asrawconvertdata = ''
(instead of= b''
) or likerawhexstring = str(rawdata)
, etc. So the first thing to do seems to clean up this function so that it returns the binary string that the labeller is expecting.
con_dat - it will be another def, i don't have it yet
For example: its my string:
data = '\x01\x81\xaa\x76\x00\x5d\x44\x00\x00\x00\x00\x57\x47\x5f\x4f\x52\x44\x45\x52\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x31\x38\x39\x00\x64\x75\x70\x6b\x61\x5f\x69\x77\x6f\x6e\x6b\x69\x00\x31\x35\x39\x30\x30\x34\x37\x37\x30\x30\x32\x32\x38\x32\x38\x35\x38\x36\x00\x30\x35\x39\x30\x30\x34\x37\x37\x30\x30\x32\x36\x32\x38\x00\x38\x31\x00\x32\x30\x31\x32\x30\x30\x00\x34\x31\x30\x31\x38\x39\x00\x73\x6f\x63\x31\x31\x32\x30\x36\x31\x39\x00\x31\x32\x33\x34\x35\x36\x37\x38\x39\x30\x00\xe7\xdc'
and my string in TCP frame must look like below: