Password Control of Available Characteristics

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am trying to implement password control (via smartphone) of my BLE application.  I have a write-only password characteristic and several other custom characteristics.

Initially the characteristics are disabled (except the password characteristic) via:

CyBle_GattsDisableAttribute(xxxx_HANDLE);

Once the correct password is received I enable the other characteristics via:

CyBle_GattsEnableAttribute(xxxx_HANDLE);

Using CySmart I cannot see the newly enabled characteristics appear, either using "discover all attributes" or "read all characteristics".  Can I assume they are enabled and usable at this point?  Is this a valid way to approach this?

Thanks

Rich

0 Likes
7 Replies
Anonymous
Not applicable

Rich,

Yes, after the characteristic is enabled, you can assume it to be usable. Check the return value of the API to ensure that the attribute was indeed enabled.

In CySmart, if you "Discover All Attributes" after the attributes are enabled, then you should be able to see the new characteristics. I tested this with a simple project and it worked fine.

Anonymous
Not applicable

As yssu​ said, make sure to check the return code to see if there was an error. Most likely you are having trouble with the enable/disable function returning an error.

0 Likes
Anonymous
Not applicable

Thank you for the help.  After enabling the characteristic "Discover All Attributes" does not show them.  If, after enabling them,  I write to the characteristic using CyBle_GattsWriteAttributeValue and then use "Discover All Attributes" they show up.

Does this make sense?

Thanks

Rich

0 Likes
Anonymous
Not applicable

Does it do the same behavior for the disabling of the attribute as well?

Does reading the attribute after enabling/disabling it cause the same effect?

I can't find much useful documentation on the enable/disable attribute functions...

0 Likes
Anonymous
Not applicable

I will have to experiment with the disabling...

I have been fighting what I think is a Cypress bug.  I have been changing the characteristics in my custom service and at some point, disabling the characteristics as I was, I was no longer to connect to the peripheral!

If I did not disable it connected fine.

After a lot of debugging I found that if you disable the last characteristic in the list (In the GUI) you cannot connect.  Replacing the last characteristic in the list with one that I am not disabling fixed it.

Cypress, care to verify?

Rich

0 Likes
Anonymous
Not applicable

Are you sure you are using the latest version of BLE component, i.e v3.30? I have tested these APIs and not found any issue.

Would it possible for you to share your project so that we can test? Might be some corner case which we might have missed or an incorrect implementation.

0 Likes
Anonymous
Not applicable

Are you a Cypress employee?  I would need a direct Cypress email and would have to verify that a non-disclosure is in place.

Rich

0 Likes