"STM32. Net MF Development Board Learning-18" GPRS remote control intelligent car

Source: Internet
Author: User
Tags socket

With WiFi indirect control of the experience of the intelligent car, it is natural to think of, but also through the GPRS remote control intelligent car, because from the principle of communication, the two actually do not have what is essentially different, are based on the socket TCP communication, its control links are as follows:

Mobile phone ===> GPRS (TCP/IP) ===> PC ===> Zigbee (serial 232/ttl) ===> intelligent car

Unlike WiFi communications, to make mobile phone connection GPRS, still need to carry out a certain program to complete, related content, I do not need to introduce here, I used to write Bowen "let smart phone and home computer interconnection (WM6 GPRS)" In detail, users can refer to.

The mobile phone's operating system is Windows Mobile 6.0, its socket communication control program and PDA procedures are similar, the relevant code is as follows:

private void Btntcpconnect_click (object sender, EventArgs e)
{
Cursor.current = Cursors.waitcursor;
if (Btntcpconnect.text = = "Connection")
{
if (GPRS). Tcpconnect (txtip.text, Int. Parse (Txtport.text))
{
Btntcpconnect.text = "Disconnected";
Pictcpflag.backcolor = Color.green;
}
}
Else
{
Btntcpconnect.text = "Connection";
Pictcpflag.backcolor = color.red;
Gprs. Tcpdisconnect ();
}
Cursor.current = Cursors.Default;
}
private void Btnforward_click (object sender, EventArgs e)
{
Gprs. Tcpsend ("0");
}
private void Btnleft_click (object sender, EventArgs e)
{
Gprs. Tcpsend ("1");
}
private void Btnright_click (object sender, EventArgs e)
{
Gprs. Tcpsend ("2");
}
private void Btnback_click (object sender, EventArgs e)
{
Gprs. Tcpsend ("3");
}
private void Btnstop_click (object sender, EventArgs e)
{
Gprs. Tcpsend ("4");
}

The results of the compilation run are as follows:

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.