|
| 1 | +/* |
| 2 | + * Copyright (c) 2024 Arduino |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: MPL-2.0 |
| 5 | + * This Source Code Form is subject to the terms of the Mozilla Public |
| 6 | + * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 | + * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 8 | + */ |
| 9 | + |
| 10 | +#pragma once |
| 11 | + |
| 12 | +/************************************************************************************** |
| 13 | + * INCLUDE |
| 14 | + **************************************************************************************/ |
| 15 | + |
| 16 | +#include <string> |
| 17 | + |
| 18 | +#include "OptaBlue.h" |
| 19 | + |
| 20 | +/************************************************************************************** |
| 21 | + * NAMESPACE |
| 22 | + **************************************************************************************/ |
| 23 | + |
| 24 | +namespace opcua |
| 25 | +{ |
| 26 | + |
| 27 | +/************************************************************************************** |
| 28 | + * CLASS DECLARATION |
| 29 | + **************************************************************************************/ |
| 30 | + |
| 31 | +class ArduinoOptaExpansionType |
| 32 | +{ |
| 33 | +public: |
| 34 | + ArduinoOptaExpansionType() = delete; |
| 35 | + ArduinoOptaExpansionType(ArduinoOptaExpansionType const &) = delete; |
| 36 | + |
| 37 | + static std::string toStr(ExpansionType_t const type) |
| 38 | + { |
| 39 | + if(type == EXPANSION_NOT_VALID) |
| 40 | + return std::string("Invalid"); |
| 41 | + else if(type == EXPANSION_OPTA_DIGITAL_MEC) |
| 42 | + return std::string("Digital [Mech.]"); |
| 43 | + else if(type == EXPANSION_OPTA_DIGITAL_STS) |
| 44 | + return std::string("Digital [Solid]"); |
| 45 | + else if(type == EXPANSION_DIGITAL_INVALID) |
| 46 | + return std::string("Digital [Inva.]"); |
| 47 | + else if(type == EXPANSION_OPTA_ANALOG) |
| 48 | + return std::string("Analog"); |
| 49 | + else |
| 50 | + return std::string("Unknown"); |
| 51 | + } |
| 52 | +}; |
| 53 | + |
| 54 | +/************************************************************************************** |
| 55 | + * NAMESPACE |
| 56 | + **************************************************************************************/ |
| 57 | + |
| 58 | +} |
0 commit comments