开发者

How can I programmatically drop a Windows Mobile GPRS Connection?

Is there a way to explicitly close a GPRS connection?

I'm setting up a connection with ConnectionManage开发者_JS百科r and I've set the cache time to 10 seconds. Anyway after releasing it, the connection is still on, forever, alas I cannot use the registry key gprs_by_if_device_off. I'm using plain C++.

My idea is to simulate the activity of the windows button "disconnect data connection", but I really cannot understand what it does under the curtain.


You need to terminate the remote access connection using RasHangUp with the handle you got from RasEnumConnections.

PS know that this answer is a bit late, but hope it helps someone! ;)

RasHangUp http://msdn.microsoft.com/en-us/library/ms897108.aspx , RasEnumConnections http://msdn.microsoft.com/en-us/library/ms897095.aspx


Have you taken a look @ ConnMgrReleaseConnection ?

http://msdn.microsoft.com/en-us/library/bb416503.aspx


I believe so, but not in the way you'd probably hope. Take a look at the SetDevicePower, PowerPolicyNotify, and SetPowerRequirement functions from CoreDLL.

By changing the power value for the RIL (Radio Interface Layer) you can "power down" the Radio, but still keep other parts of the system at partial levels or full power.

I actually do the opposite in several of my programs ... I need for the RIL to stay powered up (so I can manage backend communications with a Server) even though the handset wants to enter sleep mode (you also have to use the PowerPolicyNotify function on this to enable this behavior. It's actually what Microsoft does that allows your handset to receive e-mails even though the device is in sleep mode - same thing. You're simply going the other direction - powering it down instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