30 typedef std::array<uint8_t, WireFormat::size<Behaviour>() + WireFormat::size<PresenceCondition>()>
46 virtual uint8_t*
serialize(uint8_t* outbuff,
size_t max_size)
override;
Class to derrive behaviours from, centralizing common variables such as from and until times.
Definition: cs_Behaviour.h:20
Type
Definition: cs_Behaviour.h:22
TimeOfDay until() const
Returns until (excl.) which time on this behaviour applies.
TimeOfDay from() const
Returns from (incl.) which time on this behaviour applies.
Definition: cs_PresenceCondition.h:14
Definition: cs_PresencePredicate.h:15
Class that holds the presence of a profile.
Definition: cs_PresenceDescription.h:23
Object that defines when a state transition should occur.
Definition: cs_SwitchBehaviour.h:26
virtual size_t serializedSize() const override
std::array< uint8_t, WireFormat::size< Behaviour >()+WireFormat::size< PresenceCondition >()> SerializedDataType
Definition: cs_SwitchBehaviour.h:31
bool isValid(PresenceStateDescription currentpresence)
virtual bool requiresAbsence() override
bool gracePeriodForPresenceIsActive()
virtual bool requiresPresence() override
virtual ~SwitchBehaviour()=default
bool _isValid(PresenceStateDescription currentpresence)
SwitchBehaviour(SerializedDataType arr)
virtual PresencePredicate currentPresencePredicate()
SerializedDataType serialize()
virtual Type getType() const override
Definition: cs_SwitchBehaviour.h:49
std::optional< uint32_t > prevInRoomTimeStamp
Definition: cs_SwitchBehaviour.h:87
PresenceCondition presenceCondition
Definition: cs_SwitchBehaviour.h:83
SwitchBehaviour(uint8_t intensity, uint8_t profileid, DayOfWeekBitMask activedaysofweek, TimeOfDay from, TimeOfDay until, PresenceCondition presencecondition)
virtual uint8_t * serialize(uint8_t *outbuff, size_t max_size) override
virtual bool isValid(Time currenttime, PresenceStateDescription currentpresence)
Does the behaviour apply to the current situation? If from() == until() the behaviour isValid all day...
Definition: cs_TestAccess.h:11
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Sep 24,...
Definition: cs_TimeOfDay.h:19
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Sep 24,...
Definition: cs_Time.h:14
uint8_t DayOfWeekBitMask
Definition: cs_DayOfWeek.h:23