Hello:
I have the same question with the below topic and do some experiments after reading the discussion:
Experiment1: set permission to (gPermissionFlagReadable_c)
if the mobile app connected, not pair, and not bond, the app can't read the char value.
if the mobile app connected, paired, and bonded, the app can read the char value.
Experiment2: set permission to (gPermissionFlagReadable_c | gPermissionFlagReadWithEncryption_c)
if the mobile app connected, not pair, and not bond, the app can't read the char value.
if the mobile app connected, paired, and bonded, the app can read the char value.
Experiment3: set permission to (gPermissionFlagReadable_c | gPermissionFlagReadWithAuthentication_c)
if the mobile app connected, not pair, and not bond, the app can't read the char value.
if the mobile app connected, paired, and bonded, the app can read the char value.
It seems not to differ between which permission flag that I set. What is the correct way to set the attribute read-only by authenticated peers.
Hi Wang,
If you want to implement this authentication, you should also change the security and mode level of each service.
Could you please provide more information about your final application?
Regards,
Mario
Hello @mario_castaneda
Have any further suggestions?
Hi @wang_barry,
Please look at the 4.1.3 Pairing and bonding in the Bluetooth® Low Energy Application Developer’s Guide. You will check that mode 1 and level 3 that set the authentication with encryption.
Regards,
Mario
Hi,
What is the security mode and level that you are defining in the service?
I am not sure the example that you are working on but a service could be defined as gSecurityMode_1_Level_3_c
/*!< Mode 1 Level 3 - Encryption with authentication. */
Regards,
Mario