-
-
Notifications
You must be signed in to change notification settings - Fork 209
Bluetooth SDP
The library contains support for creating, parsing, and dumping SDP records. This will generally be used in advanced scenarios only. For instance BluetoothListener by default creates a basic record based on the Service Class Id passed in.
To retrieve and dump the records containing a given UUID on a particular device one can use code like the following.
Guid uuid = ...
BluetoothDeviceInfo device = ...
ServiceRecord[]() records = device.GetServiceRecords(uuid);
foreach(ServiceRecord curRecord in records) {
ServiceRecordUtilities.Dump(curRecord, Console.Out);
}
For instance to see whether the device has an an Serial Port service, do a search for UUID BluetoothService.SerialPort, for OBEX Push use BluetoothService.ObexObjectPush, or too find all the services that use RFCOMM use BluetoothService.RFCommProtocol, or to find all the services, use BluetoothService.L2CapProtocol.
It is now possible to export a ServiceRecord into the XML format used by the BlueZ Bluetooth stack. Use the ServiceRecordXmlCreator class for this. The format is documented with this DTD and in the BlueZ source code.
32feet.NET - Personal Area Networking for .NET
In The Hand Ltd