Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-11

Re: PDA and Linux communication

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jonas Maebe
to jordi: Can someone help me?. I'm trying to write a program that communicates with a Casio PDA. I…
jordi wrote 11 lines
I'm trying to write a program that communicates with a Casio PDA. I have troubles with long commands which are sent in several packets. For example : when receive the link packet "calling up" -18303030303030- (7 bytes) no problem, but when receive the command packet "for negotiation" in this several packets -0130313043383131- (8 bytes) -3031303030323031- (8 bytes) -353341- (3 bytes) how can i know that I've received the full packet and the communication is stopped waiting for an answer?, i want to receive the full packet before process it, is that possible or I have to control it byte by byte?

You probably have to check it byte by byte, yes. You should completely separate the receiving and the processing of the packets, just like the compiler separates the scanner and the reading of the pascal source code. If the scanner needs a new character, it just calls a function called nextchar() (or something like that) which returns the next character. This procedure checks whether the next character is already in the memory buffer and if not, reloads the memory buffer with the next part of the file.

You can do something similar, but with nextchar() waiting for more input from the network.

Jonas

jordi

Can someone help me?.
I'm trying to write a program that communicates with a Casio PDA. I have troubles with long commands which are sent in several packets. For example : when receive the link packet "calling up" -18303030303030- (7 bytes) no problem, but when receive the command packet "for negotiation" in this several packets -0130313043383131- (8 bytes)
-3031303030323031- (8 bytes)
-353341- (3 bytes) how can i know that I've received the full packet and the communication is stopped waiting for an answer?, i want to receive the full packet before process it, is that possible or I have to

control it byte by byte?

Salutacions. Jordi. http://galeon.com/jovy215639/