Hi, John M. Dlugosz Thanks for your help! here I elaborate my question.
First, the prog I intend to finish is to provide data to remote server. Data transfer could be by ethternet, serial etc.
Second, whatever way of transfer, the process runs over a request-answer-mode protocol which is defined by server side and exist already. it's like
Send:(data request packet)
68 15 15 68 73 01 00 78 01 06 01 00 0B 01 05 19 0B CA 03 06 1E 0B
+CA 03 06 03 16
Receive:(confirm)
E5
Step 2:
Send :(request data)
10 5A 01 00 5B 16
Receive :(data)
68 15 15 68 28 01 00 78 01 07 01 00 0B 01 05 19 0B CA 03 06 1E 0B
+CA 03 06 B9 16
as I mentioned in this thread before, every byte has its own meaning d
+efined by protocol, e.g. length of data, checksum, end flag.
Third, I've had some experience about pack/unpack, but I've stuck most because I feel like many details about implementation of this protocol is ahead. like,
- How can I assert the data packet send from server is finished? because the size of data packet is variable by waiting time or check the end char?
- How check checksum?
- if the data packet is broken, how can I treat this session? close this session or wait the next packet?
- ...
Since I have no any experience about this, I have many questiones to be insighted. Before I indulge into the similar impleation in C, I'd like to know if there is relative mature implementation in perl.
I hope gurus here could help me out! Thanks!
I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction
|