Connect multiple devices to one device via Bluetooth

前端 未结 7 641
夕颜
夕颜 2021-01-30 11:27

I would like to create a game, where you must connect multiple devices (4+) to a main device (ex. a tablet) via Bluetooth. There would be two apps, a main one to which all data

7条回答
  •  遥遥无期
    2021-01-30 11:37

    Yes, that is possible. At its lowest level Bluetooth allows you to connect up to 7 devices to one master device. I have done this and it has worked well for me, but only on other platforms (linux) where I had lots of manual control - I've never tried that on Android and there are some possible complications so you will need to do some testing to be certain.

    One of the issues is that you need the tablet to the master and Android doesn't give you any explicit control of this. It is likely that this won't be a problem because * the tablet will automatically become the master when you try to connect a second device to it, or * you will be able to control the master/slave roles by how you setup your socket connection

    I will caution though that most apps using Bluetooth on mobile are not attempting many simultaneous connections and Bluetooth can be a bit fragile, e.g. what if two devices already have a Bluetooth connection for some other app - how might that affect the roles?

提交回复
热议问题