			HP 49G XModem Server Commands
		 compiled from emails from Cyrille de Brbisson
			   by Bruno Barberi Gnecco


Command packet structure is:
2 bytes: packet size (big endian mode: least significant first)
n bytes: packet data
1 byte: packet chksum (the packet size is not use in the CHK computation)

an ACK (0x06 H, standard XModem ACK) is expected as an answer to this packet.


G: Get A File From the Server. 
Followed by a command packet containing the file name (full pathname can be 
suplyed using MASD filename: "<portname>/<dir>/<file>", where H is port name
for HOME). After sending a G command and the  filename, enter in receive mode
to get the file.

P: Put A File on the Server
Followed by a command packet containing the file name. After sending the P
command and the filename, enter in Send mode to send the file.

Q: Quit the server mode.

L: List of the files in the directory.
The server answer by a command packet.
This packet data structure is:
For each entry in the current directory:
1byte: number of chr in the entry
n bytes: file name
2 byte: object prolog first 2 bytes
3 bytes: object size (in nibbles)
2 bytes: object CRC.

M: Get memory
The server answer with a command packet containing the free memory (in
ascii).

E: Execute command.
Followed by a command packet containing the RPL program to execute. Doesn't
return the stack, as Kermit does.

V: Get Version
The server answer with a command packet containing the XModem version info.

l: Get the list of all the files in the calculator.
The server answer by a command packet containing the list of all the files
dirs and subdirs in the calculator.
The data structure is (as far as I remember)
1 byte: number of chr in the entry (00 if end of directory)
n bytes: file name
2 byte: object prolog first 2 bytes
5 nibbles: object size
5 nibbles: object CRC.
if the object is a directory (check the prolog to know it if's the case),
it's followed by the list of the files in this directory (ending with a 00
chr entry).
1 nibble == 4 bits, also in big endian mode.

When the transmitter sends a command to the receiver, a respond expected
within 10 seconds. If the receiver does not respond within 10 second, the
transmitter resends the command. The transmitter will keep trying to obtain
a respond from the calculator. The transmitter will keep count of the number
of times it timed out. It has a maximum count of 5 attempts.
If the calculator responds to a re-transmission of the command, the time out
counter will be reset to 0.

