ok, So I thought it would be a good idea to get familiar with Python. (I have had experience with Java, php, perl, VB, etc. not a master of any, but intermediate knowledge)
so I am attempting to write a script that will take a the data from a socket, and translate it to the screen. rough beginning code to follow:
my code seems to correctly read the binary info from the socket, but I can't unpack it since I don't have access to the original structure.
I have the output for this stream with a different program, (which is terribly written which is why I am tackling this)
when I do print out the recv, it's like this...
b'L\x00k\x07vQ\n\x01\xffh\x00\x04NGIN\x04MAIN6Product XX finished reprocessing cdc XXXXX at jesadr 0c\x00k\x07vQ\n\x01\xffF\x00\x06CSSPRD\x0cliab_checkerCCheckpointed to XXXXXXXXXXXXXXXX:XXXXXXX.XXX at jesadr 0 (serial 0)[\x00l\x07vQ\n\x00\xff\x01\x00\x05MLIFE\x06dayendBdayend 1 Copyright XXXX XXXXXXX XXXXXXX XXXXX XXX XXXXXX XXXXXXXX.
from looking at this, and comparing it to the output of the other program, I would surmise that it should be broken up like..
b'L\x00k\x07vQ\n\x01\xffh\x00\x04NGIN\x04MAIN6Product XX finished reprocessing cdc XXXXX at jesadr 0'
with corresponding info
04-23
00:00:43
10
1
NGIN
MAIN
255
104
Product XX finished reprocessing cdc XXXXX at jesadr 0
Now, based on my research, it looks like I need to use the "struct" and unpack it, however I have no idea of the original structure of this, I only know what info is available from it, and to be honest, I'm having a hell of a time figuring this out.
I have used the python interpreter to attempt to unpack bits and pieces of the line, however it is an exercise in frustration.
If anyone can at least help me get started, I would very much appreciate it.
Thanks
.split('\n')it to have multilines. You would really need to get the format for the rest.structmodule, it doesn't support them very well, so you'll probably need to do it manually.