REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
mode.cpp
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#include "mode/mode.h"
6
7#include "carrier/carrier.h"
8#include "utils/logging.h"
9
10mode::SyncConfig mode::SyncConfig::from_pb(const pb_SyncConfig &buf) {
11 SyncConfig config;
12
13 if (!buf.enabled)
14 return config;
15
16 auto& carrier = carrier::Carrier::get();
17 if (buf.has_master && std::string_view(buf.master.path)== carrier.get_entity_id()) {
18 config.is_master = true;
19 }
20
21 config.enabled = buf.enabled;
22 config.id = buf.group;
23 return config;
24}
Definition daq.h:14