Skip to content
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

BlueGigaClient.connect() could be more versatile #25

Open
eblot opened this issue Oct 24, 2016 · 1 comment
Open

BlueGigaClient.connect() could be more versatile #25

eblot opened this issue Oct 24, 2016 · 1 comment

Comments

@eblot
Copy link

eblot commented Oct 24, 2016

It would be nice not to enforce a BLEScanResponse instance to connect to a remote device.

A duck typed tuple such as

ScanResp = namedtuple('ScanResp', 'sender, address_type')

used as

bgmac = bytes(reversed(unhexlify(macaddr.replace(':', '')))
bgc.connect(ScanResp(bgmac, gap_address_type['gap_address_type_public']))

can be used when no scan has been performed.
It could be useful to allow connection without a former scan.

There is one left exception error message to modify:

raise BlueGigaModuleException("Connection attempt unsuccessful! (%s)" % target.get_sender_address())

with

raise BlueGigaModuleException("Connection attempt unsuccessful! (%s)" % target.sender)
@netom
Copy link

netom commented Nov 7, 2018

...or just allow to connect with any BLE address.

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

No branches or pull requests

2 participants