OK, the false parameter (or nothing) in startBonding should not do it again so it could be faster second time as per http://www.espruino.com/Reference#l_BluetoothRemoteGATTServer_startBonding
so keep it in if it doesn't work without it. console.log should be fast, there is also print which should be the same.
You can also log time in each step (console.log(Date().toISOString(),....), maybe the service and chacteristics discovery takes most of the time, not the startBonding step (except first time)?
EDIT:
Also one random idea, maybe the startBonding can be done later so the service/characteristics discovery runs without encryption, maybe it can be faster that way(?)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
OK, the
false
parameter (or nothing) in startBonding should not do it again so it could be faster second time as per http://www.espruino.com/Reference#l_BluetoothRemoteGATTServer_startBondingso keep it in if it doesn't work without it.
console.log
should be fast, there is alsoprint
which should be the same.You can also log time in each step (
console.log(Date().toISOString(),....)
, maybe the service and chacteristics discovery takes most of the time, not the startBonding step (except first time)?EDIT:
Also one random idea, maybe the startBonding can be done later so the service/characteristics discovery runs without encryption, maybe it can be faster that way(?)