KW36 Pairing&Bond with Link Encryption issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KW36 Pairing&Bond with Link Encryption issue

1,459 Views
zhi_wang
Contributor III

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:

pastedImage_1.png

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

pastedImage_3.png

others are never changed, the default security mode setting in project is mode 1 level 3. this should not be the problem.

pastedImage_5.png

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 

pastedImage_6.png

the original source code set the permission to lowest level, will not have this issue, please check this issue.

Thanks.

Ziv

Labels (5)
0 Kudos
6 Replies

1,183 Views
zhi_wang
Contributor III

Any comments?

0 Kudos

1,183 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

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

0 Kudos

1,183 Views
zhi_wang
Contributor III

Hi Mario,

any more details please feel free to let me know.

this issue is very critical to our new start project.

Regards,

Ziv

0 Kudos

1,183 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

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

0 Kudos

1,183 Views
zhi_wang
Contributor III

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

1,183 Views
zhi_wang
Contributor III

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

0 Kudos