ifw-fcf  4.1.0-pre2
shutterConfig.hpp
Go to the documentation of this file.
1 
10 #ifndef FCF_DEVMGR_DEVICE_SHUTTER_CONFIG_HPP
11 #define FCF_DEVMGR_DEVICE_SHUTTER_CONFIG_HPP
12 
13 // System headers
14 #include <string>
15 
16 // Third party headers
17 #include <yaml-cpp/yaml.h>
18 
19 #include <utils/bat/logger.hpp>
20 #include <fcf/common/iComm.hpp>
26 
27 namespace fcf::devmgr::shutter {
28 
29  constexpr auto LOGGER_NAME = "shutter";
30  // Constants for internal mapping
31  constexpr auto CI_ACTIVE_LOW_CLOSED = "low_closed";
32  constexpr auto CI_ACTIVE_LOW_FAULT = "low_fault";
33  constexpr auto CI_ACTIVE_LOW_OPEN = "low_open";
34  constexpr auto CI_ACTIVE_LOW_SWITCH = "low_switch";
35  constexpr auto CI_IGNORE_CLOSED = "ignore_closed";
36  constexpr auto CI_IGNORE_FAULT = "ignore_fault";
37  constexpr auto CI_IGNORE_OPEN = "ignore_open";
38  constexpr auto CI_INITIAL_STATE = "initial_state";
39  constexpr auto CI_TIMEOUT = "timeout";
40 
41  constexpr bool DEFAULT_ACTIVE_LOW_CLOSE = false;
42  constexpr bool DEFAULT_ACTIVE_LOW_FAULT = false;
43  constexpr bool DEFAULT_ACTIVE_LOW_OPEN = false;
44  constexpr bool DEFAULT_ACTIVE_LOW_SWITCH = false;
45  constexpr bool DEFAULT_IGNORE_CLOSED = false;
46  constexpr bool DEFAULT_IGNORE_FAULT = false;
47  constexpr bool DEFAULT_IGNORE_OPEN = false;
48  constexpr bool DEFAULT_INITIAL_STATE = false;
49  constexpr unsigned int DEFAULT_TIMEOUT = 10000;
50 
51  // Specific shutter RPC
52  constexpr auto RPC_OPEN = "rpcOpen";
53  constexpr auto RPC_CLOSE = "rpcClose";
54 
55  // Specific constant values for shutter device state/substate
56 
57  constexpr short SUBSTATE_READY_CLOSE = 105;
58  constexpr short SUBSTATE_READY_OPEN = 106;
59  constexpr short SUBSTATE_OP_CLOSE = 212;
60  constexpr short SUBSTATE_OP_CLOSING = 213;
61  constexpr short SUBSTATE_OP_OPEN = 214;
62  constexpr short SUBSTATE_OP_OPENING = 215;
63 
64  constexpr auto SUBSTATE_READY_CLOSE_STR = "Ready/Close";
65  constexpr auto SUBSTATE_READY_OPEN_STR = "Ready/Open";
66  constexpr auto SUBSTATE_OP_CLOSE_STR = "Close";
67  constexpr auto SUBSTATE_OP_CLOSING_STR = "Closing";
68  constexpr auto SUBSTATE_OP_OPEN_STR = "Open";
69  constexpr auto SUBSTATE_OP_OPENING_STR = "Opening";
70 
71 
72  const std::unordered_map<short, std::string> SubstateMap = {
84  };
85 
86 
87 
88 }
89 
90 
91 #endif //FCF_DEVMGR_DEVICE_SHUTTER_CONFIG_HPP
dataContext.hpp
DataContext class header file.
fcf::devmgr::shutter::SUBSTATE_OP_CLOSING
constexpr short SUBSTATE_OP_CLOSING
Definition: shutterConfig.hpp:60
fcf::devmgr::shutter::CI_IGNORE_CLOSED
constexpr auto CI_IGNORE_CLOSED
Definition: shutterConfig.hpp:35
fcf::devmgr::shutter::CI_ACTIVE_LOW_OPEN
constexpr auto CI_ACTIVE_LOW_OPEN
Definition: shutterConfig.hpp:33
fcf::devmgr::shutter::SUBSTATE_OP_OPENING_STR
constexpr auto SUBSTATE_OP_OPENING_STR
Definition: shutterConfig.hpp:69
fcf::devmgr::shutter::SUBSTATE_OP_OPENING
constexpr short SUBSTATE_OP_OPENING
Definition: shutterConfig.hpp:62
fcf::devmgr::shutter::CI_IGNORE_FAULT
constexpr auto CI_IGNORE_FAULT
Definition: shutterConfig.hpp:36
fcf::devmgr::shutter::CI_ACTIVE_LOW_SWITCH
constexpr auto CI_ACTIVE_LOW_SWITCH
Definition: shutterConfig.hpp:34
fcf::devmgr::shutter::SUBSTATE_OP_OPEN_STR
constexpr auto SUBSTATE_OP_OPEN_STR
Definition: shutterConfig.hpp:68
shutterHwErrors.hpp
ShutterHwErrors header file.
fcf::devmgr::shutter::SUBSTATE_READY_OPEN
constexpr short SUBSTATE_READY_OPEN
Definition: shutterConfig.hpp:58
fcf::devmgr::shutter::DEFAULT_ACTIVE_LOW_CLOSE
constexpr bool DEFAULT_ACTIVE_LOW_CLOSE
Definition: shutterConfig.hpp:41
fcf::devmgr::shutter::DEFAULT_INITIAL_STATE
constexpr bool DEFAULT_INITIAL_STATE
Definition: shutterConfig.hpp:48
fcf::devmgr::common::SUBSTATE_OP_DISABLING_STR
constexpr auto SUBSTATE_OP_DISABLING_STR
Definition: deviceConfig.hpp:111
deviceConfig.hpp
DeviceConfig class header file.
fcf::devmgr::shutter::SUBSTATE_OP_OPEN
constexpr short SUBSTATE_OP_OPEN
Definition: shutterConfig.hpp:61
fcf::devmgr::shutter::SUBSTATE_OP_CLOSING_STR
constexpr auto SUBSTATE_OP_CLOSING_STR
Definition: shutterConfig.hpp:67
fcf::devmgr::shutter::RPC_CLOSE
constexpr auto RPC_CLOSE
Definition: shutterConfig.hpp:53
fcf::devmgr::shutter::CI_IGNORE_OPEN
constexpr auto CI_IGNORE_OPEN
Definition: shutterConfig.hpp:37
fcf::devmgr::shutter::DEFAULT_ACTIVE_LOW_SWITCH
constexpr bool DEFAULT_ACTIVE_LOW_SWITCH
Definition: shutterConfig.hpp:44
fcf::devmgr::shutter::SUBSTATE_READY_CLOSE
constexpr short SUBSTATE_READY_CLOSE
Definition: shutterConfig.hpp:57
fcf::devmgr::common::SUBSTATE_OP_DISABLING
constexpr int SUBSTATE_OP_DISABLING
Definition: deviceConfig.hpp:108
fcf::devmgr::shutter::DEFAULT_TIMEOUT
constexpr unsigned int DEFAULT_TIMEOUT
Definition: shutterConfig.hpp:49
fcf::devmgr::shutter::DEFAULT_IGNORE_FAULT
constexpr bool DEFAULT_IGNORE_FAULT
Definition: shutterConfig.hpp:46
fcf::devmgr::shutter::DEFAULT_IGNORE_CLOSED
constexpr bool DEFAULT_IGNORE_CLOSED
Definition: shutterConfig.hpp:45
fcf::devmgr::common::SUBSTATE_NOTREADY_STR
constexpr auto SUBSTATE_NOTREADY_STR
Definition: deviceConfig.hpp:103
configSet.hpp
configSet class header file.
fcf::devmgr::common::SUBSTATE_INITIALISING_STR
constexpr auto SUBSTATE_INITIALISING_STR
Definition: deviceConfig.hpp:104
fcf::devmgr::common::SUBSTATE_NOTREADY
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:98
fcf::devmgr::shutter::SUBSTATE_READY_CLOSE_STR
constexpr auto SUBSTATE_READY_CLOSE_STR
Definition: shutterConfig.hpp:64
fcf::devmgr::shutter::CI_ACTIVE_LOW_FAULT
constexpr auto CI_ACTIVE_LOW_FAULT
Definition: shutterConfig.hpp:32
fcf::devmgr::common::SUBSTATE_INITIALISING
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:100
fcf::devmgr::common::SUBSTATE_OP_ERROR
constexpr int SUBSTATE_OP_ERROR
Definition: deviceConfig.hpp:109
fcf::devmgr::shutter::SUBSTATE_READY_OPEN_STR
constexpr auto SUBSTATE_READY_OPEN_STR
Definition: shutterConfig.hpp:65
fcf::devmgr::shutter::DEFAULT_ACTIVE_LOW_FAULT
constexpr bool DEFAULT_ACTIVE_LOW_FAULT
Definition: shutterConfig.hpp:42
fcf::devmgr::common::SUBSTATE_OP_ERROR_STR
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:112
fcf::devmgr::shutter::CI_TIMEOUT
constexpr auto CI_TIMEOUT
Definition: shutterConfig.hpp:39
fcf::devmgr::common::SUBSTATE_ERROR
constexpr int SUBSTATE_ERROR
Definition: deviceConfig.hpp:101
fcf::devmgr::shutter::LOGGER_NAME
constexpr auto LOGGER_NAME
Definition: shutterConfig.hpp:29
fcf::devmgr::shutter::SUBSTATE_OP_CLOSE_STR
constexpr auto SUBSTATE_OP_CLOSE_STR
Definition: shutterConfig.hpp:66
fcf::devmgr::shutter::SubstateMap
const std::unordered_map< short, std::string > SubstateMap
Definition: shutterConfig.hpp:72
fcf::devmgr::shutter::DEFAULT_IGNORE_OPEN
constexpr bool DEFAULT_IGNORE_OPEN
Definition: shutterConfig.hpp:47
fcf::devmgr::common::SUBSTATE_ERROR_STR
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:106
fcf::devmgr::shutter::SUBSTATE_OP_CLOSE
constexpr short SUBSTATE_OP_CLOSE
Definition: shutterConfig.hpp:59
shutterRpcErrors.hpp
LampRpcErrors header file.
fcf::devmgr::shutter::RPC_OPEN
constexpr auto RPC_OPEN
Definition: shutterConfig.hpp:52
fcf::devmgr::shutter::CI_INITIAL_STATE
constexpr auto CI_INITIAL_STATE
Definition: shutterConfig.hpp:38
fcf::devmgr::shutter::CI_ACTIVE_LOW_CLOSED
constexpr auto CI_ACTIVE_LOW_CLOSED
Definition: shutterConfig.hpp:31
fcf::devmgr::shutter
Definition: shutter.hpp:21
fcf::devmgr::shutter::DEFAULT_ACTIVE_LOW_OPEN
constexpr bool DEFAULT_ACTIVE_LOW_OPEN
Definition: shutterConfig.hpp:43