Skip to content

How do I connect to another bluetooth adapter (ie, hci1 instead of hci0)? #117

Open

Description

@DurvalMenezes

Per title. Sorry if this is a stupid question, but I haven't been able to figure it out from either the code or the documentation.
TIA!

Activity

  1. kerneis-anssi commented on Jun 19, 2025

    @kerneis-anssi

    I don't think the API supports it currently. If I read the code correctly, you'd need to set dev.id to the index of the bluetooth device here:

    dev, err := hci.NewHCI(opts...)

    It's unclear to me if the index of bluetooth devices is deterministic, and how to figure it out. go-ble picks the first one it finds:

    func NewSocket(id int) (*Socket, error) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions