Skip to content

TypeError: callback is not a function in adapter.js during LE Connection Complete #22

@rsjeyakumar

Description

@rsjeyakumar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions