summaryrefslogtreecommitdiff
path: root/examples/bluetooth/ble_temperature.py
AgeCommit message (Collapse)Author
2023-09-01examples/bluetooth: Link to aioble in BLE examples.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-12-02extmod/modbluetooth: Allow setting char/desc enc/auth options.Andrew Leech
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>
2020-09-26examples/bluetooth: Update to use positional-only args to irq().Jim Mussared
To match 6a6a5f9e151473bdcc1d14725d680691ff665a82.
2020-08-29all: Update Python code to conform to latest black formatting.Damien George
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>
2020-07-20extmod/modbluetooth: Add event for "indicate acknowledgement".Jim Mussared
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.
2020-06-05extmod/modbluetooth: Make modbluetooth event not a bitfield.Jim Mussared
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)
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2019-10-22examples/bluetooth: Use UUIDs directly to add services to adv payload.Jim Mussared
2019-10-18examples/bluetooth: Add basic BLE peripheral examples.Jim Mussared
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.