It's easy to explain. For more information, see code analysis.
Void changehl (char * pe_id, int bit)
{
If (bit = 4)
{
Char TEM;
TEM = pe_id [0];
Pe_id [0] = pe_id [3];
Pe_id [3] = TEM;
TEM = pe_id [1];
Pe_id [1] = pe_id [2];
Pe_id [2] = TEM;
}
Else
{
Char TEM;
TEM = pe_id [0];
Pe_id [0] = pe_id [1];
Pe_id [1] = TEM;
}
}
Void onhotrestart () // hot restart
{
Char sentdata [13] = {0xb5, 0x62, 0x06, 0x04, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x10, 0x68}; // This is provided by the GPS module supplier if they do not give, just use the virtual serial port to capture the data sent by restarting the software demo!
Writecomm (gpscomport, sentdata, 26); // Where to read and write
}
Void oncoldrestart () // Col restart
{
Char sentdata [13] = {0xb5, 0x62, 0x06, 0x04, 0x04, 0x00, 0xff, 0x07, 0x02, 0x00, 0x16, 0x79 };
Writecomm (gpscomport, sentdata, 26 );
}
Bool gpsinit (hwnd curhwnd)
{
Opencomm (gpscomport, 9600,0, 8, 1 );
Return true;
}