Skip to content

Commit

Permalink
fix Tamper & Lost
Browse files Browse the repository at this point in the history
  • Loading branch information
captainwong committed Sep 16, 2020
1 parent e0afa05 commit 425624e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,17 @@

### *恒博主机类型与支持的防区属性对照表*

* 防区属性是否支持防拆
* 防区属性是否支持失联报告

||00 匪警全局|01 匪警紧急|02 火警防区|03 胁迫防区|04 燃气防区|05 淹水防区|06 分机|07 遥控器|08 匪警半局|09 屏蔽防区|0A 门铃防区|0F 旁路防区|
|----|----|----|----|----|----|----|----|----|----|----|----|----|
|防拆支持||| || | || || | ||
|失联支持||| || | || || | ||

* 主机类型与支持的防区属性对照表

|事件码|类型|型号|00|01|02|03|04|05|06|07|08|09|0A|0F|
|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
|1707|3|<ul><li>G250</li></ul>|||||||||||||
|1707|3|<ul><li>G250</li></ul>|||||||||||| |
|1717|4|<ul><li>4040G</li><li>5050G</li><li>5050G-4G</li></ul>||||||| || | | | |
|1727|5|<ul><li>BJQ560</li><li>BJQ560B</li></ul>|||||||||||||
|1737|6|<ul><li>4040R</li><li>5050R</li></ul>||||||| || | | | |
Expand Down
6 changes: 3 additions & 3 deletions examples/gen_event_md/gen_event_md.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ void print_available_zone_props()



printf("* 防区属性是否支持防拆\n\n");
printf("* 防区属性是否支持失联报告\n\n");
printf("|");
for (auto zp : all_props) {
printf("|"); print_prop(zp);
Expand All @@ -314,9 +314,9 @@ void print_available_zone_props()
}
printf("|\n");

printf("|防拆支持");
printf("|失联支持");
for (auto zp : all_props) {
printf("|%s", print_bool(zonePropCanReportTamper(zp)));
printf("|%s", print_bool(zonePropCanReportLost(zp)));
}
printf("|\n\n");

Expand Down
7 changes: 4 additions & 3 deletions include/hb_detail.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,9 @@ static ZoneProperty zonePropertyFromChar(Char zp) {
return ZoneProperty::InvalidZoneProperty;
}

//! 根据防区属性判断是否支持报告防拆报警
static bool zonePropCanReportTamper(ZoneProperty zp) {
//! 根据防区属性判断是否支持失联报告
//! 失联报告是主机侧实现的跟防区属性没关系,但是人为限制了只有以下属性的才可以设置
static bool zonePropCanReportLost(ZoneProperty zp) {
switch (zp) {
case hb::common::Buglar:
case hb::common::Emergency:
Expand Down Expand Up @@ -426,7 +427,7 @@ static std::vector<ZoneProperty> getAvailableZoneProperties(MachineType type) {
case hb::common::Gprs:
return { Buglar, Emergency, Fire, Duress, Gas, Water, RemoteControl, };
case hb::common::NetMod:
return { Buglar, Emergency, Fire, Duress, Gas, Water, SubMachine, RemoteControl, BuglarHalf, Shield, DoorRing, Bypass };
return { Buglar, Emergency, Fire, Duress, Gas, Water, SubMachine, RemoteControl, BuglarHalf, Shield, DoorRing, };
case hb::common::Lcd:
return { Buglar, Emergency, Fire, Duress, Gas, Water, SubMachine, RemoteControl, BuglarHalf, Shield, DoorRing, Bypass };
case hb::common::Wired:
Expand Down

0 comments on commit 425624e

Please sign in to comment.