dict ManufacturerData //产商自定义的数据, 需要掌握dict的使用
array{string} ServiceUUIDs // 将Service UUIDs提前通过广播包进行广播
The Advertising Manager allows external applications to register Advertisement Data which should be broadcast to devices. Advertisement Data elements must follow the API for LE Advertisement Data described above.
Service org.bluez
Interface org.bluez.LEAdvertisingManager1
Object path /org/bluez/{hci0,hci1,…}
主要是提供了Methods RegisterAdvertisement进行广播包的注册
bluez下文档学习 - adapter-api.txt
BlueZ D-Bus Adapter API description
Service org.bluez
Interface org.bluez.Adapter1
Object path [variable prefix]/{hci0,hci1,…}
Methods void StartDiscovery() // 从Methods来看, Adapter是对本设备的操作,和device是不同的,device主要是连接上的设备(Remote device)
Bluez下文档学习 - device-api.txt
Device hierarchy 主要是对设备的操作, Methods: Connect、Disconnect、Pair等, Properties部分主要是存储连接上的设备相关属性以及对远程设备属性的改写.
Bluez下文档学习 - gatt-api.txt(重点)
BlueZ D-Bus GATT API description
GATT local and remote services share the same high-level D-Bus API. Local refers to GATT based service exported by a BlueZ plugin or an external application. Remote refers to GATT services exported by the peer.
BlueZ acts as a proxy, translating ATT operations to D-Bus method calls and Properties (or the opposite). Support for D-Bus Object Manager is mandatory for external services to allow seamless GATT declarations (Service, Characteristic and Descriptors) discovery. Each GATT service tree is required to export a D-Bus Object Manager at its root that is solely responsible for the objects that belong to that service.
Releasing a registered GATT service is not defined yet. Any API extension
should avoid breaking the defined API, and if possible keep an unified GATT remote and local services representation.
以上3段话,最有价值的是标红的内容.
Each GATT service tree is required to export a D-Bus Object Manager at its root that is solely responsible for the objects that belong to that service.
也就是对用Bluez提供的示例代码example-gatt-server 中