如何以编程方式断开 Windows Mobile GPRS 连接?

发布于 2024-09-04 01:38:57 字数 216 浏览 5 评论 0原文

有没有办法显式关闭 GPRS 连接?
我正在使用 ConnectionManager 设置连接,并将缓存时间设置为 10 秒。无论如何,释放后,连接仍然存在,永远,可惜我无法使用注册表项gprs_by_if_device_off。我正在使用纯 C++。

我的想法是模拟Windows按钮“断开数据连接”的活动,但我真的无法理解它在幕后的作用。

Is there a way to explicitly close a GPRS connection?
I'm setting up a connection with ConnectionManager 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

爱本泡沫多脆弱 2024-09-11 01:38:57

您需要使用 RasHangUp 以及从 RasEnumConnections 获得的句柄来终止远程访问连接。

PS知道这个答案有点晚了,但希望它能帮助别人! ;)

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

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

放血 2024-09-11 01:38:57

您看过@ConnMgrReleaseConnection 吗?

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

Have you taken a look @ ConnMgrReleaseConnection ?

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

潜移默化 2024-09-11 01:38:57

我相信是这样,但不是你希望的那样。查看 CoreDLL 中的 SetDevicePower、PowerPolicyNotify 和 SetPowerRequirement 函数。

通过更改 RIL(无线电接口层)的功率值,您可以“关闭”无线电,但仍将系统的其他部分保持在部分级别或全功率。

实际上,我在我的几个程序中做了相反的事情......我需要 RIL 保持通电(这样我就可以管理与服务器的后端通信),即使手机想要进入睡眠模式(您还必须使用 PowerPolicyNotify这实际上是微软所做的,即使设备处于睡眠模式,也可以接收电子邮件 - 同样的事情 - 你只需将其关闭即可。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文