diff --git a/_a_t_c___mi_thermometer_8h_source.html b/_a_t_c___mi_thermometer_8h_source.html index 8842efa..1fad3f1 100644 --- a/_a_t_c___mi_thermometer_8h_source.html +++ b/_a_t_c___mi_thermometer_8h_source.html @@ -126,80 +126,84 @@
39 // History:
40 //
41 // 20221123 Created
-
42 //
-
43 // ToDo:
-
44 // -
-
45 //
-
47 
-
48 #ifndef ATC_MiThermometer_h
-
49 #define ATC_MiThermometer_h
-
50 
-
51 #include <Arduino.h>
-
52 #include <NimBLEDevice.h>
-
53 #include <string>
+
42 // 20240403 Added reedSwitchState, gpioTrgOutput, controlParameters,
+
43 // tempTriggerEvent &humiTriggerEvent
+
44 // 20240425 Added device name
+
45 // 20240426 Added parameter activeScan to begin()
+
46 //
+
47 // ToDo:
+
48 // -
+
49 //
+
51 
+
52 #ifndef ATC_MiThermometer_h
+
53 #define ATC_MiThermometer_h
54 
-
55 
-
56 // MiThermometer data struct / type
-
57 struct MiThData_S {
-
58  bool valid;
-
59  std::string name;
-
60  int16_t temperature;
-
61  uint16_t humidity;
-
62  uint16_t batt_voltage;
-
63  uint8_t batt_level;
-
64  int16_t rssi;
-
65  uint8_t count;
-
66  bool reedSwitchState;
-
67  bool gpioTrgOutput;
-
68  bool controlParameters;
-
69  bool tempTriggerEvent;
-
70  bool humiTriggerEvent;
-
71 
-
72 };
-
73 
-
74 typedef struct MiThData_S MiThData_t;
+
55 #include <Arduino.h>
+
56 #include <NimBLEDevice.h>
+
57 #include <string>
+
58 
+
59 
+
60 // MiThermometer data struct / type
+
61 struct MiThData_S {
+
62  bool valid;
+
63  std::string name;
+
64  int16_t temperature;
+
65  uint16_t humidity;
+
66  uint16_t batt_voltage;
+
67  uint8_t batt_level;
+
68  int16_t rssi;
+
69  uint8_t count;
+
70  bool reedSwitchState;
+
71  bool gpioTrgOutput;
+
72  bool controlParameters;
+
73  bool tempTriggerEvent;
+
74  bool humiTriggerEvent;
75 
-
76 
-
82 class ATC_MiThermometer {
-
83  public:
-
89  ATC_MiThermometer(std::vector<std::string> known_sensors) {
-
90  _known_sensors = known_sensors;
-
91  data.resize(known_sensors.size());
-
92  };
-
93 
-
97  void begin(void);
-
98 
-
102  void clearScanResults(void) {
-
103  _pBLEScan->clearResults();
-
104  };
-
105 
-
111  unsigned getData(uint32_t duration);
-
112 
-
116  void resetData(void);
-
117 
-
121  std::vector<MiThData_t> data;
-
122 
-
123  protected:
-
124  std::vector<std::string> _known_sensors;
-
125  NimBLEScan* _pBLEScan;
-
126 };
-
127 #endif
-
ATC_MiThermometer
BLE ATC_MiThermometer thermometer/hygrometer sensor client.
Definition: ATC_MiThermometer.h:82
-
ATC_MiThermometer::begin
void begin(void)
Initialization.
Definition: ATC_MiThermometer.cpp:76
-
ATC_MiThermometer::resetData
void resetData(void)
Set sensor data invalid.
Definition: ATC_MiThermometer.cpp:183
-
ATC_MiThermometer::data
std::vector< MiThData_t > data
Sensor data.
Definition: ATC_MiThermometer.h:121
-
ATC_MiThermometer::getData
unsigned getData(uint32_t duration)
Get data from sensors by running a BLE scan.
Definition: ATC_MiThermometer.cpp:89
-
ATC_MiThermometer::ATC_MiThermometer
ATC_MiThermometer(std::vector< std::string > known_sensors)
Constructor.
Definition: ATC_MiThermometer.h:89
-
ATC_MiThermometer::clearScanResults
void clearScanResults(void)
Delete results from BLEScan buffer to release memory.
Definition: ATC_MiThermometer.h:102
-
MiThData_S
Definition: ATC_MiThermometer.h:57
-
MiThData_S::batt_level
uint8_t batt_level
battery level [%]
Definition: ATC_MiThermometer.h:63
-
MiThData_S::name
std::string name
BT device name.
Definition: ATC_MiThermometer.h:59
-
MiThData_S::valid
bool valid
data valid
Definition: ATC_MiThermometer.h:58
-
MiThData_S::humidity
uint16_t humidity
humidity x 100%
Definition: ATC_MiThermometer.h:61
-
MiThData_S::count
uint8_t count
measurement count
Definition: ATC_MiThermometer.h:65
-
MiThData_S::temperature
int16_t temperature
temperature x 100°C
Definition: ATC_MiThermometer.h:60
-
MiThData_S::batt_voltage
uint16_t batt_voltage
battery voltage [mv]
Definition: ATC_MiThermometer.h:62
-
MiThData_S::rssi
int16_t rssi
RSSI [dBm].
Definition: ATC_MiThermometer.h:64
+
76 };
+
77 
+
78 typedef struct MiThData_S MiThData_t;
+
79 
+
80 
+
86 class ATC_MiThermometer {
+
87  public:
+
93  ATC_MiThermometer(std::vector<std::string> known_sensors) {
+
94  _known_sensors = known_sensors;
+
95  data.resize(known_sensors.size());
+
96  };
+
97 
+
105  void begin(bool activeScan = true);
+
106 
+
110  void clearScanResults(void) {
+
111  _pBLEScan->clearResults();
+
112  };
+
113 
+
119  unsigned getData(uint32_t duration);
+
120 
+
124  void resetData(void);
+
125 
+
129  std::vector<MiThData_t> data;
+
130 
+
131  protected:
+
132  std::vector<std::string> _known_sensors;
+
133  NimBLEScan* _pBLEScan;
+
134 };
+
135 #endif
+
ATC_MiThermometer
BLE ATC_MiThermometer thermometer/hygrometer sensor client.
Definition: ATC_MiThermometer.h:86
+
ATC_MiThermometer::resetData
void resetData(void)
Set sensor data invalid.
Definition: ATC_MiThermometer.cpp:186
+
ATC_MiThermometer::data
std::vector< MiThData_t > data
Sensor data.
Definition: ATC_MiThermometer.h:129
+
ATC_MiThermometer::begin
void begin(bool activeScan=true)
Initialization.
Definition: ATC_MiThermometer.cpp:79
+
ATC_MiThermometer::getData
unsigned getData(uint32_t duration)
Get data from sensors by running a BLE scan.
Definition: ATC_MiThermometer.cpp:92
+
ATC_MiThermometer::ATC_MiThermometer
ATC_MiThermometer(std::vector< std::string > known_sensors)
Constructor.
Definition: ATC_MiThermometer.h:93
+
ATC_MiThermometer::clearScanResults
void clearScanResults(void)
Delete results from BLEScan buffer to release memory.
Definition: ATC_MiThermometer.h:110
+
MiThData_S
Definition: ATC_MiThermometer.h:61
+
MiThData_S::batt_level
uint8_t batt_level
battery level [%]
Definition: ATC_MiThermometer.h:67
+
MiThData_S::name
std::string name
BT device name.
Definition: ATC_MiThermometer.h:63
+
MiThData_S::valid
bool valid
data valid
Definition: ATC_MiThermometer.h:62
+
MiThData_S::humidity
uint16_t humidity
humidity x 100%
Definition: ATC_MiThermometer.h:65
+
MiThData_S::count
uint8_t count
measurement count
Definition: ATC_MiThermometer.h:69
+
MiThData_S::temperature
int16_t temperature
temperature x 100°C
Definition: ATC_MiThermometer.h:64
+
MiThData_S::batt_voltage
uint16_t batt_voltage
battery voltage [mv]
Definition: ATC_MiThermometer.h:66
+
MiThData_S::rssi
int16_t rssi
RSSI [dBm].
Definition: ATC_MiThermometer.h:68
diff --git a/class_a_t_c___mi_thermometer-members.html b/class_a_t_c___mi_thermometer-members.html index 3814cde..9b114c5 100644 --- a/class_a_t_c___mi_thermometer-members.html +++ b/class_a_t_c___mi_thermometer-members.html @@ -90,7 +90,7 @@

