本文主要是介绍Bluetooth: gatt profile,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Gatt 主要是描述了attribute的排列方式;
Attribute caching
这个机制允许client只搜索一次server即可,当重连后不需要再搜索直接使用之前的。如果server的服务发生了变化,需要通过 service change indication 告诉client;
client也可通过读取 server端 data hash characteristic, 判断server的服务是否发生变化;
Robust Caching
client不知道server 的database已经发生了变化,在这种情况下,对server进行读写操作,
server可以通过回复 ATT_ERROR_RSP error_code(database_out_of_sync) 告诉client;
Profile Hierarchy
来自 Spec:
===> Service Defination
All include definitions and characteristic definitions contained within the service
definition are considered to be part of the service. All include definitions shall
immediately follow the service declaration and precede any characteristic definitions. A
service definition may have zero or more include definitions. All characteristic definitions shall be immediately following the last include definition or, in the event of no include definitions, immediately following the service declaration. A service definition may have zero or more characteristic definitions. There is no upper limit for include or
characteristic definitions.===> Characteristic defination
Each declaration above is contained in a separate Attribute. The two required
declarations are the characteristic declaration and the Characteristic Value declaration.
The Characteristic Value declaration shall exist immediately following the characteristic
declaration. Any optional characteristic descriptor declarations are placed after the
Characteristic Value declaration. The order of the optional characteristic descriptor
declarations is not significant.
这篇关于Bluetooth: gatt profile的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!