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
98945c23
Commit
98945c23
authored
Aug 26, 2021
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add event 3311 坏电恢复
parent
ef034a44
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
README.md
docs/README.md
+1
-0
gen_event_md.cpp
examples/gen_event_md/gen_event_md.cpp
+1
-0
ademco_event.h
include/ademco_event.h
+8
-2
No files found.
docs/README.md
View file @
98945c23
...
...
@@ -97,6 +97,7 @@
|1302|低电|LOWBATTERY|
|3302|复电|BATATTERY_RECOVER|
|1311|坏电|BADBATTERY|
|3311|坏电恢复|BADBATTERY_RECOVER|
|1387|光扰|SOLARDISTURB|
|3387|光扰恢复|SOLARDISTURB_RECOVER|
|1381|失效|DISCONNECT|
...
...
examples/gen_event_md/gen_event_md.cpp
View file @
98945c23
...
...
@@ -52,6 +52,7 @@ ADEMCO_EVENT excepEvents[] = {
EVENT_LOWBATTERY
,
EVENT_BATTERY_RECOVER
,
EVENT_BADBATTERY
,
EVENT_BADBATTERY_RECOVER
,
EVENT_SOLARDISTURB
,
EVENT_SOLARDISTURB_RECOVER
,
EVENT_DISCONNECT
,
...
...
include/ademco_event.h
View file @
98945c23
...
...
@@ -87,6 +87,7 @@ enum ADEMCO_EVENT : uint32_t {
EVENT_LOWBATTERY
=
1302
,
// 低电
EVENT_BATTERY_RECOVER
=
3302
,
// 复电
EVENT_BADBATTERY
=
1311
,
// 坏电
EVENT_BADBATTERY_RECOVER
=
3311
,
// 坏电恢复
EVENT_SOLARDISTURB
=
1387
,
// 光扰
EVENT_SOLARDISTURB_RECOVER
=
3387
,
// 光扰恢复
EVENT_DISCONNECT
=
1381
,
// 失效
...
...
@@ -196,6 +197,7 @@ static constexpr ADEMCO_EVENT AdemcoEvents[] = {
EVENT_LOWBATTERY
,
EVENT_BATTERY_RECOVER
,
EVENT_BADBATTERY
,
EVENT_BADBATTERY_RECOVER
,
EVENT_SOLARDISTURB
,
EVENT_SOLARDISTURB_RECOVER
,
EVENT_DISCONNECT
,
...
...
@@ -278,6 +280,7 @@ inline std::string ademcoEventToStringEnglish(ADEMCO_EVENT ademco_event, bool wi
case
EVENT_LOWBATTERY
:
return
n_to_s
(
ademco_event
)
+
"LOWBATTERY"
;
case
EVENT_BATTERY_RECOVER
:
return
n_to_s
(
ademco_event
)
+
"BATATTERY_RECOVER"
;
case
EVENT_BADBATTERY
:
return
n_to_s
(
ademco_event
)
+
"BADBATTERY"
;
case
EVENT_BADBATTERY_RECOVER
:
return
n_to_s
(
ademco_event
)
+
"BADBATTERY_RECOVER"
;
case
EVENT_SOLARDISTURB
:
return
n_to_s
(
ademco_event
)
+
"SOLARDISTURB"
;
case
EVENT_SOLARDISTURB_RECOVER
:
return
n_to_s
(
ademco_event
)
+
"SOLARDISTURB_RECOVER"
;
case
EVENT_DISCONNECT
:
return
n_to_s
(
ademco_event
)
+
"DISCONNECT"
;
...
...
@@ -362,7 +365,8 @@ inline const std::wstring ademcoEventToStringChinese(ADEMCO_EVENT ademco_event,
case
EVENT_AC_RECOVER
:
return
n_to_s
(
ademco_event
)
+
L"主机AC恢复"
;
case
EVENT_LOWBATTERY
:
return
n_to_s
(
ademco_event
)
+
L"低电"
;
case
EVENT_BATTERY_RECOVER
:
return
n_to_s
(
ademco_event
)
+
L"复电"
;
case
EVENT_BADBATTERY
:
return
n_to_s
(
ademco_event
)
+
L"坏电"
;
case
EVENT_BADBATTERY
:
return
n_to_s
(
ademco_event
)
+
L"坏电"
;
case
EVENT_BADBATTERY_RECOVER
:
return
n_to_s
(
ademco_event
)
+
L"坏电恢复"
;
case
EVENT_SOLARDISTURB
:
return
n_to_s
(
ademco_event
)
+
L"光扰"
;
case
EVENT_SOLARDISTURB_RECOVER
:
return
n_to_s
(
ademco_event
)
+
L"光扰恢复"
;
case
EVENT_DISCONNECT
:
return
n_to_s
(
ademco_event
)
+
L"失效"
;
...
...
@@ -477,6 +481,7 @@ inline EventLevel GetEventLevel(ADEMCO_EVENT ademco_event)
case
EVENT_HALFARM_1456
:
return
EVENT_LEVEL_STATUS
;
case
EVENT_BADBATTERY_RECOVER
:
case
EVENT_AC_RECOVER
:
case
EVENT_RECONNECT
:
case
EVENT_LOST_RECOVER
:
...
...
@@ -495,7 +500,7 @@ inline EventLevel GetEventLevel(ADEMCO_EVENT ademco_event)
case
EVENT_SOLARDISTURB
:
case
EVENT_DISCONNECT
:
case
EVENT_LOST
:
//case EVENT_DOORRINGING: //case EVENT_CONN_HANGUP: //case EVENT_CONN_RESUME:
//case EVENT_DOORRINGING: //case EVENT_CONN_HANGUP: //case EVENT_CONN_RESUME:
case
EVENT_SUB_MACHINE_SENSOR_EXCEPTION
:
case
EVENT_SUB_MACHINE_POWER_EXCEPTION
:
case
EVENT_BATTERY_EXCEPTION
:
...
...
@@ -532,6 +537,7 @@ inline ADEMCO_EVENT getExceptionEventByResumeEvent(ADEMCO_EVENT resume_event)
case
EVENT_OTHER_EXCEPTION_RECOVER
:
return
EVENT_OTHER_EXCEPTION
;
case
EVENT_AC_RECOVER
:
return
EVENT_AC_BROKE
;
case
EVENT_SOLARDISTURB_RECOVER
:
return
EVENT_SOLARDISTURB
;
case
EVENT_BADBATTERY_RECOVER
:
return
EVENT_BADBATTERY
;
default:
return
EVENT_INVALID_EVENT
;
}
}
...
...
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