Key Points of EVC Programming Based on Wince-GPRS application under WinCE

Source: Internet
Author: User
Tags node server

9000 the embedded motherboard, em9260 embedded motherboard, and em9160 embedded motherboard are pre-installed with a genuine wince operating system. All communication interfaces of the embedded motherboard are configured with standard wince drivers, this article focuses on a typical application of serial communication in the embedded motherboard, that is, how to develop GPRS applications on these embedded motherboard.

The standard application mode of GPRS is as the client mode. by dialing "** 99 ** 1 #" to China Mobile's GPRS node server, you can implement the dial-up Internet access function. A Remote Access Service (RAS) is provided in the wince operating system, that is, "Remote Access Service". It allows remote dial-up connections. Once a connection is established, communication can be performed just like a computer in a LAN. If a GPRS device is installed on the embedded master board of the yundun family, you can use Ras dial-up to directly access the internet. Further, you can use TCP/IP data communication to implement application data communication, in this way, the application data can be transmitted without line. The following describes how to develop the RAS function to implement GPRS automatic dialing. This includes how to automatically establish a GPRS dialing connection, power management of the GPRS wireless module, and automatic GPRS dialing.

1. automatically create a GPRS dial-up connection

Before GPRS dialing, you need to create a dial-up connection, that is, you need to add a rasentry to the RAS phone book and save it in the registry. In rasentry, you need to set the device attributes (port settings, dial number options) as the modem, and specify the phone number and user verification parameters. Em9000 embedded motherboard directly supports the wince desktop system. You can manually add a GPRS dial number connection through the "control panel" on the interface. For specific configuration methods, see the technical document "em9000 wireless communication network settings", which will not be described here. Em9260 and em9160 embedded boards do not support the wince interface. Therefore, for the convenience of user use, the company has designed the rasentry.exe program for automatically creating dial connections, which is bundled into the kernel. You can directly run the rasentry.exe in the Windows> directory, that is, you can automatically create a GPRS dial-up connection. This program is applicable to all the arm9-embedded boards of yingchuang. Rasentry.exe only needs to run once.

For the em9000 standard board, set the port in the GPRS dialing attribute to com3, the baud rate to 57600, the 8-Bit Data bit, no verification, and the 1-bit stop bit. In em9260 and em9160, the port in the GPRS dialing attribute is configured as com2, the baud rate is 57600, and the 8-Bit Data bit, no verification, and the 1-bit stop bit.

Ii. Power-on Process of GPRS wireless module

The mc39i module can be directly connected to all the arm9-embedded motherboard Development kits provided by invec for GPRS application development. Here we mainly introduce the mc39i power-on Process of Siemens.

Mc39i power management is achieved through 1-Way Digital Input (upls_pwr), 2-way digital output (upls_stb, upls_aux. In this example, the GPRS s_pwr module is used to check the power-on status of the mc39i module. The input height indicates that the wireless module is powered on. the GPRS s_stb module is mainly used to power on mc39i. A pulse is output through the GPRS s_stb module to enable mc39;.

In the program design, in order to ensure that the power-on operation of the mc39i module is normal each time, the policy adopted by the program we provide is to first power off the module and then perform the normal power-on operation.

GPRS _ poweroff (); // you can call this operation to shut down the mc39i module power.
Sleep (200); // latency: 200 ms
GPRS _ poweron (); // operate the GPRS _ STB command to power the mc39i module.

The gtm900 wireless module of Huawei is consistent with mc39i in shape and pins. Therefore, gtm900 can be directly connected to the arm9-embedded motherboard Development Kit provided by yingchuang for GPRS application development. Gtm900's power management is also the use of GPRS _ STB and GPRS _ aux. The only difference between gtm900 and mc39i lies in the power-on and power-off operations. For this reason, the company provided the corresponding GPRS _ poweroff () for gtm900 () the application can still perform automatic power-on operations on gtm900 in the same call sequence.

Iii. Automatic GPRS dial-up connection

After the GPRS dial-up connection is established, you can directly call the standard function rasdial (…) provided by the wince system (...) To automatically establish a PPP connection. The definition and usage of this function can be obtained in the line help of EVC. This section describes how to implement automatic GPRS dialing in a program, that is, the policies adopted in the automatic dialing program provided by the company.

To ensure the success of automatic dialing, the procedure is as follows:

1. regardless of the status of the current GPRS wireless module, the GPRS module is powered off and reset and re-powered through the relevant functions (GPRS s_poweroff () and GPRS s_poweron. To ensure that the GPRS module is in the initial power-on status.

2. Call the standard function rasenumconnections (…) provided by the wince system (...) Lists the established active connections. If the number of active connections is not 0, call the rashangup function (...) To stop the active connection. This operation aims to ensure that there is only one active connection.

3. Call the rasdial (…) function (...) Call GPRS. After successful dialing, the system maintains an active dialing connection.

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.