mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
@@ -18,7 +18,7 @@ private:
|
|||||||
// описание параметров передаваемых из настроек датчика из веба
|
// описание параметров передаваемых из настроек датчика из веба
|
||||||
String _MAC;
|
String _MAC;
|
||||||
String _sensor;
|
String _sensor;
|
||||||
|
int timeRecv;
|
||||||
public:
|
public:
|
||||||
String whoIAm(/*String &mac, String &sens*/)
|
String whoIAm(/*String &mac, String &sens*/)
|
||||||
{
|
{
|
||||||
@@ -31,11 +31,11 @@ public:
|
|||||||
{
|
{
|
||||||
if (_sensor == "last")
|
if (_sensor == "last")
|
||||||
{
|
{
|
||||||
int valInt = extBLEdata[_sensor].as<int>();
|
timeRecv = extBLEdata[_sensor].as<int>();
|
||||||
char *s;
|
char *s;
|
||||||
s = TimeToString(millis() / 1000 - valInt / 1000);
|
s = TimeToString(millis() / 1000 - timeRecv / 1000);
|
||||||
value.isDecimal = 0;
|
value.isDecimal = 0;
|
||||||
if (valInt > 0)
|
if (timeRecv > 0)
|
||||||
{
|
{
|
||||||
value.valS = s;
|
value.valS = s;
|
||||||
}
|
}
|
||||||
@@ -82,6 +82,25 @@ public:
|
|||||||
return str;
|
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)
|
BleSens(String parameters) : IoTItem(parameters)
|
||||||
{
|
{
|
||||||
_MAC = jsonReadStr(parameters, "MAC");
|
_MAC = jsonReadStr(parameters, "MAC");
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
"page": "Сенсоры",
|
"page": "Сенсоры",
|
||||||
"descr": "",
|
"descr": "",
|
||||||
"needSave": 0,
|
"needSave": 0,
|
||||||
|
"int": 30,
|
||||||
"global": 0,
|
"global": 0,
|
||||||
"round": 1,
|
"round": 1,
|
||||||
"MAC": "",
|
"MAC": "",
|
||||||
@@ -48,7 +49,7 @@
|
|||||||
"moduleDesc": "Позволяет получить данные с Bluetooth часов и термометров Mijia, Xiaomi, Cleargrass, ...",
|
"moduleDesc": "Позволяет получить данные с Bluetooth часов и термометров Mijia, Xiaomi, Cleargrass, ...",
|
||||||
"propInfo": {
|
"propInfo": {
|
||||||
"round": "Округление после запятой.",
|
"round": "Округление после запятой.",
|
||||||
"int": "Интервал сканирования BLE окружения (BleScan) / В BleSens не используется, там обновляется по мене сканирования/поступления",
|
"int": "Интервал сканирования BLE окружения (BleScan) / В BleSens темп обновления времнени поступления данных, сами даные обновляются по мене сканирования/поступления",
|
||||||
"scanDuration": "Длительность сканирования ",
|
"scanDuration": "Длительность сканирования ",
|
||||||
"filter": "Позволяет установить фильтр по параметру передаваемому датчиком. Влияет только на вывод лога при debug=1, что бы было легче найти датчики, если много устройств в эфире",
|
"filter": "Позволяет установить фильтр по параметру передаваемому датчиком. Влияет только на вывод лога при debug=1, что бы было легче найти датчики, если много устройств в эфире",
|
||||||
"MAC": "MAC адрес беспроводного датчика",
|
"MAC": "MAC адрес беспроводного датчика",
|
||||||
@@ -59,27 +60,27 @@
|
|||||||
"usedLibs": {
|
"usedLibs": {
|
||||||
"esp32_4mb": [
|
"esp32_4mb": [
|
||||||
"https://github.com/h2zero/NimBLE-Arduino.git",
|
"https://github.com/h2zero/NimBLE-Arduino.git",
|
||||||
"https://github.com/avaksru/decoder.git"
|
"https://github.com/Mit4el/decoder.git"
|
||||||
],
|
],
|
||||||
"esp32_16mb": [
|
"esp32_16mb": [
|
||||||
"https://github.com/h2zero/NimBLE-Arduino.git",
|
"https://github.com/h2zero/NimBLE-Arduino.git",
|
||||||
"https://github.com/avaksru/decoder.git"
|
"https://github.com/Mit4el/decoder.git"
|
||||||
],
|
],
|
||||||
"esp32_4mb3f": [
|
"esp32_4mb3f": [
|
||||||
"https://github.com/h2zero/NimBLE-Arduino.git",
|
"https://github.com/h2zero/NimBLE-Arduino.git",
|
||||||
"https://github.com/avaksru/decoder.git"
|
"https://github.com/Mit4el/decoder.git"
|
||||||
],
|
],
|
||||||
"esp32cam_4mb": [
|
"esp32cam_4mb": [
|
||||||
"https://github.com/h2zero/NimBLE-Arduino.git",
|
"https://github.com/h2zero/NimBLE-Arduino.git",
|
||||||
"https://github.com/avaksru/decoder.git"
|
"https://github.com/Mit4el/decoder.git"
|
||||||
],
|
],
|
||||||
"esp32s3_16mb": [
|
"esp32s3_16mb": [
|
||||||
"https://github.com/h2zero/NimBLE-Arduino.git",
|
"https://github.com/h2zero/NimBLE-Arduino.git",
|
||||||
"https://github.com/avaksru/decoder.git"
|
"https://github.com/Mit4el/decoder.git"
|
||||||
],
|
],
|
||||||
"esp32c3m_4mb": [
|
"esp32c3m_4mb": [
|
||||||
"https://github.com/h2zero/NimBLE-Arduino.git",
|
"https://github.com/h2zero/NimBLE-Arduino.git",
|
||||||
"https://github.com/avaksru/decoder.git"
|
"https://github.com/Mit4el/decoder.git"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user