Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_MicroappInterruptHandler.h
Go to the documentation of this file.
1/*
2 * Author: Crownstone Team
3 * Copyright: Crownstone (https://crownstone.rocks)
4 * Date: Aug 29, 2022
5 * License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)
6 */
7
8#pragma once
9
10#include <events/cs_Event.h>
14
20public:
22 static MicroappInterruptHandler instance;
23 return instance;
24 }
25
26private:
33
40 uint8_t* getOutputBuffer(MicroappSdkType type, uint8_t id);
41
46
51
58
60
62
69 void onBlePeripheralDisconnect(uint16_t connectionHandle);
70
72
73 void onBluenetEvent(event_t& event);
74
75public:
76 void onBlePeripheralWrite(uint16_t connectionHandle, uint16_t characteristicHandle, cs_data_t value);
77 void onBlePeripheralSubscription(uint16_t connectionHandle, uint16_t characteristicHandle, bool subscribed);
78 void onBlePeripheralNotififyDone(uint16_t connectionHandle, uint16_t characteristicHandle);
79
84 uint8_t appIndex, const cs_data_t& message, cs_data_t& resultBuffer, uint16_t& resultSize);
85
89 void handleEvent(event_t& event);
90};
Definition: cs_TrackableEvent.h:12
Event listener.
Definition: cs_EventListener.h:17
Definition: cs_MeshMsgEvent.h:71
The class MicroappRequestHandler has functionality to store a second app (and perhaps in the future e...
Definition: cs_MicroappInterruptHandler.h:19
void onBlePeripheralSubscription(uint16_t connectionHandle, uint16_t characteristicHandle, bool subscribed)
static MicroappInterruptHandler & getInstance()
Definition: cs_MicroappInterruptHandler.h:21
void onBlePeripheralDisconnect(uint16_t connectionHandle)
void onBleCentralNotification(ble_central_notification_t &event)
cs_ret_code_t onMessage(uint8_t appIndex, const cs_data_t &message, cs_data_t &resultBuffer, uint16_t &resultSize)
Handle a control command message.
void onBleCentralWriteResult(ble_central_write_result_t &event)
void onBleCentralReadResult(ble_central_read_result_t &event)
void handleEvent(event_t &event)
Handle events.
MicroappInterruptHandler()
Singleton, constructor, also copy constructor, is private.
void onBlePeripheralWrite(uint16_t connectionHandle, uint16_t characteristicHandle, cs_data_t value)
uint8_t * getOutputBuffer(MicroappSdkType type, uint8_t id)
Check whether an interrupt is allowed to be sent and return the output buffer.
void onReceivedMeshMessage(MeshMsgEvent &event)
Handle a received mesh message and determine whether to forward it to the microapp.
void onBleCentralDiscovery(ble_central_discovery_t &event)
void onBlePeripheralConnect(ble_connected_t &event)
void onBluenetEvent(event_t &event)
void onBlePeripheralNotififyDone(uint16_t connectionHandle, uint16_t characteristicHandle)
void onAssetAccepted(AssetAcceptedEvent &event)
void onDeviceScanned(scanned_device_t &dev)
Handle a scanned BLE device.
void onBleCentralConnectResult(cs_ret_code_t &retCode)
void operator=(MicroappInterruptHandler const &)
MicroappInterruptHandler(MicroappInterruptHandler const &)
void onBleCentralDiscoveryResult(cs_ret_code_t &retCode)
void onGpioUpdate(cs_gpio_update_t &event)
Handle a GPIO event.
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Oct 9,...
Definition: cs_Event.h:26
uint16_t cs_ret_code_t
Definition: cs_Typedefs.h:21
Describes a service or characteristic that has been discovered.
Definition: cs_BleCentralPackets.h:41
Definition: cs_BleCentralPackets.h:76
Definition: cs_BleCentralPackets.h:70
Definition: cs_BleCentralPackets.h:65
Definition: cs_PacketsInternal.h:214
Packets (structs) that are used internally in the firmware, and can be changed freely.
Definition: cs_PacketsInternal.h:27
Definition: cs_PacketsInternal.h:434
Scanned device.
Definition: cs_PacketsInternal.h:107