Need to extract information from packet (FDS)
computer guy
Posts: 1,113
I am using FullDuplexSerial (FDS) to get packets of information from a module.
I need to read in the packet and extract parts of information.
Key:
Packets are constructed like so:
They can be as simple as:
Or as complex as:
I basically need to extract it like this:
1.
2.
can someone please get me started on how I might go about doing this?
I need to read in the packet and extract parts of information.
Key:
<cr_lf> = 0x0D0A (carriage return, linefeed)
Packets are constructed like so:
<cr_lf>RESPONSE<cr_lf>
They can be as simple as:
<cr_lf>OK<cr_lf>
Or as complex as:
<cr_lf>OK<cr_lf> <cr_lf>0,1,0,ECFE7E000000<cr_lf>
I basically need to extract it like this:
1.
status := "OK" data := ""
2.
status := "OK" data := "0,1,0,ECFE7E000000"
can someone please get me started on how I might go about doing this?
Comments
Andy
I think I've managed to pull something together. After doing some more testing I will post the code, so it might help others.