supla-device
Loading...
Searching...
No Matches
src
supla
sensor
binary.h
1
// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2
// SPDX-License-Identifier: GPL-2.0-or-later
3
4
#ifndef SRC_SUPLA_SENSOR_BINARY_H_
5
#define SRC_SUPLA_SENSOR_BINARY_H_
6
7
#include <supla/io.h>
8
#include <supla/sensor/binary_base.h>
9
10
namespace
Supla {
11
12
namespace
Io {
13
}
14
15
namespace
Sensor {
16
class
Binary
:
public
BinaryBase
{
17
public
:
18
explicit
Binary
(
Supla::Io::IoPin
inputPin);
19
explicit
Binary
(
Supla::Io::Base
*io,
20
int
pin,
21
bool
pullUp =
false
,
22
bool
invertLogic =
false
);
23
explicit
Binary
(
int
pin,
bool
pullUp =
false
,
bool
invertLogic =
false
);
24
bool
getValue()
override
;
25
void
onInit
()
override
;
26
27
protected
:
28
Supla::Io::IoPin
inputPin;
29
bool
newStateCandidateValue =
false
;
30
bool
prevValue =
false
;
31
uint32_t lastStateChangeMs = 0;
32
};
33
34
};
// namespace Sensor
35
};
// namespace Supla
36
37
#endif
// SRC_SUPLA_SENSOR_BINARY_H_
Supla::Io::Base
Definition
io.h:23
Supla::Sensor::BinaryBase
Definition
binary_base.h:35
Supla::Sensor::Binary
Definition
binary.h:16
Supla::Sensor::Binary::onInit
void onInit() override
Third method called on element in SuplaDevice.begin()
Definition
binary.cpp:49
Supla::Io::IoPin
Definition
io_pin.h:14
Generated by
1.12.0