Note that there are some explanatory texts on larger screens.

plurals
  1. PODetermine if serial port is normal COM or SPP
    primarykey
    data
    text
    <p>I'm looking for a way to determine if a COM is a standard COM or if it's an SPP COM, also known as a cable replacement bluetooth adapter for a COM device.</p> <p>I have a device which works both in USB (COM -> USB) and Bluetooth, and the Bluetooth interface works with SPP.</p> <p>I am currently using <code>System.IO.Ports.SerialPort.GetPortNames()</code> to get the COMs.</p> <p>Is there a way to determine whether or not it's a connected with Bluetooth or USB?</p> <p>SOLUTION:</p> <pre><code>System.Management.ManagementObjectSearcher Searcher = new System.Management.ManagementObjectSearcher("Select * from WIN32_SerialPort"); foreach (System.Management.ManagementObject Port in Searcher.Get()) { foreach (System.Management.PropertyData Property in Port.Properties) { Console.WriteLine(Property.Name + " " + (Property.Value == null ? null : Property.Value.ToString())); } } </code></pre> <p>And the output is something similar:</p> <pre><code>Availability 2 Binary True Capabilities CapabilityDescriptions Caption Standard Serial over Bluetooth link (COM10) ConfigManagerErrorCode 0 ConfigManagerUserConfig False CreationClassName Win32_SerialPort Description Standard Serial over Bluetooth link DeviceID COM10 ErrorCleared ErrorDescription InstallDate LastErrorCode MaxBaudRate 9600 MaximumInputBufferSize 0 MaximumOutputBufferSize 0 MaxNumberControlled Name Standard Serial over Bluetooth link (COM10) OSAutoDiscovered True PNPDeviceID BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&amp;0000\8&amp;3062A492&amp;0&amp;000000000000_0000001C PowerManagementCapabilities System.UInt16[] PowerManagementSupported False ProtocolSupported ProviderType RS232 Serial Port SettableBaudRate True SettableDataBits True SettableFlowControl True SettableParity True SettableParityCheck False SettableRLSD True SettableStopBits True Status OK StatusInfo 3 Supports16BitMode False SupportsDTRDSR True SupportsElapsedTimeouts True SupportsIntTimeouts True SupportsParityCheck False SupportsRLSD True SupportsRTSCTS True SupportsSpecialCharacters False SupportsXOnXOff False SupportsXOnXOffSet False SystemCreationClassName Win32_ComputerSystem SystemName JVALDRON-PC TimeOfLastReset </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload