创建\编辑蓝牙SDP记录

问题描述:

是否有人知道任何有助于蓝牙SDP(服务发现)记录的创建/编辑的(免费)工具?创建编辑蓝牙SDP记录

首选基于Windows的工具。

BlueZ是linux的蓝牙协议栈,它配备了sdptool工具来处理SDP。本页有一些示例,http://alanjmcf.wordpress.com/2011/08/09/bluez-sdptool-usage-notes/

+0

任何用于Windows? – Anonymouse 2012-08-07 16:15:27

您可以使用我的32feet.NET库。这里没有用户界面,但有一个库代码可以很容易地用于这个。使用类ServiceRecordBuilder。有些文档在Creating Records。例如:

ServiceRecordBuilder bldr = new ServiceRecordBuilder(); 
bldr.AddServiceClass(BluetoothService.SerialPort); 
bldr.ServiceName = "Alan's SPP service"; 
bldr.AddBluetoothProfileDescriptor(BluetoothService.AVRemoteControl, 1, 0); 
bldr.AddCustomAttribute(new ServiceAttribute(0x8001, 
    ServiceElement.CreateNumericalServiceElement(ElementType.UInt16, 0xFEDC))); 
// 
ServiceRecord record = bldr.ServiceRecord; 
// 
var txt = ServiceRecordUtilities.Dump(record); 
Console.WriteLine(txt); 
// 
var byteArr = record.ToByteArray(); 
var txtBA = BitConverter.ToString(byteArr); 
Console.WriteLine(txtBA); 

输出是:

ElementSequence 
    ElementSequence 
     Uuid16: 0x100 -- L2CapProtocol 
    ElementSequence 
     Uuid16: 0x3 -- RFCommProtocol 
     UInt8: 0x0 
((L2Cap), (Rfcomm, ChannelNumber=0)) 

AttrId: 0x0006 -- LanguageBaseAttributeIdList 
ElementSequence 
    UInt16: 0x656E 
    UInt16: 0x6A 
    UInt16: 0x100 

AttrId: 0x0009 -- BluetoothProfileDescriptorList 
ElementSequence 
    ElementSequence 
     Uuid16: 0x110E -- AVRemoteControl 
     UInt16: 0x100 

AttrId: 0x0100 -- ServiceName 
TextString: [en] 'Alan's SPP service' 

AttrId: 0x8001 
UInt16: 0xFEDC 

阵列:

35-51-09-00-01-35-03-19-11-01-09-00-04-35-0C-35-03-19-01-00-35-05-19-00-03-08-00-09-00-06-35-09-09-65-6E-09-00-6A-09-01-00-09-00-09-35-08-35-06-19-11-0E-09-01-00-09-01-00-25-12-41-6C-61-6E-27-73-20-53-50-50-20-73-65-72-76-69-63-65-09-80-01-09-FE-DC