Click here to Skip to main content
15,919,245 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have deployed several usb modems (mostly huawei) which are used as SMS agents in an SMS server setup.

The problem is that sometimes when a reboot happens, some devices are re-assigned to other COM port slots. It causes problems since the program can no longer access the serial port/COM port. It needs to be reassigned manually.

My solution is to save IMEI numbers of all devices in database. When my program run it gets IMEI number from database and tries to detect all three ports with same IMEI number that I select.

My question is how to detect usb ports with IMEI number?
Posted

1 solution

Usually a USB proper com/serial device allows you to fix the port in device manager so that it always gets that port.

If that is not the case for your devices then a good place to start is WMI. Download the WMI Code Creator from Microsoft, unfortunately I do not have a modem attached on USB so can not give a specific example but start with looking at the WIN32_SerialPort Class; WMI Code Creator will generate the code for you if you set the language (defaults to C#) and you can incorporate it into your program.

Hope that helps, good luck.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900