zoukankan      html  css  js  c++  java
  • bluez协议栈图解

     

     


    Bluetooth protocol stack

    "Bluetooth is defined as a layer protocol architecture consisting of core protocols, cable replacement protocols, telephony control protocols, and adopted protocols."[37] Mandatory protocols for all Bluetooth stacks are: LMP, L2CAP and SDP. Additionally, these protocols are almost universally supported: HCI and RFCOMM.

    [edit] LMP (Link Management Protocol)

    Used for control of the radio link between two devices. Implemented on the controller.


    L2CAP (Logical Link Control & Adaptation Protocol)

    Used to multiplex multiple logical connections between two devices using different higher level protocols. Provides segmentation and reassembly of on-air packets.

    In Basic mode, L2CAP provides packets with a payload configurable up to 64kB, with 672 bytes as the default MTU, and 48 bytes as the minimum mandatory supported MTU.

    In Retransmission & Flow Control modes, L2CAP can be configured for reliable or isochronous data per channel by performing retransmissions and CRC checks.

    Bluetooth Core Specification Addendum 1 adds two additional L2CAP modes to the core specification. These modes effectively deprecate original Retransmission and Flow Control modes:

    • Enhanced Retransmission Mode (ERTM): This mode is an improved version of the original retransmission mode. This mode provides a reliable L2CAP channel.
    • Streaming Mode (SM): This is a very simple mode, with no retransmission or flow control. This mode provides an unreliable L2CAP channel.

    Reliability in any of these modes is optionally and/or additionally guaranteed by the lower layer Bluetooth BDR/EDR air interface by configuring the number of retransmissions and flush timeout (time after which the radio will flush packets). In-order sequencing is guaranteed by the lower layer.

    Only L2CAP channels configured in ERTM or SM may be operated over AMP logical links.

    SDP (Service Discovery Protocol)

    Service Discovery Protocol (SDP) allows a device to discover services supported by other devices, and their associated parameters. For example, when connecting a mobile phone to a Bluetooth headset, SDP will be used for determining which Bluetooth profiles are supported by the headset (Headset Profile, Hands Free Profile, Advanced Audio Distribution Profile (A2DP) etc.) and the protocol multiplexer settings needed to connect to each of them. Each service is identified by a Universally Unique Identifier (UUID), with official services (Bluetooth profiles) assigned a short form UUID (16 bits rather than the full 128)

    HCI (Host/Controller Interface)

    Standardised communication between the host stack (e.g., a PC or mobile phone OS) and the controller (the Bluetooth IC). This standard allows the host stack or controller IC to be swapped with minimal adaptation.

    There are several HCI transport layer standards, each using a different hardware interface to transfer the same command, event and data packets. The most commonly used are USB (in PCs) and UART (in mobile phones and PDAs).

    In Bluetooth devices with simple functionality (e.g., headsets) the host stack and controller can be implemented on the same microprocessor. In this case the HCI is optional, although often implemented as an internal software interface.

    RFCOMM (Serial Port Emulation)

    Radio frequency communications (RFCOMM) is a cable replacement protocol used to create a virtual serial data stream. RFCOMM provides for binary data transport and emulates EIA-232 (formerly RS-232) control signals over the Bluetooth baseband layer.

    RFCOMM provides a simple reliable data stream to the user, similar to TCP. It is used directly by many telephony related profiles as a carrier for AT commands, as well as being a transport layer for OBEX over Bluetooth.

    Many Bluetooth applications use RFCOMM because of its widespread support and publicly available API on most operating systems. Additionally, applications that used a serial port to communicate can be quickly ported to use RFCOMM.


  • 相关阅读:
    error和exception有什么区别?
    运行时异常与一般异常有何异同?
    由c++循环中局部变量地址不变而引发的思考
    Navicat连接Mysql数据库报错,但是命令行可以连接上
    git reset --hard HEAD^后显示more?的解决方案
    java基础易错、难理解、易混淆知识点复习
    More than one file was found with OS independent path 'assets/ap1.data'
    UML类图中方法(操作)的表示格式
    正则匹配以xx开头以xx结尾的单词
    运行PL/SQL时只输出anonymous block completed
  • 原文地址:https://www.cnblogs.com/yuzaipiaofei/p/4124371.html
Copyright © 2011-2022 走看看