COM'un standart bir COM olup olmadığını veya COM aygıtının kablo değiştirme bluetooth adaptörü olarak da bilinen bir SPP COM mu olduğunu belirlemek için bir yol arıyorum.Seri bağlantı noktasının normal olup olmadığını belirleme COM veya SPP
Hem USB (COM -> USB) hem de Bluetooth'ta çalışan bir Bluetooth aygıtım var ve Bluetooth arabirimi SPP ile çalışıyor.
Şu anda COM'ları almak için System.IO.Ports.SerialPort.GetPortNames()
kullanıyorum.
Bluetooth veya USB ile bağlı olup olmadığını belirlemenin bir yolu var mı?
ÇÖZÜM: Benzer
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()));
}
}
Ve çıkışı şey:
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
http://stackoverflow.com/questions/2085179/ benim cevaplarını göster Nasıl-can-ı-bulmak-out-a-com-port-numarası-of-a-bluetooth aygıtı-c/2096728 # 2096728 ve http://stackoverflow.com/questions/6850965/how-come- getdefaultcommconfig-çalışma-ile-bluetooth-spp-cihazlar/6997320 # 6997320 – alanjmcf