diff --git a/main/ble.c b/main/ble.c index 68cfbe4..6cb2f7d 100644 --- a/main/ble.c +++ b/main/ble.c @@ -184,11 +184,11 @@ static int svc_access_system(uint16_t conn_handle, uint16_t attr_handle, struct static int svc_access_pump_enabled(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { uint16_t uuid16 = ble_uuid_u16(ctxt->chr->uuid); + uint8_t idx = uuid16 - (BLE_SERVICE_PUMP_ENABLED + 1); uint8_t value = 0; ESP_LOGI(TAG, "conn_handle: %d attr_handle: %d char: 0x%02X op: %s", conn_handle, attr_handle, uuid16, (ctxt->op == 0 ? "read" : ctxt->op == 1 ? "write" : "unknown")); - uint8_t idx = uuid16 - (BLE_SERVICE_PUMP_ENABLED + 1); if(ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) { gatt_svr_chr_write(