Luca Mottola
/
IOTAtelier1819-BLEBeacon
BLE beacon example
Diff: source/main.cpp
- Revision:
- 12:af576944a152
- Parent:
- 3:41f6be68aefb
- Child:
- 28:9090fe431353
diff -r edcf1a0efe8d -r af576944a152 source/main.cpp --- a/source/main.cpp Wed Oct 05 05:15:36 2016 +0100 +++ b/source/main.cpp Mon Oct 24 11:15:13 2016 +0100 @@ -14,7 +14,7 @@ * limitations under the License. */ -#include <mbed-events/events.h> +#include <events/mbed_events.h> #include <mbed.h> #include "ble/BLE.h" #include "ble/services/iBeacon.h" @@ -73,7 +73,7 @@ void scheduleBleEventsProcessing(BLE::OnEventsToProcessCallbackContext* context) { BLE &ble = BLE::Instance(); - eventQueue.post(Callback<void()>(&ble, &BLE::processEvents)); + eventQueue.call(Callback<void()>(&ble, &BLE::processEvents)); } int main() @@ -82,9 +82,7 @@ ble.onEventsToProcess(scheduleBleEventsProcessing); ble.init(bleInitComplete); - while (true) { - eventQueue.dispatch(); - } + eventQueue.dispatch_forever(); return 0; }