/* (1)This is a demo program which demonstrate how you can use the GPS function for 7188XB. (2)Connect the DB-9 connector of GPS receiver to RS-232 of 7188XB. Compiler file: GPSDEMO.c 7188XB.lib GPSXBS.lib 2005/03/24 written by Tony */ #include"..\..\lib\7188xb.h" #include"..\..\lib\GPS.h" void main(void) { char nmea[512]; char utc[16]; int type; int ver; type=Is7188xb(); /*detect the current operation system*/ if(type){ ver=GetLibVersion(); Print("Hello 7188XB! (Flash memory is %d K)\n\r",type); Print("Library version is %d.%02d",ver>>8,ver&0xff); } else{ Print("Hello PC!, this program is not run under 7188XB."); return; } InstallCom1(4800,8,0); Get_NMEA(1, "$GPGGA", nmea); /*Get whole $GPGGA code*/ Print("\r\n%s",nmea); /*Transmit the NMEA message to remote host via COM2 of 7188XB*/ Get_Field(1, nmea, utc); /*Only Get UTC Time*/ Print("\r\n%s",utc); /*Transmit the UTC to remote host via COM2 of 7188XB*/ DelayMs(500); RestoreCom1(); }