diff options
author | root <root@lamia.panaceas.james.local> | 2015-09-04 10:30:45 +0100 |
---|---|---|
committer | root <root@lamia.panaceas.james.local> | 2015-09-04 10:30:45 +0100 |
commit | b0ad49a7b57b8e567d84e99e37033506af2678cb (patch) | |
tree | 8986c8159e6fb486f240f36a3686bdda0dbca4b7 /ble.c | |
parent | 80897e1b5cfc81547e98d830471b78d210997bea (diff) | |
download | nrfdfu-b0ad49a7b57b8e567d84e99e37033506af2678cb.tar.gz nrfdfu-b0ad49a7b57b8e567d84e99e37033506af2678cb.tar.bz2 nrfdfu-b0ad49a7b57b8e567d84e99e37033506af2678cb.zip |
noresp writes are ignored by dfu firmware
Diffstat (limited to 'ble.c')
-rw-r--r-- | ble.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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 } |