|
|
 |
 |
| EncodePacket |
| |
Encode a binary packet |
| |
| Syntax |
 |
PUBLIC STRING FUNCTION EncodePacket (STRING format,RECORD data) |
| |
| Parameters |
 |
| format |
 |
Formatting string: field1:<type> [ repeatcounter | ? | * ],field2:<type> [ repeatcounter | ? | * ]
The following types are accepted x Add 'count' NUL bytes, count defaults to 1. If '?', add as much NUL bytes as specified in the cell c Signed character (8 bit) C Unsigned character (8 bit) s/S (Un)signed short (little endian order, 16-bit) l/L (Un)signed long (little endian order, 32-bit) n/N (Un)signed short (big endian order/network byte order, 16-bit) p/P (Un)signed long (big endian order/network byte order, 32-bit) a NUL-padded string (padded up to specified counter). If '*', simply print string and NUL-terminate A ASCII-padded string (paddedup to specified counter). If '*', simply print string and space-terminate r Raw data - inserts a string. If a counter is specified, adds that many bytes of the string, if an asterisk is specified, add all data. @@ Jump to absolute position in packet encoder. Truncate or pad with zeroes if necessary. |
 |
| data |
 |
Data to encode |
 |
|
| |
| Returns |
 |
The encoded packet, or an empty string if encoding failed. |
| |
|
|
|
|