connect to multiple wiced sense

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

cross mob
Anonymous
Not applicable

Has anyone tried connecting multiple wiced senses to one Android device?  Comments in the Android app source code (see SensorManager.java)  include:

"Currently, this application only manages one WICED Sense device at a time. But this can be expanded to support more than one device connection"

What would be involved in this expansion? Anybody have any advice on how I would get started adapting the Android code for multiple devices?


Thanks,

Reynald

0 Likes
1 Solution
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

Note that every WICED Sense device ships with the same BD_ADDR, which may cause a group of WICED Sense devices to appear as a single device to your application.

View solution in original post

0 Likes
6 Replies
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

Note that every WICED Sense device ships with the same BD_ADDR, which may cause a group of WICED Sense devices to appear as a single device to your application.

0 Likes
Anonymous
Not applicable

Hello Reynald,

Here is a good starting point:

WICED SENSE Kit BLOG

WICED Sense Android Source (v1.08)

Video Link : 1266

Thanks

JT

0 Likes
Anonymous
Not applicable

Thanks j.t.  By changing the BD_ADDR of each wiced sense, and adapting the Android Application code, we can now connect to multiple WICED Senses. 

0 Likes
Anonymous
Not applicable

Great News!

JT

0 Likes
Anonymous
Not applicable

Hi reynald

I am trying to accomplish the same task of connecting multiple WICED sense tags onto one Android phone. One of our developers is looking into changing the BD_ADDR for the tags, but...

What did you change in the Android source code to allow multiple connections?

Thanks a lot!

0 Likes
Anonymous
Not applicable

The first thing we did was check for the UUIDs of each of the devices in GattRequestManager,

onCharacteristicChanged(BluetoothGatt gatt,

                                   BluetoothGattCharacteristic characteristic) {

if(SENSOR_NOTIFICATION_UUID.equals(characteristic.getUuid())){

   byte[] value = characteristic.getValue();

and then check against each of the UUIDs of the wiceds

if (gatt.getDevice().equals(device )

where device is your array of  BluetoothDevice

Then, it gets kind of complicated. The callback / message scheme in the Android code wasn’t written for multiple wiceds, so you either have to change it all, or like, we did, bypass it all and call processSensorData directly.

Sorry if the above code is kind of jumbled — I’m trying to take extract meaningful parts out of a codebase that has really changed from the original Android code sample.

Reynald

0 Likes