0

I have Mobile Broadband adapter. I need to be able to send AT commands to the modem from code. I can do that using hyperterminal. In my device list Broadband adapter determined as WWAN adapter:

Modem as network adapter

I can connect to the modem using hyperterminal:

enter image description here

and send at commands.

But I can't figure out how can I do that from code (C# or C++). What protocol I must use and what port to connect (this is not COM)? Sniffing by wireshark wwan gives absolutely nothing.

Could you give me some advice?

FunctorPrototype
  • 1,173
  • 2
  • 12
  • 24

2 Answers2

0

One approach is to call SerialPort.GetPortNames() and figure it out. Hopefully it shows up there.

// Get a list of serial port names. 
string[] ports = SerialPort.GetPortNames();

Console.WriteLine("The following serial ports were found:");

// Display each port name to the console. 
foreach(string port in ports)
{
    Console.WriteLine(port);
}
kenny
  • 21,522
  • 8
  • 49
  • 87
0

If you want to use AT commands, as Kenny says, you have to do this via a COM port.
To access the 3G network programmatically via a network adapter, you can go via the Windows Mobile Broadband API.
You'd use the Mobile Broadband API functions and events, not AT commands.

There is some example code here.

To discover your device programmatically, you have to know the PID/VID (Product Id and Vendor Id), and search for it. There's plenty of help on how to do that, for example this SO question.
You can find your device's PID and VID by inspecting the device properties from Windows Device Manager, and then use them programmatically to discover the device, as described in the question.

NB: Windows Mobile Broadband API is available on Windows Desktop from Windows 7 onwards. If you're in the Metro area, there are different Mobile Broadband APIs, that you can also access via the PID/VID

Community
  • 1
  • 1
user1725145
  • 3,993
  • 2
  • 37
  • 58