Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize Dial-up Internet access under Windows CE

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to achieve dial-up Internet access under Windows CE. Many people may not know much about it. In order to let everyone know more, Xiaobian summarized the following contents for everyone. I hope everyone can gain something according to this article.

At present, most products based on Windows CE have Internet access function, which can connect to the Internet to browse web pages, send and receive emails and other basic functions. Getting more functionality depends on how fast you connect to the Internet, and speed depends on how you connect to the Internet. There are two ways to connect to the Internet: wired and wireless. In fact, most products are still wireless.

Pocket PCs and Smart phones based on Windows Mobile make it easy to access the Internet. Software developers of both products can avoid having to think too much about how to implement dial-up Internet access. For products with custom Windows CE kernels, software developers must implement dial-up Internet access themselves. Fortunately, Windows CE includes dial-up support in its SDK, making the software developer's job much easier.

The hardware device of dial-up Internet can be a stand-alone mobile phone with built-in modem and GPRS function, or a mobile phone chip embedded in the motherboard with the same function. It doesn't matter what, because Windows CE includes a dial-up Internet module that uses the standard AT command set to communicate with hardware devices. Software developers can directly use CE interface functions to control the entire dialing process until the connection is disconnected.

Windows CE. NET provides a service called RAS (Remote Access Service), through which Windows CE-based products can connect to remote servers over WAN (Wide Area Network) or VPN (Virtual Personal Network). Applications that invoke RAS typically execute on clients and connect to remote servers over telephone networks using two standard remote access protocols: PPP Point-to-Point Protocol and SLIP Serial Line Internet Protocol. The RAS structure is shown in Figure 1. As can be seen from the figure, RAS is at the upper level of the ISO/OSI model, and the TAPI (Telephone API) at the lower level calls Unimodem, which is a general modem driver that calls the serial API to communicate with modem devices.

Figure 1 RAS Service Structure

RAS under Windows CE. NET has all the same functions as PC, and also supports phone book and dialing control script. The difference is that the RAS phone book under CE is stored in the registry. These are secondary functions and will not be described here. The functions that must be called to implement dialing are as follows:

RasDial establishes a RAS connection RasEnumEntries lists all dial records in the registry RasGetConnectStatus Gets the current status of the specified remote access connection. RasGetEntryDialParams Get connection data for the specified last successful dial record (Parameter) RasSetEntryDialParams Set connection data for the specified last successful dial record (Parameter) RasGetEntryProperties Get dial record properties RasSetEntryProperties Set dial record properties RasHangUp Terminate RAS connection

Windows CE-based products are designed to save registry data before power is lost, or not. For products that do not store registry data, phone dialing is not feasible. The user can only re-enter the dialing data after each startup, or save the data to permanent storage and read the dialing data the next time the dialing program starts.

The whole dialing state is divided into synchronous and asynchronous two kinds. The RasDial function does not return in synchronous mode until a connection is established or an error occurs and it cannot continue working. The disadvantage of synchronous mode is that the client does not receive current status and progress information about the connection operation. But there is still a workaround by creating a new thread to dial (calling RasDial) and another thread to query the current dialing status every once in a while (calling RasGetConnectStatus). It is much easier to get the current dialing status than asynchronous mode. In asynchronous mode the RasDial function returns immediately, followed by a call to RasGetConnectStatus to get the current dialing status.

RasGetEntryDialParams and RasGetEntryProperties get different aspects of data. A note here: CE defines the struct RASDIALPARAMS for the DialPrarms dial parameter. It includes dial record name, telephone number, user name, password, domain name, etc. For Properties data, CE defines the structure RASENTRY. It includes connection options, country code, zone code, local phone number, local IP address, remote DNS server IP, remote WINS server IP, etc., and connection control script file path, protocol used, modem type, name, etc. Be sure to set these parameters before dialing, but you don't have to set every parameter. The easiest way is to get all the parameters by default. The call code is as follows:

DWORD dwReturn;

dwReturn = RasGetEntryProperties(NULL, L"", &RasEntry, &dwSize, NULL, NULL);

if(dwReturn != 0)

{

////System dialing parameters cannot be obtained

return;

}

Get the system default parameters and then modify them, so as to avoid setting the wrong parameters, and most of the parameters do not need to be set by us. So much for dial-up. If readers have questions or difficulties, email me and I'll reply if I have time.

After reading the above content, do you have any further understanding of how to realize dial-up Internet access under Windows CE? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report