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

Class that keeps up states of other stones. More...

#include <cs_ExternalStates.h>

Collaboration diagram for ExternalStates:

Public Member Functions

void init ()
 
void receivedState (state_external_stone_t *extState)
 To be called when the state of another stone has been received. More...
 
service_data_encrypted_tgetNextState ()
 Get a state to be broadcasted. More...
 
void tick (TYPIFY(EVT_TICK) tickCount)
 To be called every EVT_TICK. More...
 

Private Member Functions

void removeFromList (stone_id_t id)
 
void addToList (int index, stone_id_t id, state_external_stone_t *state)
 
void fixState (state_external_stone_t *state)
 
int8_t getRssi (stone_id_t id)
 

Private Attributes

cs_external_state_item_t_states
 
int _broadcastIndex = 0
 Index of states to be broadcasted next. More...
 

Detailed Description

Class that keeps up states of other stones.

This includes:

  • Storing the states of other stones.
  • Keeping up if states are timed out.
  • Choosing which state should be broadcasted next.

Member Function Documentation

◆ addToList()

void ExternalStates::addToList ( int  index,
stone_id_t  id,
state_external_stone_t state 
)
private

◆ fixState()

void ExternalStates::fixState ( state_external_stone_t state)
private

◆ getNextState()

service_data_encrypted_t * ExternalStates::getNextState ( )

Get a state to be broadcasted.

Returns NULL if no state was found.

◆ getRssi()

int8_t ExternalStates::getRssi ( stone_id_t  id)
private

◆ init()

void ExternalStates::init ( )

◆ receivedState()

void ExternalStates::receivedState ( state_external_stone_t extState)

To be called when the state of another stone has been received.

◆ removeFromList()

void ExternalStates::removeFromList ( stone_id_t  id)
private

◆ tick()

void ExternalStates::tick ( TYPIFY(EVT_TICK tickCount)

To be called every EVT_TICK.

Member Data Documentation

◆ _broadcastIndex

int ExternalStates::_broadcastIndex = 0
private

Index of states to be broadcasted next.

◆ _states

cs_external_state_item_t* ExternalStates::_states
private

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