Bluetooth基础知识

Posted DennisJu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Bluetooth基础知识相关的知识,希望对你有一定的参考价值。



前言

开发中经常遇到Bluetooth问题,所以这里索性就整理一下吧。



一、Bluetooth-BLE是什么?

  • 是一种无线通信技术
  • 是一种低功耗的无线通信技术
  • 是一种无线的、低功耗的、基于配置协议的无线通信技术



二、GATT 和 GAP是什么?



1.GATT

  1. GATT就是配置协议,全称Generic Attribute Profile,翻译过来就是通用属性配置文件
  2. GATT 定义了各种各样的属性,其中包含Services、Characteristics和Descriptors三种主要类型的属性(这里的三个类型的顺序也是属性表从上而下的顺序),每个属性可以通过UUID唯一标识,UUID标准长度是16bit特殊定制的也会有128bit的。
  3. 这里之所以提到android因为在Android里的蓝牙开发就是遵循GATT协议的,下面我们会进一步分析Android里的Bluetooth
  4. Service必须包含一个或多个Characteristics,Characteristics包含Descriptors,Descriptors是可选的,Service通常代表设备特性,Characteristics是将这些特性细分通过惟一的UUID标识,定义了自身的读写及变化通知权限,供其他设备访问编辑, Descriptors含有元数据是对Characteristics的补充
  5. GATT的结构模式是C/S模式,一般操控端是C,设备端是S



2.GAP

   GAP 全程Generic Access Profile顾名思义是一种协议,一种定义了设备间如何发现并连接通信的协议



总结

  小小的身躯,蕴含着丰富的知识。

参考引用

A Developer’s Guide To Bluetooth | Bluetooth® Technology WebsiteBluetooth® technology is the wireless communications technology for developers which allows devices to communicate with each other without the need for a…https://www.bluetooth.com/blog/a-developers-guide-to-bluetooth/

以上是关于Bluetooth基础知识的主要内容,如果未能解决你的问题,请参考以下文章

Bluetooth基础知识

Bluetooth基础知识

深入了解Android蓝牙Bluetooth ——《总结篇》

蓝牙Bluetooth技术小知识

iOS_SN_BlueTooth iOS 连接外设的代码实现

Bluetooth 报文知识点