Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
IpcRamBluenet Class Reference

Class to operate on bluenet to bluenet IPC ram. More...

#include <cs_IpcRamBluenet.h>

Public Member Functions

void init ()
 Reads the IPC ram. More...
 
bool isValidOnBoot ()
 Whether the IPC ram data was valid before init. More...
 
const bluenet_ipc_bluenet_data_t & getData ()
 Get the current data. More...
 
void updateEnergyUsed (const int64_t &energyUsed)
 Update the energy field. More...
 
void updateMicroappData (uint8_t appIndex, const microapp_reboot_data_t &data)
 Update a microapp field. More...
 

Static Public Member Functions

static IpcRamBluenetgetInstance ()
 Get the singleton instance. More...
 

Private Member Functions

 IpcRamBluenet ()
 Constructor, singleton, thus made private. More...
 
 IpcRamBluenet (IpcRamBluenet const &)=delete
 Copy constructor, singleton, thus made private. More...
 
IpcRamBluenetoperator= (IpcRamBluenet const &)=delete
 Assignment operator, singleton, thus made private. More...
 
void clearData ()
 Clear the cached data. More...
 
void updateData ()
 Copy cache to IPC ram. More...
 
void printData ()
 

Private Attributes

bluenet_ipc_data_payload_t _ipcData
 Cache the data in IPC. More...
 
bool _isValidOnBoot = false
 

Detailed Description

Class to operate on bluenet to bluenet IPC ram.

An alternative to this class would be to add a method to the IpcRamData class to update a single field.

Constructor & Destructor Documentation

◆ IpcRamBluenet() [1/2]

Constructor, singleton, thus made private.

◆ IpcRamBluenet() [2/2]

IpcRamBluenet::IpcRamBluenet ( IpcRamBluenet const &  )
privatedelete

Copy constructor, singleton, thus made private.

Member Function Documentation

◆ clearData()

void IpcRamBluenet::clearData ( )
private

Clear the cached data.

◆ getData()

const bluenet_ipc_bluenet_data_t & IpcRamBluenet::getData ( )

Get the current data.

Don't forget to first check whether the data is valid on boot.

◆ getInstance()

static IpcRamBluenet & IpcRamBluenet::getInstance ( )
static

Get the singleton instance.

◆ init()

void IpcRamBluenet::init ( )

Reads the IPC ram.

If it's not valid, the data will be cleared. After init, the data is valid.

◆ isValidOnBoot()

bool IpcRamBluenet::isValidOnBoot ( )

Whether the IPC ram data was valid before init.

◆ operator=()

IpcRamBluenet & IpcRamBluenet::operator= ( IpcRamBluenet const &  )
privatedelete

Assignment operator, singleton, thus made private.

◆ printData()

void IpcRamBluenet::printData ( )
private

◆ updateData()

void IpcRamBluenet::updateData ( )
private

Copy cache to IPC ram.

◆ updateEnergyUsed()

void IpcRamBluenet::updateEnergyUsed ( const int64_t &  energyUsed)

Update the energy field.

Will write the data to IPC ram.

◆ updateMicroappData()

void IpcRamBluenet::updateMicroappData ( uint8_t  appIndex,
const microapp_reboot_data_t &  data 
)

Update a microapp field.

Will write the data to IPC ram.

Member Data Documentation

◆ _ipcData

bluenet_ipc_data_payload_t IpcRamBluenet::_ipcData
private

Cache the data in IPC.

◆ _isValidOnBoot

bool IpcRamBluenet::_isValidOnBoot = false
private

The documentation for this class was generated from the following file: