Multiple BLE Connections using Linux and Bluez 5.0

前端 未结 2 1338
粉色の甜心
粉色の甜心 2021-02-04 19:05

I am currently attempting to connect to multiple BLE devices using BlueZ 5.0 and Linux. I have one host BLE adapter and I have modified the gatttool to connect and perform this

2条回答
  •  逝去的感伤
    2021-02-04 19:54

    WE have combined the code from hcitool and gatttool. The code works well for 2 device (scan, hci_le_create_conn and gatt_connect). I believe there is no limitation on the number of devices used.

    1 Start cmd_lescan (from hcitool.c)
    2.For each device scanned - 
          cmd_lecc (from hcitool.c)
          gatt_connect (from gatttool.c)
    

    This way one process can manage multiple BLE device. We do not have to turn OFF the scanning, just have ignore non advertisement messages:

            if (meta->subevent != 0x02)
                    continue; 
    

    Thanks and looking forward to comments.

提交回复
热议问题