diff --git a/main/ble.c b/main/ble.c index 9a8e8e8..2ba6a86 100644 --- a/main/ble.c +++ b/main/ble.c @@ -138,8 +138,7 @@ static const struct ble_gatt_svc_def service_defs[] = { { 0 } // no more services }; -static int gatt_svr_chr_write(struct os_mbuf *om, uint16_t min_len, uint16_t max_len, - void *dst, uint16_t *len) { +static int gatt_svr_chr_write(struct os_mbuf *om, uint16_t min_len, uint16_t max_len, void *dst, uint16_t *len) { uint16_t om_len; int rc; @@ -159,6 +158,7 @@ static int gatt_svr_chr_write(struct os_mbuf *om, uint16_t min_len, uint16_t max static int svc_access_system(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 value = 0; + uint16_t vlen = 0; ESP_LOGI(TAG, "0x%02X access: %d", uuid16, ctxt->op); @@ -168,9 +168,11 @@ static int svc_access_system(uint16_t conn_handle, uint16_t attr_handle, struct ctxt->om, sizeof value, sizeof value, - &value, NULL + &value, &vlen ); + ESP_LOGI(TAG, "value (%d): %d", vlen, value); + switch(uuid16) { case BAROS_CHAR_POUR: if(value == 1) {