summaryrefslogtreecommitdiffstatshomepage
path: root/examples/bluetooth
Commit message (Collapse)AuthorAge
* examples/bluetooth: Link to aioble in BLE examples.Jim Mussared2023-09-01
| | | | Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* examples/bluetooth: Raise ValueError when advertising data is too large.Alexander Wilde2023-09-01
| | | | Signed-off-by: Alexander Wilde <alexander.wilde87@gmail.com>
* all: Add missing imports for micropython.const.Angus Gratton2023-08-16
| | | | | | Found by Ruff checking F821. Signed-off-by: Angus Gratton <angus@redyak.com.au>
* examples/bluetooth/ble_temperature_central.py: Remove service tuple.Jim Mussared2023-04-26
| | | | | | This is unused in the client, only needed in the server. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* examples/bluetooth: Fix check for _conn_handle being None.Damien George2023-02-15
| | | | | | Fixes issue #10755. Signed-off-by: Damien George <damien@micropython.org>
* top: Update Python formatting to black "2023 stable style".Jim Mussared2023-02-02
| | | | | | See https://black.readthedocs.io/en/stable/the_black_code_style/index.html Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* examples/bluetooth: Add bonding/passkey demo.Jim Mussared2020-12-02
| | | | Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* extmod/modbluetooth: Allow setting char/desc enc/auth options.Andrew Leech2020-12-02
| | | | | | | | | | | | This widens the characteristic/descriptor flags to 16-bit, to allow setting encryption/authentication requirements. Sets the required flags for NimBLE and btstack implementations. The BLE.FLAG_* constants will eventually be deprecated in favour of copy and paste Python constants (like the IRQs). Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* examples/bluetooth: Update to use positional-only args to irq().Jim Mussared2020-09-26
| | | | To match 6a6a5f9e151473bdcc1d14725d680691ff665a82.
* all: Update Python code to conform to latest black formatting.Damien George2020-08-29
| | | | | | | | | | | | | Updating to Black v20.8b1 there are two changes that affect the code in this repository: - If there is a trailing comma in a list (eg [], () or function call) then that list is now written out with one line per element. So remove such trailing commas where the list should stay on one line. - Spaces at the start of """ doc strings are removed. Signed-off-by: Damien George <damien@micropython.org>
* extmod/modbluetooth: Add event for "indicate acknowledgement".Jim Mussared2020-07-20
| | | | | | | | | | | | This commit adds the IRQ_GATTS_INDICATE_DONE BLE event which will be raised with the status of gatts_indicate (unlike notify, indications require acknowledgement). An example of its use is added to ble_temperature.py, and to the multitests in ble_characteristic.py. Implemented for btstack and nimble bindings, tested in both directions between unix/btstack and pybd/nimble.
* examples/bluetooth: Add simple UART demo with central and peripheral.Jim Mussared2020-07-18
|
* examples/bluetooth: In ble_advertising.py, skip appearance if not set.Jim Mussared2020-07-18
|
* examples/bluetooth: Fix event code in ble_temperature_central.py.Jim Mussared2020-06-10
|
* examples/bluetooth: Fix incorrect value of BR/EDR flag in advertising.jxltom2020-06-05
| | | | | | | According to Supplement to the Bluetooth Core Specification v8 Part A 1.3.1, to support BR/EDR the code should set the fifth bit (Simultaneous LE and BR/EDR to Same Device Capable (Controller)) and fourth bit (Simultaneous LE and BR/EDR to Same Device Capable (Host)) of the flag.
* extmod/modbluetooth: Ensure status=0 always on success.Jim Mussared2020-06-05
| | | | | | | This commit makes sure that all discovery complete and read/write status events set the status to zero on success. The status value will be implementation-dependent on non-success cases.
* extmod/modbluetooth: Implement read done event.Jim Mussared2020-06-05
| | | | | | On btstack there's no status associated with the read result, it comes through as a separate event. This allows you to detect read failures or timeouts.
* extmod/modbluetooth: Add discover complete events for svc/char/desc.Jim Mussared2020-06-05
| | | | | Without this it's difficult to implement a state machine correctly if the desired services are not found.
* extmod/modbluetooth: Make modbluetooth event not a bitfield.Jim Mussared2020-06-05
| | | | | | | | | | | | | | | | | There doesn't appear to be any use for only triggering on specific events, so it's just easier to number them sequentially. This makes them smaller values so they take up only 1 byte in the ringbuf, only 1 byte for the opcode in the bytecode, and makes room for more events. Also add a couple of new event types that need to be implemented (to avoid re-numbering later). And rename _COMPLETE and _STATUS to _DONE for consistency. In the future the "trigger" keyword argument can be reinstated by requiring the user to compute the bitmask, eg: ble.irq(handler, 1 << _IRQ_SCAN_RESULT | 1 << _IRQ_SCAN_DONE)
* examples/bluetooth: Replace "connectable" parameter with "adv_type".Thomas Friebel2020-03-12
| | | | | | Follow up to dd0bc26e65734b8a4fafa3769008e92e2ec6645d which changed the parameter list of the IRQ_SCAN_RESULT event. Adapt ble_temperature_central.py accordingly.
* all: Reformat C and Python source code with tools/codeformat.py.Damien George2020-02-28
| | | | This is run with uncrustify 0.70.1, and black 19.10b0.
* examples/bluetooth/ble_temperature_central.py: Shorten comment.Damien George2020-02-28
| | | | So the line length is less than 100 characters.
* examples/bluetooth: Add example for reading temperature sensor.Jim Mussared2019-11-25
|
* examples/bluetooth: Add helpers for decoding advertising payloads.Jim Mussared2019-11-25
| | | | Extracts name and service UUID fields.
* examples/bluetooth/ble_uart_peripheral: Use append mode for RX char.Jim Mussared2019-10-29
|
* examples/bluetooth/ble_uart_peripheral.py: Add usage demo.Jim Mussared2019-10-22
|
* examples/bluetooth: Use UUIDs directly to add services to adv payload.Jim Mussared2019-10-22
|
* examples/bluetooth: Add basic BLE peripheral examples.Jim Mussared2019-10-18
Consisting of: - ble_advertising.py -- helper to generate advertising payload. - ble_temperature.py -- simple temperature device. - ble_uart_periperhal.py -- BLE UART wrapper. - ble_uart_repl.py -- dupterm-compatible uart.