bluez--core Layer + application layer

Source: Internet
Author: User

BlueZ

1.Kernel Layer Implementation:

The Bluetooth protocol stack has a multilayer structure, and the lowest hardware protocol is implemented in hardware. Implementation of software-level protocols, starting with the HCI layer. BlueZ to the implementation of each layer of the Protocol is based on the socket. BlueZ first creates the protocol--pf_bluetooth (AF_BLUETOOTH=31) in a new socket. (In other words, the first parameter of the Socket (): Domain must be: pf_bluetooth). This also means that the address type needs to be defined using Bluetooth. In fact, it is simple to add Pf_bluetooth to the Net_families (Network protocol list). If you have a knowledge of Linux kernel, you know that this registration action must be done in the Bluetooth init section. Similarly, each protocol layer (for example, Hci,l2cap,hid, etc.) adds its own code of conduct to the Pf_bluetooth protocol.

2. Application Layer Implementation:

Although the kernel layer has fully implemented the Bluetooth protocol stack, it is very inconvenient if it is to be used. After all, the most convenient communication channel for applications and kernel is the IOCTL (). This is very not intuitive. As a result, BlueZ provides a set of APIs that help developers easily interact with the kernel layer protocol. Of course, the underlying implementation of these APIs is Ioctl.bluez time, which is basically the case.

bluez--core Layer + application layer

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.