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

cross mob
Anonymous
Not applicable

Hi

I'm adding new characteristic to WICED sense. My new UUID is correctly listed by a tool like lightblue.

It needs to support read & notify.

When i read the wiced sens source code, i saw this function :

blecm_connectionEventNotifiationEnable((void (*)(void*, UINT32))wiced_sense_tx_opportunity_notice, 0, 6250/625, 30000/625, wiced_sense_connection_handle);

i assume that NOTIFY is enabled in the GATT database declaration (with LEGATTDB_CHAR_PROP_READ | LEGATTDB_CHAR_PROP_NOTIFY). I've done it.

but how i can differenciate notification coming from UUID A and UUID B ?

my idea is to get access to UUID and change the PDU depending on the received UUID.

is there anybody who know how to deal with notification, especially when there is multiple UUID with read/notify possibility, please ?

thank you a lot

best regards

0 Likes
1 Solution

I agree that it is a bit confusing.  The blecm_connectionEventNotifiationEnable function does not actually send or enable GATT notifications.  The function allows your application to register a callback to be called a few millisecond before something can be send up to the client.  The handle in the blecm_con... function is not the attribute handle (which is related to UUID), but it is a connection handle identifying connection if you are connected to multiple devices. 

When your callback (for example wiced_sense_tx_opportunity_notice) is called, your application can send one or several GATT Notification.  When you are sending notifications you will need to use correct attribute handle in the bleprofile_sendnotification call.

Please note that you do not need precise timing, you do not need to use blecm_con.. function at all.  Please see hello_sensor sample which sends notification without all these headaches.

View solution in original post

0 Likes
4 Replies