/* (1)This is a demo program which demonstrate how you can use the GPS function for 7188XA. (2)Connect the DB-9 connector of GPS receiver to COM1 of 7188XA. (3)Then you can transmit the NMEA message to remote host via COM2/3 of 7188XA. Compiler file: GPSDEMO.c 7188XA.lib GPS.lib 2002/02/06 written by Tony */ #include"..\lib\7188xa.h" #include"..\lib\GPS.h" void main(void) { char nmea[512]; char utc[16]; int type; int ver; type=Is7188xa(); /*detect the current operation system*/ if(type){ ver=GetLibVersion(); Print("Hello 7188XA! (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 7188XA."); return; } InstallCom1(4800,8,0,1); Get_NMEA(1, "$GPGGA", nmea); /*Get whole $GPGGA code*/ Print("\r\n%s",nmea); /*Transmit the NMEA message to remote host via COM2 of 7188XA*/ Get_Field(1, nmea, utc); /*Only Get UTC Time*/ Print("\r\n%s",utc); /*Transmit the UTC to remote host via COM2 of 7188XA*/ DelayMs(500); RestoreCom1(); }