BLE EddystoneObserver example
This example is a fork of the following mbed-os example:
https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-EddystoneObserver/
Please read the documentation in this page.
Diff: source/main.cpp
- Revision:
- 13:c5f3a7d8764a
- Parent:
- 12:5e1ef2515c70
- Child:
- 29:083b9a2cb114
diff -r 5e1ef2515c70 -r c5f3a7d8764a source/main.cpp --- a/source/main.cpp Wed Oct 12 20:00:13 2016 +0100 +++ b/source/main.cpp Mon Oct 24 11:15:22 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" @@ -145,20 +145,18 @@ 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() { - eventQueue.post_every(500, periodicCallback); + eventQueue.call_every(500, periodicCallback); BLE &ble = BLE::Instance(); ble.onEventsToProcess(scheduleBleEventsProcessing); ble.init(bleInitComplete); - while (true) { - eventQueue.dispatch(); - } + eventQueue.dispatch_forever(); return 0; }