0

I'm using Golang GATT package by PayPal and editing its example file explorer.go to connect multiple peripherals at a time. The issue I'm facing is if I try to connect two peripherals at a time , sometimes it connect to both and sometimes it connect to only one. However if I turn on both peripherals one by one, both are connected successfully.

Can you help where may be the issue ?

waqas
  • 81
  • 1
  • 1
  • 5
  • You need to give more context for an answer that is not too broad. It is most probably because you can't connect to two devices _at the exact same time_. You probably were turning both peripherals on _before_ your own software started scanning, right? You were correct when you said you could connect to both if you turned them on one by one, because then your software has time to set up the necessary l2cap socket and whatnot. – Zimano Dec 22 '15 at 08:21
  • Thanks , yes I turned both peripherals on before started scanning . So what is solution to this problem ? because peripherals should be always on and when I turn my central on , it should connect to all peripherals. – waqas Dec 22 '15 at 08:41
  • The solution would be to handle both connections one after another. And not at the same time. It is perfectly fine to have two devices connected as GATT clients though, it is just important to note that you can't connect to both at the same time! So connect to one, then connect to the other. Both will be connected. – Zimano Dec 22 '15 at 08:43

0 Answers0