This is the complete list of members for ATC_MiThermometer, including all inherited members.

- + diff --git a/class_a_t_c___mi_thermometer.html b/class_a_t_c___mi_thermometer.html index 5c05aea..efffa27 100644 --- a/class_a_t_c___mi_thermometer.html +++ b/class_a_t_c___mi_thermometer.html @@ -101,10 +101,9 @@ - - - + + + @@ -162,6 +161,32 @@

Member Function Documentation

+ +

◆ begin()

+ +
+
+
ATC_MiThermometer(std::vector< std::string > known_sensors)ATC_MiThermometerinline
begin(void)ATC_MiThermometer
begin(bool activeScan=true)ATC_MiThermometer
clearScanResults(void)ATC_MiThermometerinline
dataATC_MiThermometer
getData(uint32_t duration)ATC_MiThermometer
 ATC_MiThermometer (std::vector< std::string > known_sensors)
 Constructor. More...
 
-void begin (void)
 Initialization.
 
void begin (bool activeScan=true)
 Initialization. More...
 
void clearScanResults (void)
 Delete results from BLEScan buffer to release memory.
+ + + + + + + +
void ATC_MiThermometer::begin (bool activeScan = true)
+
+ +

Initialization.

+
Parameters
+ + +
activeScanSet to true for achtive scan, which uses more power, but get results faster. As a side effect, the device name is received (most of the times).
+
+
+ +
+

