SpaIot Library
hardwaresettings.h
1/*
2 * SpaIot Library (c) by epsilonrt - epsilonrt@gmail.com
3 * This file is part of SpaIot library <https://github.com/epsilonrt/spaiot-lib>
4 *
5 * SpaIot library is licensed under a
6 * Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
7 *
8 * You should have received a copy of the license along with this
9 * work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
10 *
11 * SpaIot library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY;
13 */
14#pragma once
15
16#include <Arduino.h>
17#include "bussettings.h"
18#include "buttonsettings.h"
19
20namespace SpaIot {
21
26 class HardwareSettings {
27 public:
31 HardwareSettings();
38 HardwareSettings (const BusSettings & bus,
39 const std::map <int, LedSettings> & leds,
40 const std::map <int, ButtonSettings> & buttons);
41
46 bool isNull() const;
51 const BusSettings & bus() const;
56 const std::map <int, LedSettings> & leds() const;
61 const std::map <int, ButtonSettings> & buttons() const;
66 bool operator== (const HardwareSettings &other) const;
71 bool operator!= (const HardwareSettings &other) const;
72#ifndef NODEBUG_SPAIOT
77 void print(Print &out) const;
78#endif
85 static bool addToRegister (const std::string & name, const HardwareSettings & settings);
91 static const HardwareSettings & getFromRegister (const std::string & name);
97 static bool registerContains (const std::string & name);
98
99 private:
100 const BusSettings * m_bus;
101 const std::map <int, LedSettings> * m_leds;
102 const std::map <int, ButtonSettings> * m_buttons;
103 static std::map<std::string, const HardwareSettings *> Register;
104 };
105
109 extern const HardwareSettings Scip2Ssp;
113 extern const HardwareSettings Scip2Sjb;
114}
SpaIot name space.
Definition: bussettings.h:21