Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_ExternalStates.h
Go to the documentation of this file.
1
8#pragma once
9
10#include "common/cs_Types.h"
11
20struct __attribute__((__packed__)) cs_external_state_item_t {
21 uint16_t timeoutCount;
24};
25
35public:
36 void init();
37
42
49
53 void tick(TYPIFY(EVT_TICK) tickCount);
54
55private:
57
60
62
63 void addToList(int index, stone_id_t id, state_external_stone_t* state);
64
66
67 int8_t getRssi(stone_id_t id);
68};
Class that keeps up states of other stones.
Definition: cs_ExternalStates.h:34
int8_t getRssi(stone_id_t id)
void tick(TYPIFY(EVT_TICK) tickCount)
To be called every EVT_TICK.
service_data_encrypted_t * getNextState()
Get a state to be broadcasted.
void fixState(state_external_stone_t *state)
int _broadcastIndex
Index of states to be broadcasted next.
Definition: cs_ExternalStates.h:59
void receivedState(state_external_stone_t *extState)
To be called when the state of another stone has been received.
void addToList(int index, stone_id_t id, state_external_stone_t *state)
cs_external_state_item_t * _states
Definition: cs_ExternalStates.h:56
void removeFromList(stone_id_t id)
uint8_t stone_id_t
Definition: cs_Typedefs.h:23
#define TYPIFY(NAME)
Definition: cs_Types.h:476
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: May 22,...
Definition: cs_ExternalStates.h:20
state_external_stone_t state
Definition: cs_ExternalStates.h:23
uint16_t timeoutCount
Definition: cs_ExternalStates.h:21
stone_id_t id
Definition: cs_ExternalStates.h:22
This data is encrypted.
Definition: cs_ServiceDataPackets.h:169
Struct to communicate received state of other stones.
Definition: cs_PacketsInternal.h:210