supla-device
Loading...
Searching...
No Matches
src
supla
control
button_aggregator.h
1
// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2
// SPDX-License-Identifier: GPL-2.0-or-later
3
4
#ifndef SRC_SUPLA_CONTROL_BUTTON_AGGREGATOR_H_
5
#define SRC_SUPLA_CONTROL_BUTTON_AGGREGATOR_H_
6
7
#include <supla/control/button.h>
8
#include <stdint.h>
9
10
#define BUTTON_AGGREGATOR_MAX_BUTTONS 10
11
12
namespace
Supla {
13
namespace
Control {
14
15
class
ButtonAggregator
:
public
Supla::Control::Button
{
16
public
:
17
ButtonAggregator
();
18
virtual
~ButtonAggregator
();
19
20
void
onTimer
()
override
;
21
void
handleAction(
int
event,
int
action)
override
;
22
bool
addButton(
Supla::Control::Button
* button);
23
24
protected
:
25
Supla::Control::Button
* buttons[BUTTON_AGGREGATOR_MAX_BUTTONS] = {};
26
int
pressCount = 0;
27
int
buttonCount = 0;
28
bool
stateChanged =
false
;
29
uint32_t allPressedTimestamp = 0;
30
};
31
32
}
// namespace Control
33
}
// namespace Supla
34
35
#endif
// SRC_SUPLA_CONTROL_BUTTON_AGGREGATOR_H_
Supla::Control::ButtonAggregator
Definition
button_aggregator.h:15
Supla::Control::ButtonAggregator::onTimer
void onTimer() override
Method called on timer interupt.
Definition
button_aggregator.cpp:18
Supla::Control::Button
Definition
button.h:21
Generated by
1.12.0