From 40c02a4f4fa7bd57f4db06d1d34c8ba22c0d5165 Mon Sep 17 00:00:00 2001 From: "CSSC-WORK\\murmur" Date: Mon, 11 Sep 2023 18:36:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=91=8A=E8=AD=A6=E5=BC=80?= =?UTF-8?q?=E5=85=B3=E5=8A=9F=E8=83=BD=20=E6=9B=B4=E6=96=B0=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=8A=E6=8A=A5=E6=8C=87=E4=BB=A4=5FINFO=5FLOCATION?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- applications/core.c | 1 + applications/func/func.c | 8 +++++--- applications/func/func.h | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/applications/core.c b/applications/core.c index ef81289..53dab3a 100644 --- a/applications/core.c +++ b/applications/core.c @@ -184,6 +184,7 @@ static void initCfg(void) scfg.maxSizePerFile = get_cfg("maxSizePerFile"); scfg.locRepInterval = get_cfg("locRepInterval"); scfg.isMaWin = get_cfg("isMaWin"); + scfg.locAlert = get_cfg("locAlert"); char str[sizeof(scfg.openWindowTime)*4]; get_cfgs("openWindowTime", str); diff --git a/applications/func/func.c b/applications/func/func.c index 8fbd6a8..da0af06 100644 --- a/applications/func/func.c +++ b/applications/func/func.c @@ -675,7 +675,7 @@ void reportSysCfg() static int packLocMsg(uint8_t *dout) { uint8_t alertMsg[200] = - { 0x5A, 0xA5, ADDR_ANJI, ADDR_TT, _CFG_LOCATION_ALERT >> 8, _CFG_LOCATION_ALERT & 0xFF, 0, 0 }; + { 0x5A, 0xA5, ADDR_ANJI, ADDR_TT, _INFO_LOCATION >> 8, _INFO_LOCATION & 0xFF, 0, 0 }; alertMsg[8] = 0; //首字节00为定时发送,未检测围栏;其它为在围栏外 @@ -814,7 +814,7 @@ void reportLoc_thread_entry(void *parameter) //检测是否在围栏内 uint8_t isLocOk[]={0x37,0x37,0x37}; - if (memcmp(rst+len-11-4,isLocOk,sizeof(isLocOk)) != 0 && !isInFence(rst+len-11-4))//不在围栏内。定位正常才判断围栏 + if (scfg.locAlert && memcmp(rst+len-11-4,isLocOk,sizeof(isLocOk)) != 0 && !isInFence(rst+len-11-4))//不在围栏内。定位正常才判断围栏 { rst[8] |= 1<<7; isReadyToSendLoc = 1; @@ -902,7 +902,9 @@ static int isInPolgon(float x, float y) */ void setLocationAlertSWT(int setON) { - + LOG_I("FUNC = set Loc Alert"); + scfg.locAlert = setON; + set_cfg("locAlert", setON); } /** diff --git a/applications/func/func.h b/applications/func/func.h index 0905ce9..65e4d64 100644 --- a/applications/func/func.h +++ b/applications/func/func.h @@ -62,6 +62,7 @@ enum #define _CMD_CLOSE_WINDOW 0x1905 // 执行手动关窗 #define _CFG_LOCATION_ALERT 0x7004// 配置位置告警 +#define _INFO_LOCATION 0x7011 #define _CMD_CLEAR_DATA 0x7005 // 执行清空数据