I have a Linux C application which requires making multiple connections to BLE devices. The application uses a library stripped from gatttool. The BLE devices have a very slow advertising rate, so it takes a long time for a to connect to be established. As a result I need to be able to make multiple gatt_connect requests at the same time.
gatt_connect uses the standard socket/connect to set up a L2CAP connection to the devices. Although this method allows you to have multiple active connections, it only allows you to be establishing one connection at a time. Using the HCI interface you can can be establishing multiple interface at the same time (i.e. hcitool lecc --whitelist), however I can't figure a way to get this to work with the gatttool library L2CAP socket/connect.
Can anyone suggest a way to integrate the gatttool L2CAP socket/connect with the hci interface (hci_open_dev/hci_le_create_conn) handles used by "hcitool lecc --whitelist", or an alernative method to establish multiple connections simultaneously?