diff options
Diffstat (limited to 'apps/ble-read-characteristic.cpp')
-rw-r--r-- | apps/ble-read-characteristic.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/ble-read-characteristic.cpp b/apps/ble-read-characteristic.cpp index 8efcb3b..ecdb471 100644 --- a/apps/ble-read-characteristic.cpp +++ b/apps/ble-read-characteristic.cpp @@ -109,8 +109,12 @@ public: cccd->setValue(ByteBuffer::wrapInitialized(BluetoothGattDescriptor::ENABLE_NOTIFICATION_VALUE)); gatt->write(cccd); - cout << "sleeping" << endl; - std::this_thread::sleep_for(10s); + auto end = std::chrono::system_clock::now() + 10s; + + do { + cerr << "Processing messages" << endl; + gatt->process(2s); + } while(std::chrono::system_clock::now() < end); } } else { cout << "Unsupported op mode." << endl; |