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 PDUServiceSearchPattern和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
本文轉自:http://blog.sina.com.cn/s/blog_69b5d2a50101egbb.html