MCPcopy Create free account
hub / github.com/DanielOgorchock/ST_Anything / beSmart

Method beSmart

Arduino/libraries/ST_Anything/PS_PulseCounter.cpp:122–141  ·  view source on GitHub ↗

SmartThings Shield data handler (receives configuration data from ST - polling interval, and adjusts on the fly)

Source from the content-addressed store, hash-verified

120
121 //SmartThings Shield data handler (receives configuration data from ST - polling interval, and adjusts on the fly)
122 void PS_PulseCounter::beSmart(const String &str)
123 {
124 String s = str.substring(str.indexOf(' ') + 1);
125
126 if (s.toInt() != 0) {
127 st::PollingSensor::setInterval(s.toInt() * 1000);
128 if (st::PollingSensor::debug) {
129 Serial.print(F("PS_PulseCounter::beSmart set polling interval to "));
130 Serial.println(s.toInt());
131 }
132 }
133 else {
134 if (st::PollingSensor::debug)
135 {
136 Serial.print(F("PS_PulseCounter::beSmart cannot convert "));
137 Serial.print(s);
138 Serial.println(F(" to an Integer."));
139 }
140 }
141 }
142
143 //function to get data from sensor and queue results for transfer to ST Cloud
144 void PS_PulseCounter::getData()

Callers

nothing calls this directly

Calls 2

printMethod · 0.80
printlnMethod · 0.80

Tested by

no test coverage detected