GCC Code Coverage Report


Directory: ./
File: ecapp/ConfigurableChannelCount.h
Date: 2026-09-03 16:05:57
Exec Total Coverage
Lines: 2 2 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /*****************************************************************************
2 *
3 * This file is part of the ecapp library (EtherCAT application devices).
4 *
5 * Copyright (C) 2026 Florian Pose <fp@igh.de>
6 *
7 * The ecapp library is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation, version 3 of the
10 * License.
11 *
12 * The ecapp library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with the ecapp library. If not, see
19 * <https://www.gnu.org/licenses/>.
20 *
21 ****************************************************************************/
22
23 #ifndef ECAPP_CONFIGURABLECHANNELCOUNT_H
24 #define ECAPP_CONFIGURABLECHANNELCOUNT_H
25
26 /****************************************************************************/
27
28 #include "ecapp/Capability.h"
29 #include "ecapp_export.h"
30
31 /****************************************************************************/
32
33 namespace EcApp {
34
35 /** Capability for a device whose channel count is not fixed by its
36 * type -- e.g. a modular valve terminal (see Festo) whose PDO layout
37 * reserves a fixed number of bits, but where how many of them an
38 * installation actually uses varies by how many valve modules are
39 * physically attached. Not every SubDevice implements this -- use
40 * EcApp::capability<ConfigurableChannelCount>(device), which throws
41 * UnsupportedCapability for a device with a fixed channel count.
42 *
43 * Unlike IoLinkMaster::setPortDevice()/applyPortConfig(), there is
44 * nothing here to aggregate across several independent calls before a
45 * combined PDO/SDO push -- the channel count doesn't change the
46 * slave's PDO structure (a fixed number of bits is always reserved),
47 * only how many of them this device exposes as channels. One call
48 * does everything: outputKinds() reflects the new count immediately
49 * afterwards. Still call it once, before the master is activated,
50 * like any other one-time device setup. */
51 2 class ECAPP_EXPORT ConfigurableChannelCount
52 {
53 public:
54 2 virtual ~ConfigurableChannelCount() = default;
55
56 virtual void setChannelCount(unsigned int count) = 0;
57 };
58
59 } // namespace EcApp
60
61 #endif // ECAPP_CONFIGURABLECHANNELCOUNT_H
62
63 /****************************************************************************/
64