Kris Scholte Lubberink
/
SSS_Ble
Ble for smart sOlutions
Diff: source/BleDevicePeripheral.cpp
- Revision:
- 11:d6ed1437c2ee
- Parent:
- 10:d845189d146e
diff -r d845189d146e -r d6ed1437c2ee source/BleDevicePeripheral.cpp --- a/source/BleDevicePeripheral.cpp Fri Jun 14 10:24:57 2019 +0200 +++ b/source/BleDevicePeripheral.cpp Thu Jun 20 13:20:24 2019 +0200 @@ -1,26 +1,12 @@ #include "BleDevicePeripheral.h" -void ledStuff(){ - - MyStripSingleton::getInstance()->connectionFlash(); - MyStripSingleton::getInstance()->resetColor(); -} void BleDevicePeripheral::onConnectionComplete(const ble::ConnectionCompleteEvent &event) { -// ble_error_t error; - /* remember the device that connects to us now so we can connect to it - * during the next demonstration */ -// memcpy(_peer_address, event.getPeerAddress().data(), sizeof(_peer_address)); - //TODO: Connecting to the device breaks the event queue; it should. BUT there should start some new stuff printf("[PERIPHERAL]\t Connected to peer: "); print_address(event.getPeerAddress().data()); _handle = event.getConnectionHandle(); printf("[PERIPHERAL]\t I'm connected to someone, what should i do now?"); + //Dispatch forever makes sure that we stay in this state until explicitly told otherwise (on disconnect). - - -// MyStripSingleton::getInstance()->connectionFlash(); -// MyStripSingleton::getInstance()->resetColor(); -// _event_queue.call(callback(ledStuff)); _event_queue.dispatch_forever(); }