Commit d54fc1b3 authored by schneider's avatar schneider
Browse files

Merge branch 'schneider/mp-1.17-ble' into 'master'

fix(mp): Enable gatt client functionality again

See merge request !487
parents b0e3d24c 3f80a44e
Pipeline #5293 passed with stages
in 1 minute and 56 seconds
......@@ -99,7 +99,7 @@ static void handle_att_event(struct epic_att_event *att_event)
e->notification_status = NOTIFICATION_STATUS_OVERFLOW;
}
}
#if MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
if (att_event->hdr.event == ATTC_READ_BY_GROUP_TYPE_RSP) {
// TODO: can we get the connection id from the event?
......@@ -347,7 +347,6 @@ static void handle_att_event(struct epic_att_event *att_event)
}
}
}
#endif
}
static void handle_dm_event(struct epic_dm_event *dm_event)
......@@ -684,6 +683,10 @@ int mp_bluetooth_gatts_write(
size_t value_len,
bool send_update
) {
if (send_update) {
return MP_EOPNOTSUPP;
}
// TODO: which return value to choose?
mp_bluetooth_gatts_db_write(GATTS_DB, value_handle, value, value_len);
int ret = epic_ble_atts_set_attr(value_handle, value, value_len);
......@@ -797,7 +800,6 @@ int mp_bluetooth_set_preferred_mtu(uint16_t mtu)
return 0;
}
#if MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
// Start a discovery (scan). Set duration to zero to run continuously.
int mp_bluetooth_gap_scan_start(
int32_t duration_ms,
......@@ -923,4 +925,3 @@ int mp_bluetooth_gattc_exchange_mtu(uint16_t conn_handle)
raise();
return 0;
}
#endif
......@@ -56,6 +56,7 @@ int mp_hal_csprng_read_int(void);
#define MICROPY_PY_BLUETOOTH (1)
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
#define MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE (1)
#define MICROPY_PY_BLUETOOTH_ENABLE_GATT_CLIENT (1)
#define MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS (1)
/* Modules */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment