cancel
Showing results for 
Search instead for 
Did you mean: 

Send notification to only one of multiple connected devices

Ugilten
Associate III

Hi,

I am developing an application on the STM32WB10 where multiple smartphones can be connected at once (so far just two but that might change in the future). 
I can get the handles for each connection, but I also need to be able to send a notification to just one of the connected devices without that notification being received by the other device.

How do I do that?

I can send notifications, but they are always received by both smartphones which is rather unfortunate if the WB10 needs to send a secret or something similar :grimacing_face:

2 REPLIES 2
Issamos
Lead II

Hello @Ugilten 

I suggest you to connect, every time you want to send information, just to the device you want and than break the connection. 

Hope this is helpful. If your question is answered. Please mark it as best answer to be diffused. 

Best regards.

II

Ugilten
Associate III

Hi @Issamos ,

Unfortunately I think this is not the solution for me. I can't know if the mobile device is near by or not if I break the connection. Also I need to send notifications if the state of my application on the STM32WB10 changes (some other user might interact with the product physically).

So I need to find a way to notify a specific connection using the Handle I get when the mobile is connecting.

Right now I am using this function when I am sending a notification

tBleStatus aci_gatt_update_char_value( uint16_t Service_Handle,
                                       uint16_t Char_Handle,
                                       uint8_t Val_Offset,
                                       uint8_t Char_Value_Length,
                                       const uint8_t* Char_Value );

So I guess what I am asking, is there a way to add a ConnectionHandle to this or is there a function that does the same, but with a ConnectionHandle?