7 Software interface
Message types
There are two types of messages:
●
Unsolicited messages
- which include status messages, date/time and GPS
information, and notifications that user data has been received. By default most of these
are set to not appear, and user settings of these messages persist through restarts and
power cycles.
●
Command responses
- which include responses to input commands, as well as
notifications that user data has been sent or settings have been updated
General command structure
All messages sent and received are NMEA formatted sentences. NMEA sentences are
terminated with a single newline character. Each sentence begins with a
$
and ends with
*xx
where
xx
is a two digit hexadecimal checksum of the characters between the
$
and
*xx
. The
checksum conforms to the NMEA standard and does not include either the
$
or the
*xx
.
Messages with a bad checksum will fail to be parsed and produce the following response.
$CMD? ERR,CMD_NMEACHECKSUMFAIL*21
A sample implementation of the NMEA checksum can be found below (written in C)
A
$
will never occur within a command, and may be used to reset the receiving state machine.
An
*
may occur within a command. The receiving state machine will verify the last three
characters in the command are
*xx
after the
\n
is received and before the checksum is
calculated. Each
x
may be any legal ASCII character in the range
0..9
,
A..F
, or
a..f
.
An example command is provided below to illustrate the command structure and a valid
checksum. This command returns the most recent date/time message :
$DT @*70
$DT 20190408195123,V*41
© 2022 SWARM TECHNOLOGIES
SWARM M138 MODEM PRODUCT MANUAL · REV 1.20 · FEBRUARY 2022
PAGE
33