beautypg.com

Ascii input command parsing rules, Command mnemonic parsing, Argument string parsing – NavCom Sapphire Rev.J User Manual

Page 36

background image

Sapphire Technical Reference Manual Rev. J

36

Table 1 and Table 2 show the basic format for Sapphire input commands.

Table 1: Basic Command Format Using Blanks as Delimiters

Command:

[command mnemonic] arg1 arg2 … argN

Table 2: Basic Command Format Using Commas as Delimiters

Command:

[command mnemonic] arg1,arg2,…,argN

When command responses are enabled, the Sapphire GNSS receiver issues a response to
each ASCII input command. The response is output on the data port on which the command
was received.

If the command is successfully parsed and accepted, the response characters are [OK]
followed by the command mnemonic.

If the command does not parse successfully and is not accepted, the response characters
are [??] followed by the command mnemonic, and, in some cases, an indication of which
argument caused the command not to be accepted.

Refer to the section below, Examples of ASCII Input Commands and Responses.

When command responses are enabled, the receiver is in verbose mode.

ASCII Input Command Parsing Rules

These sections describe the detailed parsing rules for the ASCII input command fields.

Command Mnemonic Parsing

Command mnemonics identify which control parameter or group of control parameters are
specified in the argument values. The entire command mnemonic must be enclosed in a
beginning square bracket ( [ ) and an ending square bracket ( ] ). Within the brackets, the
command mnemonic is not case sensitive, and any number of blanks may be used to improve
legibility.

If an invalid command mnemonic is issued, the response characters will be [??] followed by the
message “Unrecognized command mnemonic”.

Argument String Parsing

The argument string fields can be delimited by any number of blanks or by single commas.
When null fields are needed (no argument value provided), commas must be used to indicate
them. The argument string (and the entire command sentence) is terminated with a new line
sequence ( = carriage return + line feed).

There are four types of arguments for Sapphire ASCII input commands:

1. Integers: Decimal integers containing only the characters 0 to 9 and + or

2. Float: Floating point numbers containing only the characters 0 to 9 and + or

– and,

optionally,

the decimal point “.”

3. Keywords: ASCII strings that must match a predefined list of options for each command

These are case insensitive, but cannot contain embedded blanks. An example of a
keyword argument is the parity specification for a serial port, which is either NONE,
ODD, or EVEN.