Extended nmea commands, Command syntax, Section 3.2.1 and 4.1 used with the permission of – Siemens XT55 AVL User Manual

Page 18: 1 extended nmea commands

Advertising
background image

XT55 AVL User’s Guide
Confidential/Released

s

m

o

b

i

l

e

XT55_avl_ug_V03

Page 18 of 37

28.06.2004

3.2.1 Extended NMEA commands

3.2.1.1 Command Syntax

The XT55 module accepts NMEA commands in the following formats:

$PSRF<command>,<parameter>, .. ,<parameter><* Checksum><CR> <LF>.

Command

1

Parameter

2

Checksum

3

End Sequence

4

$PSRF11

Data

*CKSUM

<CR> <LF>

1

NMEA command

2

Valid parameters

3

The checksum consists of a “*” followed by 2-digit hex value of checksum. In order to calculate the

Checksum, use your own application, which calculates the Checksum. Below a small source code is
written in Java:

private static void calcCS(String strCommand) {

int iCS = 0;

int iTemp = 0;

String strCS = "0";

for(int i=0; i<strCommand.length(); i++) {

iTemp = (int)strCommand.charAt(i);

iCS=

iCS^iTemp;

}

if(Integer.toHexString(iCS).length()==1)

{

strCS+=Integer.toHexString(iCS);

}

else

{

strCS = Integer.toHexString(iCS);

}

System.out.println("CheckSum:

"+strCS);

}


Therefore, the string over which the checksum has to be calculated is (see example below):
field = PSRF112,21 //without the character “$”

4

<

CR> <LF>Each message is terminated using Carriage Return (CR) Line Feed (LF) which is \r\n

which is hex 0D 0A. Because \r\n are not printable ASCII characters, they are omitted from the
example strings, but must be sent to terminate the message and cause the receiver to process that
input message.

Example:
$PSRF112,21*0A

Command

Parameter

Checksum

End Sequence

$PSRF112,

21

*0A

<CR> <LF>

Advertising