in Education by
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. I have a device which works both in USB (COM -> USB) and Bluetooth, and the Bluetooth interface works with SPP. I am currently using System.IO.Ports.SerialPort.GetPortNames() to get the COMs. Is there a way to determine whether or not it's a connected with Bluetooth or USB? SOLUTION: 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())); } } And the output is something similar: 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&0000\8&3062A492&0&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 JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You are unable to find this information out via the SerialPort class. You would need to do a WMI query. Doing something along the lines of this may lead you to it ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * from WIN32_SerialPort"); foreach(ManagementObject Port in searcher.Get()) { string a = (string) Port.GetPropertyValue("Name"); } I haven't got this code loaded so I don't know what further properties you can obtain. However if there was anyway, WMI would be the way to do it.

Related questions

0 votes
    I am using a program that talks to my COMM port, but I have made another program that I want to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am using a program that talks to my COMM port, but I have made another program that I want to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am using a program that talks to my COMM port, but I have made another program that I want to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 10, 2022 in Education by JackTerrance
0 votes
    I'm working on some idea connected with RS-232 interface manipulation. I can open this port, configure it ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    Compare and contrast the following technologies (i) SRAM and DRAM (ii) USB and Serial Port (iii)Joystick and ... and LED display Select the correct answer from above options...
asked Dec 29, 2021 in Education by JackTerrance
0 votes
    The transaction can no longer continue with its normal execution because of some internal condition, such ... topic in chapter Recovery System of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    I'd like to be able to determine if a directory such as a '.app' is considered to be a package ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
0 votes
    I'm wanting a method called same_url? that will return true if the passed in URLs are equal. The ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    Write a program in Java to input any age and determine whether the age is valid or  invalid. If age is ... is valid otherwise invalid. Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    A com is tossed. If it shows a tail, we draw a ball from a box which contains 2 red and 3 black ... sample space for this experiment. Select the correct answer from above options...
asked Nov 15, 2021 in Education by JackTerrance
0 votes
    If a man with an X-linked dominant disease has six sons with a ***** having a normal complement of genes, ... , while one will not Select the correct answer from above options...
asked Nov 9, 2021 in Education by JackTerrance
0 votes
    State whether the following statements are true or false. Correct the false statements: 1. If the ... ,Science proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 7, 2021 in Education by JackTerrance
0 votes
    Why start and stop bits are used in serial assynchronus communication? Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    Given a sound clip of a person or people speaking, determine the textual representation of the speech. (a) Text-to- ... (d) None of the mentioned Please answer the above question....
asked Oct 9, 2022 in Education by JackTerrance
0 votes
    Given a sound clip of a person or people speaking, determine the textual representation of the speech. (a) Text-to- ... (d) None of the mentioned Please answer the above question....
asked Oct 2, 2022 in Education by JackTerrance
...