◆ getData()

diff --git a/class_a_t_c___mi_thermometer.js b/class_a_t_c___mi_thermometer.js index c357923..825425b 100644 --- a/class_a_t_c___mi_thermometer.js +++ b/class_a_t_c___mi_thermometer.js @@ -1,7 +1,7 @@ var class_a_t_c___mi_thermometer = [ [ "ATC_MiThermometer", "class_a_t_c___mi_thermometer.html#af8bb1ea6e709d0032821a0792c05b0c1", null ], - [ "begin", "class_a_t_c___mi_thermometer.html#a02374900efd29ea98378666b158e5139", null ], + [ "begin", "class_a_t_c___mi_thermometer.html#a5670fa670d155bfce2def7b7ee07accf", null ], [ "clearScanResults", "class_a_t_c___mi_thermometer.html#aff59b5d84a20307db89c2404443dd0c4", null ], [ "getData", "class_a_t_c___mi_thermometer.html#a9ea653d4d465310eb012ad2fc4a345a4", null ], [ "resetData", "class_a_t_c___mi_thermometer.html#a48f7a1a28d8e12a92209ad9ef47cac59", null ], diff --git a/functions.html b/functions.html index 75ada09..ca5756a 100644 --- a/functions.html +++ b/functions.html @@ -93,7 +93,7 @@ : MiThData_S
  • begin() -: ATC_MiThermometer +: ATC_MiThermometer
  • clearScanResults() : ATC_MiThermometer diff --git a/functions_func.html b/functions_func.html index 32312fa..9f7fec5 100644 --- a/functions_func.html +++ b/functions_func.html @@ -87,7 +87,7 @@ : ATC_MiThermometer
  • begin() -: ATC_MiThermometer +: ATC_MiThermometer
  • clearScanResults() : ATC_MiThermometer diff --git a/navtreeindex0.js b/navtreeindex0.js index 4227bf6..2d79558 100644 --- a/navtreeindex0.js +++ b/navtreeindex0.js @@ -3,9 +3,9 @@ var NAVTREEINDEX0 = "_a_t_c___mi_thermometer_8h_source.html":[1,0,0,0], "annotated.html":[0,0], "class_a_t_c___mi_thermometer.html":[0,0,0], -"class_a_t_c___mi_thermometer.html#a02374900efd29ea98378666b158e5139":[0,0,0,1], "class_a_t_c___mi_thermometer.html#a48f7a1a28d8e12a92209ad9ef47cac59":[0,0,0,4], "class_a_t_c___mi_thermometer.html#a511a8627643f52c335f22ffc4fc91b89":[0,0,0,5], +"class_a_t_c___mi_thermometer.html#a5670fa670d155bfce2def7b7ee07accf":[0,0,0,1], "class_a_t_c___mi_thermometer.html#a9ea653d4d465310eb012ad2fc4a345a4":[0,0,0,3], "class_a_t_c___mi_thermometer.html#af8bb1ea6e709d0032821a0792c05b0c1":[0,0,0,0], "class_a_t_c___mi_thermometer.html#aff59b5d84a20307db89c2404443dd0c4":[0,0,0,2], diff --git a/search/all_1.js b/search/all_1.js index 904481c..bd2d6c1 100644 --- a/search/all_1.js +++ b/search/all_1.js @@ -2,5 +2,5 @@ var searchData= [ ['batt_5flevel_1',['batt_level',['../struct_mi_th_data___s.html#a1d77512ebbde9e8138702027869a1dbe',1,'MiThData_S']]], ['batt_5fvoltage_2',['batt_voltage',['../struct_mi_th_data___s.html#ade3171e8150fd05327418c9f375b41b4',1,'MiThData_S']]], - ['begin_3',['begin',['../class_a_t_c___mi_thermometer.html#a02374900efd29ea98378666b158e5139',1,'ATC_MiThermometer']]] + ['begin_3',['begin',['../class_a_t_c___mi_thermometer.html#a5670fa670d155bfce2def7b7ee07accf',1,'ATC_MiThermometer']]] ]; diff --git a/search/functions_1.js b/search/functions_1.js index 69c1ff1..2c64a58 100644 --- a/search/functions_1.js +++ b/search/functions_1.js @@ -1,4 +1,4 @@ var searchData= [ - ['begin_20',['begin',['../class_a_t_c___mi_thermometer.html#a02374900efd29ea98378666b158e5139',1,'ATC_MiThermometer']]] + ['begin_20',['begin',['../class_a_t_c___mi_thermometer.html#a5670fa670d155bfce2def7b7ee07accf',1,'ATC_MiThermometer']]] ];