Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_PresenceCondition.h
Go to the documentation of this file.
1/*
2 * Author: Crownstone Team
3 * Copyright: Crownstone (https://crownstone.rocks)
4 * Date: Oct 23, 2019
5 * License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)
6 */
7
8#pragma once
9
11
12#include <array>
13
15public:
16 typedef std::array<uint8_t, 9 + 4> SerializedDataType;
17
19 uint32_t timeOut;
20
23
25
26 // return value: pointer to next empty val in outbuff.
27 // if max_size is 0, outbuff is not checked for nullptr,
28 // and no size check is performed. otherwise, both are validated.
29 virtual uint8_t* serialize(uint8_t* outbuff, size_t maxSize = 0);
30
31 virtual size_t serializedSize() const;
32
33 virtual ~PresenceCondition() = default;
34
38 bool isTrue(PresenceStateDescription currentPresence);
39};
Definition: cs_PresenceCondition.h:14
PresenceCondition(SerializedDataType arr)
virtual uint8_t * serialize(uint8_t *outbuff, size_t maxSize=0)
std::array< uint8_t, 9+4 > SerializedDataType
Definition: cs_PresenceCondition.h:16
bool isTrue(PresenceStateDescription currentPresence)
Returns true if this condition is satisfied given the presence state.
virtual size_t serializedSize() const
PresencePredicate predicate
Definition: cs_PresenceCondition.h:18
PresenceCondition(PresencePredicate p, uint32_t t)
uint32_t timeOut
Definition: cs_PresenceCondition.h:19
SerializedDataType serialize()
virtual ~PresenceCondition()=default
Definition: cs_PresencePredicate.h:15
Class that holds the presence of a profile.
Definition: cs_PresenceDescription.h:23