41#if BUILD_MICROAPP_SUPPORT == 1
45#if BUILD_MEM_USAGE_TEST == 1
347#if BUILD_MESHING == 1
348 Mesh* _mesh =
nullptr;
366#if BUILD_MICROAPP_SUPPORT == 1
370#if BUILD_MEM_USAGE_TEST == 1
379 Gpio* _gpio =
nullptr;
Definition: cs_Advertiser.h:20
Definition: cs_AssetFiltering.h:19
Keeps track of the behaviours that are active on this crownstone.
Definition: cs_BehaviourStore.h:25
Class that enables you to connect to a device, and perform write or read operations.
Definition: cs_BleCentral.h:27
Definition: cs_CommandAdvHandler.h:58
Every command from an external device such as a smartphone goes through the CommandHandler.
Definition: cs_CommandHandler.h:34
Helper class to manage decoupling of components.
Definition: cs_Component.h:35
Class to connect to another crownstone, and write control commands.
Definition: cs_CrownstoneCentral.h:26
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Oct 22,...
Definition: cs_CrownstoneService.h:25
Crownstone encapsulates all functionality, stack, services, and configuration.
Definition: cs_Crownstone.h:60
ServiceData * _serviceData
Definition: cs_Crownstone.h:344
SetupService * _setupService
Definition: cs_Crownstone.h:341
void createCrownstoneServices()
Create services available in normal operation mode.
TrackedDevices _trackedDevices
Definition: cs_Crownstone.h:360
FactoryReset * _factoryReset
Definition: cs_Crownstone.h:352
static void updateHeapStats()
Update the heap statistics.
PowerSampling * _powerSampler
Definition: cs_Crownstone.h:336
app_timer_t _mainTimerData
Definition: cs_Crownstone.h:382
OperationMode _operationMode
Definition: cs_Crownstone.h:386
Timer * _timer
Definition: cs_Crownstone.h:331
AssetFiltering _assetFiltering
Definition: cs_Crownstone.h:362
void increaseResetCounter()
Increase reset counter.
Scanner * _scanner
Definition: cs_Crownstone.h:351
OperationMode _oldOperationMode
Definition: cs_Crownstone.h:387
void createSetupServices()
Create services available in setup mode.
void configure()
configure the crownstone.
void handleEvent(event_t &event)
handle (crownstone) events
SwitchAggregator _switchAggregator
Definition: cs_Crownstone.h:357
bool _clearedGpRegRetCount
Definition: cs_Crownstone.h:403
void scheduleNextTick()
schedule next execution of tick function
void init(uint16_t step)
Initialize the crownstone:
SystemTime _systemTime
Definition: cs_Crownstone.h:355
bool _setStateValuesAfterStorageRecover
If storage was recovered by erasing all pages, we want to set some state variables different than aft...
Definition: cs_Crownstone.h:401
TemperatureGuard * _temperatureGuard
Definition: cs_Crownstone.h:335
CrownstoneService * _crownstoneService
Definition: cs_Crownstone.h:340
CommandAdvHandler * _commandAdvHandler
Definition: cs_Crownstone.h:353
void initDrivers1()
The distinct driver init phases.
static void updateMinStackEnd()
Update the minimal stack end location.
void init0()
The distinct init phases.
ServiceEvent
Definition: cs_Crownstone.h:63
@ CREATE_SETUP_SERVICE
Definition: cs_Crownstone.h:65
@ REMOVE_SETUP_SERVICE
Definition: cs_Crownstone.h:68
@ CREATE_CROWNSTONE_SERVICE
Definition: cs_Crownstone.h:66
@ CREATE_DEVICE_INFO_SERVICE
Definition: cs_Crownstone.h:64
@ REMOVE_DEVICE_INFO_SERVICE
Definition: cs_Crownstone.h:67
@ REMOVE_CROWNSTONE_SERVICE
Definition: cs_Crownstone.h:69
Stack * _stack
Definition: cs_Crownstone.h:327
Storage * _storage
Definition: cs_Crownstone.h:332
static void printLoadStats()
Print load stats: RAM usage, app scheduler usage, etc.
void tick()
tick function for crownstone to update/execute periodically
BleCentral * _bleCentral
Definition: cs_Crownstone.h:328
MeshTopology _meshTopology
Definition: cs_Crownstone.h:361
PresenceHandler _presenceHandler
Definition: cs_Crownstone.h:364
Crownstone(boards_config_t &board)
Allocate Crownstone class and internal references.
app_timer_id_t _mainTimerId
Definition: cs_Crownstone.h:383
void initDrivers0()
initialize drivers (stack, timer, storage, pwm, etc), loads settings from storage.
State * _state
Definition: cs_Crownstone.h:333
MultiSwitchHandler * _multiSwitchHandler
Definition: cs_Crownstone.h:354
static void staticTick(Crownstone *ptr)
tick function called by app timer
Definition: cs_Crownstone.h:178
void switchMode(const OperationMode &mode)
Switch from one operation mode to another.
void setName()
The default name.
static cs_ram_stats_t _ramStats
Definition: cs_Crownstone.h:395
uint32_t _gpregret[2]
Store gpregret as it was on boot.
Definition: cs_Crownstone.h:390
void startOperationMode(const OperationMode &mode)
Start operation for Crownstone.
void startUp()
startup the crownstone:
void createService(const ServiceEvent event)
Create a particular service.
boards_config_t _boardsConfig
Definition: cs_Crownstone.h:324
BehaviourStore _behaviourStore
Definition: cs_Crownstone.h:363
std::vector< Component * > getChildren() override
Components with children can override this method to return them.
CrownstoneCentral * _crownstoneCentral
Definition: cs_Crownstone.h:329
void configureAdvertisement()
Sets default parameters of the Bluetooth connection.
Advertiser * _advertiser
Definition: cs_Crownstone.h:330
CommandHandler * _commandHandler
Definition: cs_Crownstone.h:350
TYPIFY(EVT_TICK) _tickCount=0
DeviceInformationService * _deviceInformationService
Definition: cs_Crownstone.h:339
uint32_t _resetReason
Store reset reason as it was on boot.
Definition: cs_Crownstone.h:393
Event listener.
Definition: cs_EventListener.h:17
Definition: cs_FactoryReset.h:28
Definition: cs_MemUsageTest.h:12
Definition: cs_MeshTopology.h:19
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: 12 Apr....
Definition: cs_Mesh.h:36
Class that enables the feature to run microapps on the firmware.
Definition: cs_Microapp.h:21
Definition: cs_MultiSwitchHandler.h:13
Sample power.
Definition: cs_PowerSampling.h:24
Keeps up all the locations each profile is present in.
Definition: cs_PresenceHandler.h:22
Scanner scans for BLE devices.
Definition: cs_Scanner.h:14
Definition: cs_ServiceData.h:20
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Oct 22,...
Definition: cs_SetupService.h:20
nRF51822 specific implementation of the BLEStack
Definition: cs_Stack.h:41
Stores state values in RAM and/or FLASH.
Definition: cs_State.h:145
Class to store items persistently in flash (persistent) memory.
Definition: cs_Storage.h:57
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Sep 26,...
Definition: cs_SwitchAggregator.h:24
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Sep 24,...
Definition: cs_SystemTime.h:49
Check if the temperature exceeds a certain threshold.
Definition: cs_TemperatureGuard.h:25
Definition: cs_TestAccess.h:11
Timer on top of the timer peripheral.
Definition: cs_Timer.h:22
Class that keeps up devices to be tracked.
Definition: cs_TrackedDevices.h:27
Class that implements twi/i2c.
Definition: cs_Twi.h:18
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Oct 9,...
Definition: cs_Event.h:26
OperationMode
Definition: cs_Types.h:440
Universally Unique IDentifiers for BLE services and characteristics.
Board configuration.
Definition: cs_Boards.h:169
Definition: cs_Packets.h:502