Garmin GPSMAP 17 Specyfikacja techniczna - Strona 32

Przeglądaj online lub pobierz pdf Specyfikacja techniczna dla Morski system GPS Garmin GPSMAP 17. Garmin GPSMAP 17 40 stron. Gps receiver/antenna
Również dla Garmin GPSMAP 17: Instrukcja instalacji (16 strony), Instrukcja instalacji (12 strony), Instrukcja instalacji (16 strony), Podręcznik referencyjny (1 strony), Informacje techniczne (30 strony), Instrukcja instalacji (17 strony), Instrukcja instalacji (19 strony), Deklaracja zgodności (1 strony), Skrócona instrukcja obsługi (16 strony)

Garmin GPSMAP 17 Specyfikacja techniczna

Sample C Code

DLE and ETX bytes:
Sample C code to receive the two records should filter DLE and ETX bytes as described below:
typedef enum
{
DAT,
DLE,
ETX
} rx_state_type;
/* Declare and initialize static variables */
static char
static int
static rx_state_type rx_state = DAT;
.
.
.
void add_to_que( char data )
{
#define DLE_BYTE 0x10
#define ETX_BYTE 0x03
if ( rx_state == DAT )
{
if ( data == DLE_BYTE )
{
rx_state = DLE;
}
else
{
in_que[ in_que_ptr++ ] = data;
}
}
else if ( rx_state == DLE )
{
if ( data == ETX_BYTE )
{
rx_state = ETX;
}
else
{
rx_state = DAT;
in_que[ in_que_ptr++ ] = data;
}
}
else if ( rx_state == ETX )
{
if ( data == DLE_BYTE )
{
rx_state = DLE;
}
}
if ( in_que_ptr > 255 )
{
in_que_ptr = 0;
}
}
190-00228-20
in_que[ 256 ];
in_que_ptr = 0;
GPS 16/17 Technical Specifications
Page 28
Rev. C