When using ble-host with hci-socket in a Node.js REST API (Express), we intermittently get:
TypeError: callback is not a function
at handleLeConnectionComplete (.../node_modules/ble-host/lib/internal/adapter.js:939:4)
at HciSocket.onData (.../node_modules/ble-host/lib/internal/adapter.js:1186:40)
at HciSocket.emit (events.js:203:15)
at HciSocket.socket.bind.data (.../node_modules/hci-socket/lib/hci-socket.js:105:9)
This happens right after invoking BleManager.connect(...). It seems to occur when a previous connection attempt was canceled/overlapped and the HCI “LE Connection Complete” event later arrives with no registered callback in the adapter.