Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API mbed-dev-bin nRF51822
Fork of microbit-dal by
MicroBitEventService Class Reference
Class definition for a MicroBit BLE Event Service. More...
#include <MicroBitEventService.h>
Inherits MicroBitComponent.
Public Member Functions | |
| MicroBitEventService (BLEDevice &_ble, EventModel &_messageBus) | |
| Constructor. | |
| virtual void | idleTick () |
| Periodic callback from MicroBit scheduler. | |
| void | onDataWritten (const GattWriteCallbackParams *params) |
| Callback. | |
| void | onMicroBitEvent (MicroBitEvent evt) |
| Callback. | |
| void | onRequirementsRead (GattReadAuthCallbackParams *params) |
| Read callback on microBitRequirements characteristic. | |
| virtual void | systemTick () |
| The system timer will call this member function once the component has been added to the array of system components using system_timer_add_component. | |
Detailed Description
Class definition for a MicroBit BLE Event Service.
Provides a BLE gateway onto an Event Model.
Definition at line 52 of file MicroBitEventService.h.
Constructor & Destructor Documentation
| MicroBitEventService | ( | BLEDevice & | _ble, |
| EventModel & | _messageBus | ||
| ) |
Constructor.
Class definition for a MicroBit BLE Event Service.
Create a representation of the EventService
- Parameters:
-
_ble The instance of a BLE device that we're running on. _messageBus An instance of an EventModel which events will be mirrored from.
Provides a BLE gateway onto an Event Model. Constructor. Create a representation of the EventService
- Parameters:
-
_ble The instance of a BLE device that we're running on. _messageBus An instance of an EventModel which events will be mirrored from.
Definition at line 43 of file MicroBitEventService.cpp.
Member Function Documentation
| void idleTick | ( | ) | [virtual] |
Periodic callback from MicroBit scheduler.
If we're no longer connected, remove any registered Message Bus listeners.
Reimplemented from MicroBitComponent.
Definition at line 138 of file MicroBitEventService.cpp.
| void onDataWritten | ( | const GattWriteCallbackParams * | params ) |
Callback.
Invoked when any of our attributes are written via BLE.
Definition at line 89 of file MicroBitEventService.cpp.
| void onMicroBitEvent | ( | MicroBitEvent | evt ) |
Callback.
Invoked when any events are sent on the microBit message bus.
Definition at line 122 of file MicroBitEventService.cpp.
| void onRequirementsRead | ( | GattReadAuthCallbackParams * | params ) |
Read callback on microBitRequirements characteristic.
Used to iterate through the events that the code on this micro:bit is interested in.
Definition at line 151 of file MicroBitEventService.cpp.
| virtual void systemTick | ( | ) | [virtual, inherited] |
The system timer will call this member function once the component has been added to the array of system components using system_timer_add_component.
This callback will be in interrupt context.
Reimplemented in MicroBitSystemTimerCallback, MicroBitButton, and MicroBitDisplay.
Definition at line 125 of file MicroBitComponent.h.
Generated on Thu Jul 14 2022 17:00:09 by
1.7.2
