It's my understanding that the application can register callbacks with the BLE Stack to receive notification related to the following events:
- Connection up/down
- End of Advertisement Interval
- Pairing completed
- Link encrypted
- Timer expiration
- Peer write notification (GATT)
- GPIO interrupts
- UART handler
What's different between notification and indication? Are they belonged kinds of events?
- Notifications are sent by the server to notify the client of new value (no confirmation)
- Indications are sent by the server to notify the client of new value (always uses a confirmation)
My understanding is that the the application can register callbacks with the BLE Stack to receive notifications related to the events noted above.
1 of 1 people found this helpful
In BTLE server declares what operations it wants to support. To send data from client to server, server can declare that it supports Write Request and Write Command. The first mandates client to wait for Write Response before starting the next operation. Write Command on the other hand does not require client to wait. To send data from the server to the client, server can declare that it support Indications or Notifications (or both). Client need to allow sending those using Characteristic Client Configuration (CCC) descriptor. If Client sets CCC to allow indications, server would be able to send one Indication and then it will need to wait for Indication Confirm before sending the new one. If Client sets CCC to allow notifications, the server can send any number of messages it wants without waiting for the confirmation.
So, if I declare CHARACTERISTIC_UUID128 (xxx, xxx, xxx, LEGATTDB_CHAR_PROP_NOTIFY, xxx, xxx), I also have to declare CHAR_DESCRIPTOR_UUIDxxx(....) for CCC descriptor, right?
Sounds right. Check hello_sensor sample in the SDK.