首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >创建\编辑BlueTooth SDP记录

创建\编辑BlueTooth SDP记录
EN

Stack Overflow用户
提问于 2012-08-07 18:58:50
回答 2查看 3.8K关注 0票数 0

有人知道有什么(免费的)工具可以帮助创建/编辑Blue-Tooth的SDP (服务发现)记录吗?

最好使用基于Windows的工具。

EN

回答 2

Stack Overflow用户

发布于 2012-08-08 18:47:00

您可以使用我的32feet.NET库。这方面没有UI,但有一些库代码可以很容易地用于此目的。使用类ServiceRecordBuilder。Creating Records上的一些文档。例如:

代码语言:javascript
复制
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);

输出为:

代码语言:javascript
复制
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

数组:

代码语言:javascript
复制
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
票数 1
EN

Stack Overflow用户

发布于 2012-08-07 22:45:57

BlueZ是linux Bluetooth堆栈,它附带了用于与SDP一起工作的sdptool实用程序。这个页面有一些例子,http://alanjmcf.wordpress.com/2011/08/09/bluez-sdptool-usage-notes/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11844466

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档