reset flg event
This commit is contained in:
parent
1231af39f5
commit
994a03075c
8 changed files with 5479 additions and 5457 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -785,6 +785,7 @@ static void peripheralStateReadRssiCB( int8_t rssi )
|
|||
break;
|
||||
|
||||
case GAPROLE_CONNECTED:
|
||||
adv_wrk.adv_event = 0;
|
||||
adv_wrk.adv_count = 0;
|
||||
adv_wrk.adv_reload_count = 0;
|
||||
#if (DEV_SERVICES & SERVICE_THS)
|
||||
|
|
@ -809,6 +810,7 @@ static void peripheralStateReadRssiCB( int8_t rssi )
|
|||
osal_stop_timerEx(simpleBLEPeripheral_TaskID, TIMER_BATT_EVT);
|
||||
bthome_data_beacon((void *) gapRole_AdvertData);
|
||||
gapRole_SlaveLatency = periConnParameters.latency = cfg.connect_latency;
|
||||
adv_wrk.adv_event = 0;
|
||||
adv_wrk.adv_count = 0;
|
||||
adv_wrk.adv_reload_count = 1;
|
||||
#if (DEV_SERVICES & SERVICE_SCREEN)
|
||||
|
|
|
|||
|
|
@ -1230,18 +1230,37 @@ function customBlkParse(value) {
|
|||
$('lblTemp').innerHTML = temp + ' °C';
|
||||
$('lblHumi').innerHTML = humi + ' %RH';
|
||||
$('lblBat').innerHTML = pbat + ' % (' + vbat / 1000 + ' V)';
|
||||
let so = "";
|
||||
if(len > 10) {
|
||||
flg = value.getUint8(10);
|
||||
s += ", флаги: 0x" + hex(flg,2);
|
||||
$('lblTrg').innerHTML = "In: " + (flg&1)
|
||||
|
||||
so = "In: " + (flg&1)
|
||||
+ ", Out: " + ((flg&2)? 1:0)
|
||||
+ ", Cmf: " + ((flg&4)? 1:0)
|
||||
+ ", Te: " + ((flg&16)? 1:0)
|
||||
+ ", He: " + ((flg&32)? 1:0);
|
||||
}
|
||||
if(len > 14) {
|
||||
devtime.cur = value.getUint32(11,true);
|
||||
//console.log('Device Time: 0x' + hex(devtime.cur, 8));
|
||||
let dt = new Date(devtime.cur * 1000);
|
||||
let sDateTime = (dt.toISOString().slice(0, -5)).replace('T',' ');
|
||||
$('lblTime').innerHTML = sDateTime
|
||||
let time = Date.now() / 1000 - (new Date()).getTimezoneOffset() * 60;
|
||||
let delta = devtime.cur - time;
|
||||
console.log('Время на устройстве: ' + sDateTime + ', Уход: ' + Math.round(delta) + ' сек');
|
||||
if(len > 18) {
|
||||
rds_count = value.getUint32(15,true);
|
||||
s += ", rds: " + rds_count;
|
||||
so += ", rds: " + rds_count;
|
||||
}
|
||||
// if(delta > 10 || delta < -10) setDevTime();
|
||||
}
|
||||
$('lblTrg').innerHTML = so;
|
||||
console.log(s);
|
||||
if(rend) ShowGrf(temp, humi);
|
||||
getDevTime();
|
||||
|
||||
} else if((blkId == 0x25 || blkId == 0x26) && (len > 12)) {
|
||||
// CMD_ID_CFS Get/Set sensor config
|
||||
devcfs.temp_k = value.getUint32(1, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue