Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_IpcRamBluenet.h
Go to the documentation of this file.
1/*
2 * Author: Crownstone Team
3 * Copyright: Crownstone (https://crownstone.rocks)
4 * Date: Oct 24, 2022
5 * License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)
6 */
7
8#pragma once
9
10#include <ipc/cs_IpcRamDataContents.h>
11
18public:
23
30 void init();
31
36
42 const bluenet_ipc_bluenet_data_t& getData();
43
49 void updateEnergyUsed(const int64_t& energyUsed);
50
56 void updateMicroappData(uint8_t appIndex, const microapp_reboot_data_t& data);
57
58private:
61
63 IpcRamBluenet(IpcRamBluenet const&) = delete;
64
67
69 bluenet_ipc_data_payload_t _ipcData;
70
71 bool _isValidOnBoot = false;
72
74 void clearData();
75
77 void updateData();
78
79 void printData();
80};
Class to operate on bluenet to bluenet IPC ram.
Definition: cs_IpcRamBluenet.h:17
IpcRamBluenet()
Constructor, singleton, thus made private.
void printData()
void updateMicroappData(uint8_t appIndex, const microapp_reboot_data_t &data)
Update a microapp field.
void clearData()
Clear the cached data.
bool isValidOnBoot()
Whether the IPC ram data was valid before init.
void updateEnergyUsed(const int64_t &energyUsed)
Update the energy field.
const bluenet_ipc_bluenet_data_t & getData()
Get the current data.
bluenet_ipc_data_payload_t _ipcData
Cache the data in IPC.
Definition: cs_IpcRamBluenet.h:69
void init()
Reads the IPC ram.
IpcRamBluenet & operator=(IpcRamBluenet const &)=delete
Assignment operator, singleton, thus made private.
static IpcRamBluenet & getInstance()
Get the singleton instance.
IpcRamBluenet(IpcRamBluenet const &)=delete
Copy constructor, singleton, thus made private.
bool _isValidOnBoot
Definition: cs_IpcRamBluenet.h:71
void updateData()
Copy cache to IPC ram.