Authorize BLE Server GATT DB to Specific BLE Clients - KBA219319

Version: **

 

Question:

How do I authorize the GATT DB of a BLE Server to a specific BLE Client?

 

Answer:

Do the following to define authorization:

 

  1. In the BLE server project, for the custom characteristic (which has write/read properties), make permission ‘Authorization Required’ as shown in Figure 1.
  2. 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

1.png