Hi someone,
the problem is: while the Pairing and bonding are succeed, but if set the Char & Char value ACCESS level to gPermissionFlagReadWithEncryption_c or gPermissionFlagWriteWithEncryption_c , the mobile app cannot read or write successfully from/to these values.
my working environment:
IDE: MCUXpresso
SDK:
Demo project:
frdmkw36_wireless_examples_bluetooth_hid_device_freertos
code changes:
changed the security level to gPermissionFlagReadWithEncryption_c , should be security mode 1 level 2
others are never changed, the default security mode setting in project is mode 1 level 3. this should not be the problem.
the problem :
the NRF connect or lightblue can successfully Pairing and bond with the device, but cannot READ the value_battery_level. the error code is GATT READ NOT PERMIT
the original source code set the permission to lowest level, will not have this issue, please check this issue.
Thanks.
Ziv
Any comments?
Hi Ziv,
Just to confirm, are you trying to encrypt the battery service profile?
You don't wat the bonding process. am I right?
Is the KW36 requesting pin?
Could you please provide more details about your application?
Regards,
Mario
Hi Mario,
any more details please feel free to let me know.
this issue is very critical to our new start project.
Regards,
Ziv
Hi Ziv,
I am sorry for my late reply. I want to confirm how you need to define the permissions.
Please define the code like below.
VALUE(value_battery_level, gBleSig_BatteryLevel_d, (gPermissionFlagReadable_c|gPermissionFlagReadWithEncryption_c), 1, 0x5A)
Note: The Security Level should be equal as the permissions that you defined.
Regards,
Mario
Hi Mario,
thanks for you reply.
the permissions i wanted is only xxxWithEncryption, the link must be encrypted, as your code, if set both
gPermissionFlagReadable_c|gPermissionFlagReadWithEncryption_c
the lowest permission requirement will take activity.
My setting is listed above, just gPermissionFlagReadWithEncryption_c is what i need.
Regards,
Ziv
Hi Mario,
Glad to hearing from you.
i just take the battery service for an example. actually i have defined my private services.
i need the Pairing and bonding process, and the Characteristic value and description (0x2902 & 0x2901) are must encrypted.
from my testing, the pair and bond process are working as expected. if not bonded, the pin will request.
the issue happened only if i changed the ACCESS level of battery service.
from the log, the "gConnEvtEncryptionChanged_c" will be called and is successful.
it seems the Pairing , bonding and encryption are all ok. but the mobile app are not permitted to ACCESS the description and value.
you can take the HID Device as i did and have a try, the only changes from code is as i depicted above.
Regards,
Ziv