Merge branch 'addFence'

This commit is contained in:
CSSC-WORK\murmur 2023-09-11 18:37:53 +08:00
commit 4531f56592
3 changed files with 7 additions and 3 deletions

View File

@ -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);

View File

@ -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);
}
/**

View File

@ -62,6 +62,7 @@ enum
#define _CMD_CLOSE_WINDOW 0x1905 // 执行手动关窗
#define _CFG_LOCATION_ALERT 0x7004// 配置位置告警
#define _INFO_LOCATION 0x7011
#define _CMD_CLEAR_DATA 0x7005 // 执行清空数据