本文介绍了创建\\编辑蓝牙SDP记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
不要任何人知道的任何(免费)工具,可以在蓝牙的SDP(服务发现)记录?创建\\编辑帮助
基于Windows的工具preferred。
解决方案
您可以用我的库。有此没有用户界面,但有库code能容易地被用于此目的。使用类ServiceRecordBuilder。在的。例如:
ServiceRecordBuilder BLDR =新ServiceRecordBuilder();
bldr.AddServiceClass(BluetoothService.SerialPort);
bldr.ServiceName =阿兰的SPP服务;
bldr.AddBluetoothProfileDescriptor(BluetoothService.AVRemoteControl,1,0);
bldr.AddCustomAttribute(新ServiceAttribute(在0x8001,
ServiceElement.CreateNumericalServiceElement(ElementType.UInt16,0xFEDC)));
//
ServiceRecord纪录= bldr.ServiceRecord;
//
VAR TXT = ServiceRecordUtilities.Dump(记录);
Console.WriteLine(TXT);
//
变种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:0100 - 服务名称
TextString:[英文]艾伦的SPP服务AttrId:在0x8001
UINT16:0xFEDC
数组:
<$p$p><$c$c>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-DCDo anybody know of any (free) tools that can aid in the creation\editing of Blue-Tooth's SDP (Service Discovery) records?
Windows based tools preferred.
解决方案
You can use my 32feet.NET library. There's no UI for this but there's library code which could be easily used for this. Use class ServiceRecordBuilder. Some docs at Creating Records. For example:
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);
Output is:
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
array:
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
这篇关于创建\\编辑蓝牙SDP记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!