summaryrefslogtreecommitdiff
path: root/ports/nrf/common-hal/_bleio
AgeCommit message (Collapse)Author
2020-05-19nrf: _bleio: clean up timeout calculationSean Cross
The timeout value is calculated by the common-hal layer now, so we don't need to be quite so clever about calculating it here. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-19bleio: adapter: add advertising timeout and statusSean Cross
Add a field to allow specifying a timeout when initiating advertising. As part of this, add a new property to determine if the device is still advertising. Additionally, have the `anonymous` property require a timeout, and set the timeout to the maximum possible value if no timeout is specified. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-19_bleio: support anonymous advertisingSean Cross
Add a new parameter to the `start_advertising()` function to enable anonymous advertising. This forces a call to `sd_ble_gap_privacy_set()` with `privacy_mode` set to `BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY` and `private_addr_type` set to `BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE`. With this, addresses will cycle at a predefined rate (currently once every 15 minutes). Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-04address review commentsDan Halbert
2020-05-04make translate againDan Halbert
2020-05-04add PacketBuffer .incoming_ and .outgoing_packet_lengthDan Halbert
2020-04-29further cleanup and bug fixingDan Halbert
2020-04-29back to '.packet_size' for compatiblityDan Halbert
2020-04-29rename and improve PacketBuffer packet length propertyDan Halbert
2020-04-27Merge remote-tracking branch 'adafruit/master' into lower_powerScott Shawcroft
2020-04-21ringbuf testedDan Halbert
2020-04-21merge from adafruitDan Halbert
2020-04-21further ringbuf cleanupDan Halbert
2020-04-21nrf: bleio: parameterize softradio configurationSean Cross
Allow for setting various softradio memory settings as part of a board in order to support lower-memory configurations. If a parameter is unspecified then the previously-defined value is used. Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-31Merge remote-tracking branch 'adafruit/master' into lower_powerScott Shawcroft
2020-03-25Add exception on small buffer and fix Connecion WRITE handlingScott Shawcroft
2020-03-25Fix connection handle tracking in PacketBuffer when a server.Scott Shawcroft
2020-03-13First try at lowering the power consumptionScott Shawcroft
2020-02-24Fix crash after empty REPL sessionScott Shawcroft
We were trying to reset bluetooth when it was off and then trying to raise an exception without the heap.
2020-02-05Add another error message for extended advertisements at the sameScott Shawcroft
time as scan response. The SD can't do it.
2020-01-31increase max connections from 2 to 5Dan Halbert
2020-01-30track vm_used_ble betterDan Halbert
2020-01-14address review commentsDan Halbert
2020-01-13fix some typos and leftoversDan Halbert
2020-01-13merge from adafruit/circuitpythonDan Halbert
2020-01-13put bonding to-do flags into Connection objects instead of using a ↵Dan Halbert
heap-allocated queue
2020-01-12fix CCCD bonding store; avoid excessive bonding writesDan Halbert
2020-01-10wip: HID bonding works!Dan Halbert
2020-01-09wip; redid flash writing to be compatible with SDDan Halbert
2020-01-08Replace magic number and add comment.Scott Shawcroft
2020-01-05wip; compilesDan Halbert
2020-01-03Add PacketBuffer and MTU negotiation support.Scott Shawcroft
PacketBuffer facilitates packet oriented BLE protocols such as BLE MIDI and the Apple Media Service. This also adds PHY, MTU and connection event extension negotiation to speed up data transfer when possible.
2020-01-03wipDan Halbert
2019-12-11address review commentsDan Halbert
2019-12-10merge from upstreamDan Halbert
2019-12-06Merge pull request #2301 from tannewt/support_extended_advertisingDan Halbert
Add support for extended (>31 byte) BLE advertisements.
2019-12-06Check connection validity after service discovery.Scott Shawcroft
Fixes #2347
2019-12-05wipDan Halbert
2019-12-04Add connection interval and debuggingScott Shawcroft
This also sets TinyUSB to master and to not include its submodules. It also fixes an old displayio example comment and retries gattc reads.
2019-11-26Merge remote-tracking branch 'adafruit/master' into support_extended_advertisingScott Shawcroft
2019-11-22Merge remote-tracking branch 'origin/master' into tick-refactorJeff Epler
2019-11-21Clean up debug changesScott Shawcroft
2019-11-21Special exception message for when pairing prompt is ignored.Scott Shawcroft
2019-11-21Fix pairing when peripheral. Central untested.Scott Shawcroft
2019-11-20Use BluetoothError in _bleioScott Shawcroft
This better differentiates errors than using OSError everywhere.
2019-11-19Add support for extended (>31 byte) BLE advertisements.Scott Shawcroft
2019-11-18Supervisor: move most of systick to the supervisorJeff Epler
This code is shared by most parts, except where not all the #ifdefs inside the tick function were present in all ports. This mostly would have broken gamepad tick support on non-samd ports. The "ms32" and "ms64" variants of the tick functions are introduced because there is no 64-bit atomic read. Disabling interrupts avoids a low probability bug where milliseconds could be off by ~49.5 days once every ~49.5 days (2^32 ms). Avoiding disabling interrupts when only the low 32 bits are needed is a minor optimization. Testing performed: on metro m4 express, USB still works and time.monotonic_ns() still counts up
2019-10-22Refine comments and switch prefix_len to size_tScott Shawcroft
2019-10-21Refine _bleioScott Shawcroft
This PR refines the _bleio API. It was originally motivated by the addition of a new CircuitPython service that enables reading and modifying files on the device. Moving the BLE lifecycle outside of the VM motivated a number of changes to remove heap allocations in some APIs. It also motivated unifying connection initiation to the Adapter class rather than the Central and Peripheral classes which have been removed. Adapter now handles the GAP portion of BLE including advertising, which has moved but is largely unchanged, and scanning, which has been enhanced to return an iterator of filtered results. Once a connection is created (either by us (aka Central) or a remote device (aka Peripheral)) it is represented by a new Connection class. This class knows the current connection state and can discover and instantiate remote Services along with their Characteristics and Descriptors. Relates to #586
2019-10-20Parameterize linker scriptDan Halbert