REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
base.h
Go to the documentation of this file.
1// Copyright (c) 2024 anabrid GmbH
2// Contact: https://www.anabrid.com/licensing/
3// SPDX-License-Identifier: MIT OR GPL-2.0-or-later
4
5#pragma once
6
7#include "bus/bus.h"
8#include "entity/entity.h"
9
10namespace blocks {
11
13 // virtual float read_temperature() = 0;
14public:
15 virtual bool init() { return true; }
16
17 virtual std::array<uint8_t, 8> get_entity_eui() const = 0;
18};
19
30public:
32
33 std::vector<Entity *> get_child_entities() override {
34#ifdef ANABRID_DEBUG_ENTITY
35 Serial.println(__PRETTY_FUNCTION__);
36#endif
37 // FunctionBlocks do not give direct access to their children
38 return {};
39 }
40
41 Entity *get_child_entity(const std::string &child_id) override {
42 // FunctionBlocks do not give direct access to their children
43 return nullptr;
44 }
45};
46
47} // namespace blocks
virtual std::array< uint8_t, 8 > get_entity_eui() const =0
virtual bool init()
Definition base.h:15
A function block represents one module in a cluster, such as an M-Block, C-Block, I-Block or U-Block.
Definition base.h:29
std::vector< Entity * > get_child_entities() override
Definition base.h:33
FunctionBlock(std::string entity_id)
Definition base.h:31
Entity * get_child_entity(const std::string &child_id) override
Definition base.h:41
std::string entity_id
Definition base.h:116
Entity()=default
Definition base.h:10
STL namespace.