• Jim Mussared's avatar
    extmod/modbluetooth: Separate enabling of "client" from "central". · a76604af
    Jim Mussared authored
    Previously, the MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE macro
    controlled enabling both the central mode and the GATT client
    functionality (because usually the two go together).
    
    This commits adds a new MICROPY_PY_BLUETOOTH_ENABLE_GATT_CLIENT
    macro that separately enables the GATT client functionality.
    This defaults to MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE.
    
    This also fixes a bug in the NimBLE bindings where a notification
    or indication would not be received by a peripheral (acting as client)
    as gap_event_cb wasn't handling it. Now both central_gap_event_cb
    and peripheral_gap_event_cb share the same common handler for these
    events.
    Signed-off-by: default avatarJim Mussared <jim.mussared@gmail.com>
    a76604af
modbluetooth.c 71 KB