From b0ad49a7b57b8e567d84e99e37033506af2678cb Mon Sep 17 00:00:00 2001 From: root Date: Fri, 4 Sep 2015 10:30:45 +0100 Subject: noresp writes are ignored by dfu firmware --- ble.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'ble.c') diff --git a/ble.c b/ble.c index 24871b9..5de6993 100644 --- a/ble.c +++ b/ble.c @@ -553,13 +553,13 @@ ble_send_cp (BLE * ble, uint8_t * buf, size_t len) } - int ble_send_cp_noresp (BLE * ble, uint8_t * buf, size_t len) { - printf ("Sending control:\n"); + printf ("Sending control (but ignoring error):\n"); hexdump (buf, len); +#if 0 if (!bt_gatt_client_write_without_response (ble->gatt, ble->cp_handle, false, buf, len)) { @@ -567,6 +567,17 @@ ble_send_cp_noresp (BLE * ble, uint8_t * buf, size_t len) return EXIT_FAILURE; } return EXIT_SUCCESS; +#else + if (!bt_gatt_client_write_value (ble->gatt, ble->cp_handle, buf, len, + write_cb, ble, NULL)) + { + printf ("Failed to initiate write procedure\n"); + return EXIT_FAILURE; + } + + mainloop_run (); + return EXIT_SUCCESS; +#endif } -- cgit v1.2.3