How do I authorize the GATT DB of a BLE Server to a specific BLE Client?
Do the following to define authorization:
- In the BLE server project, for the custom characteristic (which has write/read properties), make permission ‘Authorization Required’ as shown in Figure 1.
- In the server firmware, provide the authorization permission by checking the BLE Client address. The CyBle_GattsDbAuthorize API sets or clears the authorization permission for the GATT database.
- To grant permission, call CyBle_GattsDbAuthorize(1);.
- To decline permission, call CyBle_GattsDbAuthorize(0);.
Note that the API function will be effective only for the specific characteristics for which permission is set as ‘Authorization required’ in the BLE component setting.
Figure 1. BLE Server Characteristic Setting