upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
t8100.hpp
1 /*
2  * Author: Jon Trulson <jtrulson@ics.com>
3  * Copyright (c) 2016 Intel Corporation.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining
6  * a copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sublicense, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject to
11  * the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 #pragma once
25 
26 #include <string>
27 #include <map>
28 
29 #include "bacnetmstp.hpp"
30 #include "bacnetutil.hpp"
31 
32 namespace upm {
33 
79  class T8100 : public BACNETUTIL {
80  public:
81 
82  // Supported Analog Value Objects. These are readable and writable.
83  typedef enum : uint32_t {
84  AV_Temperature_Offset = 1,
85  AV_RH_Offset = 2,
86  AV_Relay_Set_Point = 3,
87  AV_Relay_Hysteresis = 4,
88  AV_Elevation = 5,
89  AV_Calibration_Single_Point = 6,
90  AV_Baud_Rate = 7,
91  AV_MAC_Address = 8
92  } ANALOG_VALUES_T;
93 
94  // Supported Analog Input Objects. These are read only.
95  typedef enum : uint32_t {
96  AI_CO2 = 1,
97  AI_Relative_Humidity = 2,
98  AI_Temperature_ChipCap = 3,
99  AI_Temperature_Thermistor = 4
100  } ANALOG_INPUTS_T;
101 
102  // Supported Binary Value Objects. These are readable and writable.
103  typedef enum : uint32_t {
104  BV_Temperature_Units = 1,
105  BV_ABC_Logic_State = 2,
106  BV_ABC_Logic_Reset = 3,
107  BV_CO2_Calibration = 4
108  } BINARY_VALUES_T;
109 
110  // Supported Binary Input Objects. These are read only.
111  typedef enum : uint32_t {
112  BI_Relay_State = 1
113  } BINARY_INPUTS_T;
114 
115 
128  T8100(uint32_t targetDeviceObjectID);
129 
133  ~T8100();
134 
141  void update();
142 
149  float getHumidity()
150  {
151  return m_humidity;
152  }
153 
160  float getCO2()
161  {
162  return m_co2;
163  }
164 
174  float getTemperature(bool fahrenheit=false);
175 
184  {
185  return m_relayState;
186  }
187 
197  void setTemperatureScale(bool fahrenheit);
198 
204  bool getTemperatureScale();
205 
211  float getTemperatureOffset();
212 
221  void setTemperatureOffset(float value);
222 
228  float getHumidityOffset();
229 
237  void setHumidityOffset(float value);
238 
246  float getRelaySetPoint();
247 
255  void setRelaySetPoint(float value);
256 
262  float getRelayHysteresis();
263 
269  void setRelayHysteresis(float value);
270 
276  float getElevation();
277 
284  void setElevation(float value);
285 
292 
299  void setCalibrationSinglePoint(float value);
300 
306  float getBaudRate();
307 
314  float getMACAddress();
315 
322  bool getABCLogicState();
323 
330  void setABCLogicState(bool value);
331 
338  bool getABCLogicReset();
339 
346  void setABCLogicReset(bool value);
347 
354  bool getCO2Calibration();
355 
362  void setCO2Calibration(bool value);
363 
364 
365  protected:
366  float m_humidity;
367  // always stored in C
368  float m_temperature;
369  float m_co2;
370  bool m_relayState;
371 
372  private:
373  // Have we checked the device's temperature unit setting yet
374  bool m_isTempInitialized;
375 
376  // Is the device configured for Celsius?
377  bool m_isCelsius;
378  };
379 }
void setABCLogicReset(bool value)
Definition: t8100.cxx:241
float getBaudRate()
Definition: t8100.cxx:216
void setRelaySetPoint(float value)
Definition: t8100.cxx:157
float getTemperatureOffset()
Definition: t8100.cxx:117
bool getABCLogicState()
Definition: t8100.cxx:226
void setRelayHysteresis(float value)
Definition: t8100.cxx:173
float getRelayHysteresis()
Definition: t8100.cxx:168
float getCO2()
Definition: t8100.hpp:160
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
void setCalibrationSinglePoint(float value)
Definition: t8100.cxx:205
bool getCO2Calibration()
Definition: t8100.cxx:246
float getMACAddress()
Definition: t8100.cxx:221
void setABCLogicState(bool value)
Definition: t8100.cxx:231
float getHumidityOffset()
Definition: t8100.cxx:136
float getElevation()
Definition: t8100.cxx:184
float getTemperature(bool fahrenheit=false)
Definition: t8100.cxx:91
~T8100()
Definition: t8100.cxx:67
void setHumidityOffset(float value)
Definition: t8100.cxx:141
float getRelaySetPoint()
Definition: t8100.cxx:152
void setElevation(float value)
Definition: t8100.cxx:189
UPM Utility API for BACnet.
Definition: bacnetutil.hpp:50
void setTemperatureScale(bool fahrenheit)
Definition: t8100.cxx:99
UPM API for the Amphenol Telaire Ventostat T8100 Ventilation Controller.
Definition: t8100.hpp:79
T8100(uint32_t targetDeviceObjectID)
Definition: t8100.cxx:50
bool getTemperatureScale()
Definition: t8100.cxx:107
void update()
Definition: t8100.cxx:71
void setTemperatureOffset(float value)
Definition: t8100.cxx:122
bool getRelayState()
Definition: t8100.hpp:183
float getHumidity()
Definition: t8100.hpp:149
void setCO2Calibration(bool value)
Definition: t8100.cxx:251
float getCalibrationSinglePoint()
Definition: t8100.cxx:200
bool getABCLogicReset()
Definition: t8100.cxx:236