Introduction to the protocol of Bluetooth SDP analysis (i.)

Source: Internet
Author: User
Keywords: Bluetooth bluetooth® protocol SDP Anatomy SDP overview SDP notes


Author: Zhongjun


In the spirit of mutual learning purposes, to share this series of articles, welcome reprint, please specify the author, respect for copyright, thank you
Please correct me if the article is not in the wrong place, learn together


You can also access my csdn:http://blog.csdn.net/xiaoxiaopengbo/article/category/5998687 from the Bluetooth section.
--------------------------------------------------------------------------------------------------------------- ---------------------

Gorgeous split line, go to the chase

--------------------------------------------------------------------------------------------------------------- ---------------------


I. Overview the Service Discovery Protocol (SDP) provides a means for applications to
Discover which services is available andto determine the characteristics of
Those available services.
Based on the C/s structure, the service maintains the supported features through attribute records.
The property record is as shown in the figure:


two. Data Format

PDU ID

For each PDU introduction please see the next article: http://blog.csdn.net/xiaoxiaopengbo/article/details/51405733
three. Data meta- metadata a single data element represents a printed data. It consists of two segments: message header and data segment.
The message header section is made up of two parts: a type descriptor and a dimension descriptor. The data is a
Byte sequence whose length is defined in the dimension descriptor (see Data Dimension descriptor), meaning
Defined by type descriptor (partial)
Some PDU ID parameters are data elements

1. Data element type descriptor The metadata type is represented by a 5-bit long type descriptor. The header of the data element is contained in the data element header
The top 5 bits of the first byte. The following types have been defined.


2. The data element dimension descriptor Data element Dimension descriptor consists of a 32-bit size followed by a 0, 8, 16, or 3 bit
Index word representation. The dimension index Word is contained in the lowest bit of the first byte of the header of the data element. The size of the cable
The code is as follows


Example:


four. Continuation state It is used for a situation where a response is not enough to pass all the data back. This time need to transfer response multiple times, if one response enough,
The continuation state is 1 bytes = 0.
If you want to response multiple times, you need to re-request, take the new transaction ID and the previous Resposne continuation state, using the following procedure.
Situation one: Do not need continuation state
A--->b send the SDP request,transaction ID C
B--->a send the SDP respose,transaction ID c. Assuming that Resposne can return all data at once, the continuation state is 1 bytes = 0.
Situation Two: Need continuation state
A--->b send the SDP request,transaction ID C
B--->a send the SDP respose,transaction ID c. Assuming that Resposne is not enough to return all data at once, response carries continuation state M
A--->b send SDP request,transaction ID D (must be different from C), carry continuation State M
B--->a sends an SDP respose,transaction ID of D. Assuming this resposne is not enough to return all the data, response carries continuation state N
A--->b send SDP request,transaction ID E, carry continuation State N
B--->a send the SDP respose,transaction ID to E. Assuming that Resposne returns the last part of the data at one time, the continuation state is 1 bytes = 0.
The entire request-response process is over.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.