0
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_SerialPort");

foreach (ManagementObject queryObj in searcher.Get())
{
  String mod = queryObj["Name"].ToString();
  MessageBox.Show("Modem: " + mod + "\n");
  if (queryObj["Name"].ToString().Contains(Modem))   // i.e "ST-Ericsson ... "
  {

   com = System.Convert.ToString(queryObj["DeviceID"]);

   break;
  }

I have two modems connected. Both the devices are listed in Device manager. But only ST-Ericsson modem is found. Qualcomm modem, eventhough, it is listed in Device manager is not returning its name and device id which I need in order to setup the communication. Any one has any idea why ?

  • Try PnPEntity: http://stackoverflow.com/questions/11458835/finding-information-about-all-serial-devices-connected-through-usb-in-c-sharp – Alex K. Mar 06 '17 at 11:18
  • I did but the problem still persists. – Blitzkrieg Mar 06 '17 at 11:19
  • Is it listed if you remove the ClassGuid filter? – Alex K. Mar 06 '17 at 11:21
  • Yes i did still not working. Been at it for hours still have not found the problem. Other modem seems to be working fine. I tried sending commands through hyper terminal just in case if some thing is wrong with the modem but on hyper terminal it is working fine :/ – Blitzkrieg Mar 06 '17 at 11:29

0 Answers0