This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Unique Characteristics for each peripheral using Multiperipheral SD

I am developing an application in which my device will have multiple android phones connected to it. Currently I have it working with one peripheral and after having upgraded to SDK13, I am looking at adding more peripherals.

My device has a service which contains 6 characteristics, 3 of these I would like the value to be shared between all devices, and 3 need to have unique values for each connection.

Having the shared characteristics is no problem, and it works just as shown in the multiperipheral example but, how can I get the values of the other 3 to be unique to each connection?

EDIT 29/06/17

image description

Above is an image to try and show what I'd like to achieve. The two peripheral devices are connected to my relay device. The 2 smart phones are connected to my relay device as centrals and they discover the relay device has an active_device characteristic and an active_device_data characteristic.

Each smart phone is able to set and read their own unique value of active_device, which tells the Relay device which peripheral that smart phone wants the data for. So, Smart phone one has set active_device to 1, to get the device_data from Peripheral devce 1 forwarded to it via the active_device_data characteristic, and the same for Smart phone 2 and peripheral device 2.

Currently I have not figured out how to allow smart phone one and two to choose different active devices. If I write a one to active_device using smart phone 1, then do a read with smart phone 2, it reads active_device as 1. Is there a way I can have different values of active_device for each connection?

Related