Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ademco_hb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
ademco_hb
Commits
e237ecd8
Commit
e237ecd8
authored
Oct 09, 2021
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工程主机串口通信协议.md
parent
98945c23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
0 deletions
+89
-0
工程主机串口通信协议.md
docs/工程主机串口通信协议.md
+33
-0
gen_event_md.cpp
examples/gen_event_md/gen_event_md.cpp
+47
-0
hb_detail.h
include/hb_detail.h
+9
-0
No files found.
docs/工程主机串口通信协议.md
0 → 100644
View file @
e237ecd8
# 工程主机串口通信协议
## EB B1 命令内报警码与安定宝事件码对照表
|报警码|安定宝事件码|含义|
|------|----------|----|
|01|3400|布防|
|02|1400|撤防|
|04|3456|半布防|
|08|1120|紧急报警|
|00|1130|盗警|
|20|1110|火警|
|30|1121|胁迫|
|40|1151|煤气|
|50|1113|水警|
|BA|1137|防拆|
|AB|1302|低电|
|AC|1302|低电|
|AE|1311|坏电|
|A5|1311|坏电|
|AD|3302|复电|
|BD|1387|光扰|
|CD|3387|光扰恢复|
|BC|1381|失效|
|CB|3381|恢复|
|DD|1134|门铃|
|CE|1702|分防区异常|
|CF|3702|分防区恢复|
|BE|1703|分防区电源异常|
|BF|3703|分防区电源恢复|
|B0|1301|主机AC掉电|
|B1|3301|主机AC恢复|
\ No newline at end of file
examples/gen_event_md/gen_event_md.cpp
View file @
e237ecd8
...
...
@@ -368,6 +368,51 @@ void print_available_zone_props()
}
void
print_g250_alarm_codes
()
{
printf
(
"## EB B1 命令内报警码与安定宝事件码对照表
\n\n
"
);
printf
(
"|报警码|安定宝事件码|含义|
\n
"
);
printf
(
"|------|----------|----|
\n
"
);
using
namespace
g250
;
static
Char
codes
[]
=
{
g250
::
MachineStatus
::
Arm
,
g250
::
MachineStatus
::
Disarm
,
g250
::
MachineStatus
::
HalfArm
,
AlarmCode
::
MACHINE_EMERGENCY
,
AlarmCode
::
ALARM_BURGLAR
,
AlarmCode
::
ALARM_FIRE
,
AlarmCode
::
ALARM_DURESS
,
AlarmCode
::
ALARM_GAS
,
AlarmCode
::
ALARM_WATER
,
AlarmCode
::
ALARM_TAMPER
,
AlarmCode
::
ALARM_S_BATTERY_LOW
,
AlarmCode
::
ALARM_R_BATTERY_LOW
,
AlarmCode
::
ALARM_S_BATTERY_BROKE
,
AlarmCode
::
ALARM_R_BATTERY_BROKE
,
AlarmCode
::
ALARM_BETTERY_RECOVER
,
AlarmCode
::
ALARM_SOLAR_DISTURB
,
AlarmCode
::
ALARM_SOLAR_RECOVER
,
AlarmCode
::
ALARM_LONGTIME_DISCONN
,
AlarmCode
::
ALARM_LONGTIME_RECOVER
,
AlarmCode
::
ALARM_DOOR_RING
,
AlarmCode
::
ALARM_SM_EXCEPTION
,
AlarmCode
::
ALARM_SM_EXCEPT_RESUME
,
AlarmCode
::
ALARM_SM_POWER_EXCEPT
,
AlarmCode
::
ALARM_SM_POWER_RESUME
,
AlarmCode
::
ALARM_AC_BROKE
,
AlarmCode
::
ALARM_AC_RECOVER
,
};
for
(
auto
code
:
codes
)
{
printf
(
"|%02X|%04d|%s|
\n
"
,
code
,
ademcoEventFromCode
(
code
),
jlib
::
win32
::
utf16_to_mbcs
(
ademcoEventToStringChinese
(
ademcoEventFromCode
(
code
),
false
)).
c_str
());
}
}
int
main
()
{
printf
(
"### 主机状态
\n\n
"
);
...
...
@@ -386,4 +431,6 @@ int main()
print_imgs
();
print_available_zone_props
();
print_g250_alarm_codes
();
}
\ No newline at end of file
include/hb_detail.h
View file @
e237ecd8
...
...
@@ -2000,6 +2000,12 @@ enum AlarmCode : Char {
//! 水警
ALARM_WATER
=
0x50
,
//! 2021年10月9日15:49:34新增主机AC掉电、AC恢复
//! AC掉电
ALARM_AC_BROKE
=
0xB0
,
//! AC恢复
ALARM_AC_RECOVER
=
0xB1
,
//! 开机
ALARM_STARTUP
=
0xCA
,
//! 关机
...
...
@@ -2395,6 +2401,9 @@ inline ademco::ADEMCO_EVENT ademcoEventFromCode(Char code) {
case
AlarmCode
:
:
ALARM_SM_EXCEPT_RESUME
:
return
ademco
::
ADEMCO_EVENT
::
EVENT_SUB_MACHINE_SENSOR_RESUME
;
case
AlarmCode
:
:
ALARM_SM_POWER_EXCEPT
:
return
ademco
::
ADEMCO_EVENT
::
EVENT_SUB_MACHINE_POWER_EXCEPTION
;
case
AlarmCode
:
:
ALARM_SM_POWER_RESUME
:
return
ademco
::
ADEMCO_EVENT
::
EVENT_SUB_MACHINE_POWER_RESUME
;
case
AlarmCode
:
:
ALARM_AC_BROKE
:
return
ademco
::
ADEMCO_EVENT
::
EVENT_AC_BROKE
;
case
AlarmCode
:
:
ALARM_AC_RECOVER
:
return
ademco
::
ADEMCO_EVENT
::
EVENT_AC_RECOVER
;
case
AlarmCode
:
:
ALARM_STARTUP
:
case
AlarmCode
:
:
ALARM_SHUTDOWN
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment