[Original] "pupils can also" Series II, control GPS and high and low for interchange operations

Source: Internet
Author: User

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;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.