Skip to content

extmod/bluetooth: Add BLE().gap_pair(conn_handle, bond, mitm, lesc) function #6447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

andrewleech
Copy link
Contributor

@andrewleech andrewleech commented Sep 15, 2020

Adds python function to trigger a pairing/bonding operation with the current peer.
For use with:

TODO: docs

@Walkline80
Copy link

I have been tested the codes both on Windows 10 and iOS, but I'm failed twice, here's my test code snippet

def __irq(self, event, data):
    if event == IRQ_CENTRAL_CONNECT:
        self.__conn_handle, _, addr = data
        self.__ble.gap_advertise(None)

        print("start pairing...")
        self.__ble.gap_pair(self.__conn_handle, bond=True, mitm=True, lesc=True)

On Windows, it will thrown OSError: ENOENT, and Bluetooth Control Panel show "driver error" to me.

On iOS, it will display the pairing dialog and complete the pairing operation correctly, but I cannot send keycode to the iOS text input area.

I want to know how to testing this commit in a right way, thanks~

@andrewleech
Copy link
Contributor Author

Hi @Walkline80 this pr only adds the command to trigger pairing on the connected device, it doesn't include all the infrastructure to handle the pairing process; that's what the other two pr's linked in the top post are for.

They are still very much a work in progress however.

There's a lot of ongoing effort from myself and a couple of others to finish building a consistent pairing system that works on both stacks and most/all platforms. With our current schedule I hope to have basic pairing support finished within a couple of weeks.

@Walkline80
Copy link

@andrewleech thanks for your working, I also waiting for this for a long time, so, thanks again.

As far as I know, only iOS is a passive pairing system, which can be called by the development board to start pairing progress, but other systems such as Windows will actively initiate pairing, so I think there should be an irq callback to receive the pairing request from the central role, and then turn on passive pairing mode, is that true?

@andrewleech
Copy link
Contributor Author

Superseded by #6651

@andrewleech andrewleech closed this Dec 4, 2020
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy