mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-29 07:32:18 +03:00
time recv Ble
This commit is contained in:
@@ -18,7 +18,7 @@ private:
|
||||
// описание параметров передаваемых из настроек датчика из веба
|
||||
String _MAC;
|
||||
String _sensor;
|
||||
|
||||
int timeRecv;
|
||||
public:
|
||||
String whoIAm(/*String &mac, String &sens*/)
|
||||
{
|
||||
@@ -31,11 +31,11 @@ public:
|
||||
{
|
||||
if (_sensor == "last")
|
||||
{
|
||||
int valInt = extBLEdata[_sensor].as<int>();
|
||||
timeRecv = extBLEdata[_sensor].as<int>();
|
||||
char *s;
|
||||
s = TimeToString(millis() / 1000 - valInt / 1000);
|
||||
s = TimeToString(millis() / 1000 - timeRecv / 1000);
|
||||
value.isDecimal = 0;
|
||||
if (valInt > 0)
|
||||
if (timeRecv > 0)
|
||||
{
|
||||
value.valS = s;
|
||||
}
|
||||
@@ -82,6 +82,25 @@ public:
|
||||
return str;
|
||||
}
|
||||
|
||||
void doByInterval()
|
||||
{
|
||||
if (_sensor == "last")
|
||||
{
|
||||
char *s;
|
||||
s = TimeToString(millis() / 1000 - timeRecv / 1000);
|
||||
value.isDecimal = 0;
|
||||
if (timeRecv > 0)
|
||||
{
|
||||
value.valS = s;
|
||||
}
|
||||
else
|
||||
{
|
||||
value.valS = "";
|
||||
}
|
||||
regEvent(value.valS, _id);
|
||||
}
|
||||
}
|
||||
|
||||
BleSens(String parameters) : IoTItem(parameters)
|
||||
{
|
||||
_MAC = jsonReadStr(parameters, "MAC");
|
||||
|
||||
Reference in New Issue
Block a user