Hi everybody,
I'm playing around with the pca10056 board from Nordic.
I get the Scanner and advertising examples running.
But i can not find some example code that show how to connect to a peripherial device and write to a characteristic.
Is this not implemented yet or I just did not search long enough?
Regards,
Bugs
ubluepy central example
Re: ubluepy central example
Hi,
I don't see any sample code that does this, but reading ubluepy_peripheral.c seems to suggest this is possible with:
I don't see any sample code that does this, but reading ubluepy_peripheral.c seems to suggest this is possible with:
Code: Select all
p = Peripheral()
p.connect('aa:bb:cc:dd:ee:ff')
services = p.getServices()
c = service.getCharacteristic()
# or: chrs = service.getCharacteristics()
c.read() / c.write()
Re: ubluepy central example
Assuming you are looking for an example with a Central GATT client and Peripheral GATT server, you are very close.
If you look in ports/nrf/examples/powerup.py there is a full example of a remote control for the PowerUp3.0 acting as a Central GATT client.
In case you require bonding in Central, the PR https://github.com/micropython/micropython/pull/4083 might of interest, and Characteristic Descriptors in https://github.com/micropython/micropython/pull/4082.
If you look in ports/nrf/examples/powerup.py there is a full example of a remote control for the PowerUp3.0 acting as a Central GATT client.
In case you require bonding in Central, the PR https://github.com/micropython/micropython/pull/4083 might of interest, and Characteristic Descriptors in https://github.com/micropython/micropython/pull/4082.