如何使用USB 3G调制解调器的通信? [英] How to communicate with USB 3G modem?

查看:320
本文介绍了如何使用USB 3G调制解调器的通信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我想从我的应用程序(在Windows XP SP3上运行的C#.NET 4.0)发送AT的命令到D-Link的DWM-156 3G USB调制解调器。

I have a D-Link DWM-156 3G USB modem that I want to send AT-commands to from my application (C# .NET 4.0 running on Windows XP SP3).

插件并安装驱动程序后,调制解调器显示出来是这样的:

After plug-in and installation of drivers the modem shows up like this:

设备管理器的,添加了两个串口


  • 的D-Link HSPADataCard诊断接口(COM4)

  • 的D-Link HSPADataCard NMEA设备(COM5)

  • D-Link HSPADataCard Diagnostics Interface (COM4)
  • D-Link HSPADataCard NMEA Device (COM5)

控制面板,电话和调制解调器选项的,一个新的调制解调器添加:

In Control Panel, Phone and Modem Options, a new modem is added:


  • 的D-Link HSPADataCard专有USB调制解调器(附COM19)

  • D-Link HSPADataCard Proprietary USB Modem (attached to COM19)

问:我应该使用哪个COM端口AT发送 - 命令,在这速度?

我曾尝试以不同的速度全部三个端口,但没有运气任何责任。

I have tried all three ports at different speeds, but with no luck whatsoever.

为了学习,然后我装的免费串行端口监视器的嗅探器的应用程序,希望能够监视用它打开和关闭网络连接(其中工程OK)D-Link的ustility通信。

In order to learn, I then installed the "Free Serial Port Monitor" sniffer app, hoping to be able to monitor the communication with the D-Link ustility as it opens and closes the internet connection (which works OK).

在启动时,嗅探器的应用程序问我来监控和端口我提供以下端口名称可供选择:

On start, the sniffer app asks me which port to monitor and offers me the following port names to choose from:


  • 杰尔系统HDA调制解调器,

  • D-Link的HSPADataCard专有USB调制解调器,

  • COM3,

  • COM4,

  • COM5

  • ...还有几个,包括COM19。

  • "Agere Systems HDA Modem",
  • "D-Link HSPADataCard Proprietary USB Modem",
  • "COM3",
  • "COM4",
  • "COM5"
  • ...and several more, including "COM19".

选择的D-Link的......的名工作好了,现在我可以观看所有,因为它们发生命令所使用的AT,但我不能确定端口用于在该波特率。此外,无论是COM4,COM5或COM19工程嗅探这种方式(似乎没有任何发生在这些端口)。

Choosing the "D-Link..." name works OK, now I can watch all the AT commands being used as they happen, but I cannot determine at which baud rate the port is used. Further, neither COM4, COM5 or COM19 works for sniffing this way (nothing seems to happen on those ports).

现在我想使用的的SerialPort 的在.NET类打开的D-Link的......的端口,并与USB调制解调器说话,但的的SerialPort 的类要求的端口名启动与COM,否则会抛出异常。但没有普通的COM端口的工作。我仍然不知道该使用哪个波特率。我几乎困惑,并锁定在这里 - 我还能有什么办法去这条底线

Now I would like to use the SerialPort class in .NET to open the "D-Link..." port and talk with the USB modem, but the SerialPort class requires the port name to start with "COM", otherwise an exception is thrown. But none of the ordinary COM-ports work. And I still don't know which baud rate to use. I'm pretty much confused and locked up here - what could I do to get to the bottom of this?

推荐答案

好乡亲,谢谢你所有的想法和你的输入。我已经做了一些调查研究,最后我才明白,那为了做什么,我想我没有带串口和AT-命令不惜一切打扰。所有的需要,这是做了一些Windows RAS调用。

Ok folks, thank you for all your thoughts and your input. I have done some more research, and finally i realized, that in order to do what i wanted i did not have to bother with serial ports and AT-commands at all. All that was needed was to do a few Windows RAS calls.

如果我刚刚被更具体一点在我的问题关于什么,我想用我的AT-做!命令,你一定会告诉我的RAS很久以前

If I had just been a bit more specific in my question about what I wanted to do with my AT-commands, you would surely have told me about RAS long time ago!

我找到了一个不错的.Net DLL(的 DotRas ),它包装机Windows RAS从托管代码中使用,而且它似乎做正是我需要(拨号从代码的3G调制解调器连接,与任何类型的3G调制解调器附上)。

I found a nice .Net DLL (DotRas) that wraps native Windows RAS for use from managed code, and it seems to do just what I need (dial a 3G modem connection from code, with any type of 3G modem I attach).

再次感谢您的时间。

这篇关于如何使用USB 3G调制解调器的通信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