概述
1.概念

每一个ServiceAttribute的结构由下图所示:



Size的定义如下图:


4.Service Class


PUD ID有如下几种定义:

Transaction ID和Length定义如下:



ServiceSearchPattern由UUID组成,每个UUID由data lement组成。 MaximumServiceRecordCount用来指定返回的Service Records Handles的最大个数,由于该参数为2字节,所以其取值区间就是0x0001~0xffff。由于一个ServiceSearchPattern相匹配的Service Records Handles可能有多个,所以指定该参数非常的有必要。

TotalServiceRecordCount用来表示匹配的Service Record个数,最大为65535(而且不能够大于MaximumServiceRecordCount),如果没有配置的Service Record,则其值为0。
CurrentServiceRecordCount用来表示当前PDU中返回的Service Record Handle的个数。
ServiceRecordHandleList包含了当前PDU中返回的所有Service Record 的Handles,每一个Handle用一个32bit的数据来表示,所以该参数的长度就是4×CurrentServiceRecordCount字节。

ServiceREcordHandle是通过SDP_ServiceSearchResponse获取到的特定的Service的Service Record Handle。
参数MaximumAttributeByCount用来指定返回Attribute Value的最大总长度,以字节为单位。
第三个参数AttributeIDList用来指定一组AttributeIDList,可以是几个AttributeID,以可以是一个ID Range,如果是前者,则长度为16位,如果为后者,则长度为32位。
(5) SDP_ServiceAttributeResponse PDU
AttributeListByteCount用来表示Package中包含的数据的总长度,该值应该是小于SDP_ServiceSearchRequest中的MaxmumAttributeByteCount的一个值。
第二个参数AttributeLists是Service Record Attribute 的列表项,每一项包含了Attribute ID和Attribute Value两部分。
(6)SDP_ServiceSearchAttributeRequest PDU
ServiceSearchPattern和SDP_ServiceSearchRequest中完全一样。
第二个参数MaxmumAttributeByteCount用来指定返回Attribute Value的最大总长度,以字节为单位。
第三个参数AttributeIDList用来指定一组AttributeIDList,可以是几个AttributeID,以可以是一个ID Range,如果是前者,则长度为16位,如果为后者,则长度为32位。
(7)SDP_ServiceSearchAttributeResponse PDU
AttributeListByteCount用来表示Package中包含的数据的总长度,该值应该是小于SDP_ServiceSearchRequest中的MaxmumAttributeByteCount的一个值。
第二个参数AttributeLists是Service Record Attribute 的列表项,每一项包含了Attribute ID和Attribute Value两部分。
8.一些Attributes
两种attribute每个service record都有:1.ServiceRecordHandle (attribute ID 0x00002).ServiceClassIDList (attribute ID 0x00001)
(1)ServiceRecordHandle Attribute
(2)ServiceClassIDList Attribute
(3)ServiceRecordState Attribute
(4)ServiceID Attribute
其余很多Attribute参考SPEC。
最后
以上就是小巧鸡为你收集整理的蓝牙的SDP协议总结的全部内容,希望文章能够帮你解决蓝牙的SDP协议总结所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复