Run an SDP query on the device’s Service Discovery Database.
| C# | Visual Basic |
public ServiceRecord[] GetServiceRecords( Guid service )
Public Function GetServiceRecords ( _ service As Guid _ ) As ServiceRecord()
The parsed record as an
ServiceRecord.
For instance to see whether the device has an an Serial Port service search for UUID SerialPort, or too find all the services that use RFCOMM use RFCommProtocol, or all the services use L2CapProtocol.
If the device isn’t accessible a SocketException with ErrorCode 10108 (0x277C) occurs.
Dim bdi As BluetoothDeviceInfo = ... Dim records As ServiceRecord() = bdi.GetServiceRecords(BluetoothService.RFCommProtocol) ' Dump each to console For Each curRecord As ServiceRecord In records ServiceRecordUtilities.Dump(Console.Out, curRecord) Next
| Exception | Condition |
|---|---|
| SocketException |
The query failed.
|