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
575b2477
Commit
575b2477
authored
Jun 26, 2021
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add nb
parent
123ce34d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
1 deletion
+24
-1
README.md
docs/README.md
+2
-0
gen_event_md.cpp
examples/gen_event_md/gen_event_md.cpp
+3
-0
ademco_event.h
include/ademco_event.h
+6
-1
hb_detail.h
include/hb_detail.h
+11
-0
hb_helper.h
include/hb_helper.h
+2
-0
No files found.
docs/README.md
View file @
575b2477
...
...
@@ -164,6 +164,7 @@
|1777 我是真彩主机|7 真彩主机| |√|1~68|1~8|√|jjf|qfm|
<ul><li>
G1000
</li><li>
G1000-4G
</li></ul>
|
|1787 我是简化版物联卡主机|2 简化的物联卡主机| |√|1~99| | |wzq|qfm|
<ul><li>
5050G-4GW
</li></ul>
|
|1797 我是GPRS主机能打电话|10 GPRS主机能打电话| |√|1~60| |√|jjf|qfm|
<ul><li>
2050
</li></ul>
|
|1807 我是NB报警接收主机|11 Nb报警接收主机| |√|1~999| | ||qfm|
<ul></ul>
|
### *恒博主机型号示例图片*
...
...
@@ -206,6 +207,7 @@
|1777|7|
<ul><li>
G1000
</li><li>
G1000-4G
</li></ul>
|√|√|√|√|√|√| |√| |√|√|√|
|1787|2|
<ul><li>
5050G-4GW
</li></ul>
|√|√|√|√|√|√| |√| | | | |
|1797|10|
<ul><li>
2050
</li></ul>
|√|√|√|√|√|√| |√| | | | |
|1807|11|
<ul></ul>
|√|√|√|√|√|√| | | | |√| |
## 四、恒博扩展
...
...
examples/gen_event_md/gen_event_md.cpp
View file @
575b2477
...
...
@@ -169,6 +169,7 @@ const char* get_net_author(MachineType t)
case
hb
:
:
common
::
ThreeSection
:
case
hb
:
:
common
::
IoT
:
case
hb
:
:
common
::
Gprs_Phone
:
case
hb
:
:
common
::
Nb
:
return
"qfm"
;
}
...
...
@@ -199,6 +200,8 @@ std::vector<std::string> get_machine_brands(MachineType t)
case
hb
:
:
common
::
Gprs_Phone
:
return
{
"2050"
};
//case hb::common::Nb: return { "" };
default
:
return
{};
break
;
}
...
...
include/ademco_event.h
View file @
575b2477
...
...
@@ -134,6 +134,7 @@ enum ADEMCO_EVENT : uint32_t {
EVENT_I_AM_TRUE_COLOR
=
1777
,
// 主机类型--真彩主机
EVENT_I_AM_GPRS_IOT
=
1787
,
// 主机类型--物联卡主机
EVENT_I_AM_GPRS_PHONE
=
1797
,
// 主机类型--GRPS主机带电话功能
EVENT_I_AM_NB_MACHINE
=
1807
,
// 主机类型--NB报警接收主机
EVENT_PHONE_USER_SOS
=
1709
,
// 手机用户SOS
EVENT_PHONE_USER_CANCLE_ALARM
=
1711
,
// 手机用户消警
...
...
@@ -232,6 +233,7 @@ static constexpr ADEMCO_EVENT AdemcoEvents[] = {
EVENT_I_AM_TRUE_COLOR
,
EVENT_I_AM_GPRS_IOT
,
EVENT_I_AM_GPRS_PHONE
,
EVENT_I_AM_NB_MACHINE
,
EVENT_SIM_IS_IOT_CARD
,
EVENT_SIM_IS_IOT_PLATFORM_CARD
,
...
...
@@ -312,6 +314,7 @@ inline std::string ademcoEventToStringEnglish(ADEMCO_EVENT ademco_event, bool wi
case
EVENT_I_AM_TRUE_COLOR
:
return
n_to_s
(
ademco_event
)
+
"I_AM_TRUE_COLOR"
;
case
EVENT_I_AM_GPRS_IOT
:
return
n_to_s
(
ademco_event
)
+
"I_AM_GPRS_IOT"
;
case
EVENT_I_AM_GPRS_PHONE
:
return
n_to_s
(
ademco_event
)
+
"I_AM_GPRS_PHONE"
;
case
EVENT_I_AM_NB_MACHINE
:
return
n_to_s
(
ademco_event
)
+
"EVENT_I_AM_NB_MACHINE"
;
case
EVENT_SIM_IS_IOT_CARD
:
return
n_to_s
(
ademco_event
)
+
"SIM card is IOT"
;
case
EVENT_SIM_IS_IOT_PLATFORM_CARD
:
return
n_to_s
(
ademco_event
)
+
"SIM card is Platform IOT"
;
case
EVENT_SIM_IS_NOT_IOT_CARD
:
return
n_to_s
(
ademco_event
)
+
"SIM card is not IOT"
;
...
...
@@ -396,6 +399,7 @@ inline const std::wstring ademcoEventToStringChinese(ADEMCO_EVENT ademco_event,
case
EVENT_I_AM_TRUE_COLOR
:
return
n_to_s
(
ademco_event
)
+
L"我是真彩主机"
;
case
EVENT_I_AM_GPRS_IOT
:
return
n_to_s
(
ademco_event
)
+
L"我是简化版物联卡主机"
;
case
EVENT_I_AM_GPRS_PHONE
:
return
n_to_s
(
ademco_event
)
+
L"我是GPRS主机能打电话"
;
case
EVENT_I_AM_NB_MACHINE
:
return
n_to_s
(
ademco_event
)
+
L"我是NB报警接收主机"
;
case
EVENT_SIM_IS_IOT_CARD
:
return
n_to_s
(
ademco_event
)
+
L"SIM卡为物联卡"
;
case
EVENT_SIM_IS_IOT_PLATFORM_CARD
:
return
n_to_s
(
ademco_event
)
+
L"SIM卡为平台物联卡"
;
case
EVENT_SIM_IS_NOT_IOT_CARD
:
return
n_to_s
(
ademco_event
)
+
L"SIM卡为非物联卡"
;
...
...
@@ -433,7 +437,8 @@ static inline bool isMachineTypeEvent(ADEMCO_EVENT ademco_event)
||
ademco_event
==
EVENT_I_AM_IOT_MACHINE
||
ademco_event
==
EVENT_I_AM_TRUE_COLOR
||
ademco_event
==
EVENT_I_AM_GPRS_IOT
||
ademco_event
==
EVENT_I_AM_GPRS_PHONE
;
||
ademco_event
==
EVENT_I_AM_GPRS_PHONE
||
ademco_event
==
EVENT_I_AM_NB_MACHINE
;
}
//! 事件是否需要控制源
...
...
include/hb_detail.h
View file @
575b2477
...
...
@@ -120,6 +120,8 @@ enum MachineType : Char {
IoT
=
9
,
//! GPRS主机可以打电话 [ HB-2050 ]
Gprs_Phone
=
10
,
//! NB报警接收主机
Nb
=
11
,
MachineTypeCount
,
InvalidMachineType
=
0xFF
,
...
...
@@ -146,6 +148,7 @@ static constexpr MachineType AllMachineTypes[MachineTypeCount] = {
ThreeSection
,
IoT
,
Gprs_Phone
,
Nb
,
};
//! 最大防区号根据型号不同而不同
...
...
@@ -157,6 +160,7 @@ static uint16_t zoneMax(MachineType type) {
return
99
;
case
MachineType
:
:
NetMod
:
case
MachineType
:
:
Nb
:
return
999
;
case
MachineType
:
:
Lcd
:
...
...
@@ -206,6 +210,7 @@ static bool machineCanReportSignalStrength(MachineType type) {
||
type
==
MachineType
::
TrueColor
||
type
==
MachineType
::
ThreeSection
||
type
==
MachineType
::
Gprs_Phone
||
type
==
MachineType
::
Nb
;
}
...
...
@@ -216,6 +221,7 @@ static bool machineCanReportBySMS(MachineType type) {
||
type
==
MachineType
::
TrueColor
||
type
==
MachineType
::
ThreeSection
||
type
==
MachineType
::
Gprs_Phone
;
}
...
...
@@ -230,6 +236,7 @@ static bool machineIsSelling(MachineType type) {
||
type
==
MachineType
::
TrueColor
||
type
==
MachineType
::
ThreeSection
||
type
==
MachineType
::
Gprs_Phone
||
type
==
MachineType
::
Nb
;
}
...
...
@@ -327,6 +334,7 @@ static const char* machineTypeToString(MachineType type) {
case
MachineType
:
:
ThreeSection
:
return
"8 ThreeSection"
;
case
MachineType
:
:
IoT
:
return
"9 IoT"
;
case
MachineType
:
:
Gprs_Phone
:
return
"10 Gprs_Phone"
;
case
MachineType
:
:
Nb
:
return
"11 Nb"
;
default
:
return
"Unknown MachineType"
;
}
}
...
...
@@ -344,6 +352,7 @@ static const wchar_t* machineTypeToWString(MachineType type) {
case
MachineType
:
:
ThreeSection
:
return
L"8 三区段主机"
;
case
MachineType
:
:
IoT
:
return
L"9 物联卡主机"
;
case
MachineType
:
:
Gprs_Phone
:
return
L"10 GPRS主机能打电话"
;
case
MachineType
:
:
Nb
:
return
L"11 NB报警接收主机"
;
default
:
return
L"未知主机"
;
}
}
...
...
@@ -440,6 +449,8 @@ static std::vector<ZoneProperty> getAvailableZoneProperties(MachineType type) {
return
{
Buglar
,
Emergency
,
Fire
,
Duress
,
Gas
,
Water
,
RemoteControl
,
Shield
,
DoorRing
,
Bypass
};
case
hb
:
:
common
::
Gprs_Phone
:
return
{
Buglar
,
Emergency
,
Fire
,
Duress
,
Gas
,
Water
,
RemoteControl
,
};
case
hb
:
:
common
::
Nb
:
return
{
Buglar
,
Emergency
,
Fire
,
Duress
,
Gas
,
Water
,
DoorRing
,
};
}
return
{};
}
...
...
include/hb_helper.h
View file @
575b2477
...
...
@@ -20,6 +20,7 @@ static common::MachineType machineTypeFromAdemcoEvent(ademco::ADEMCO_EVENT e) {
case
ademco
:
:
EVENT_I_AM_TRUE_COLOR
:
return
common
::
MachineType
::
TrueColor
;
case
ademco
:
:
EVENT_I_AM_GPRS_IOT
:
return
common
::
MachineType
::
Gprs_IoT
;
case
ademco
:
:
EVENT_I_AM_GPRS_PHONE
:
return
common
::
MachineType
::
Gprs_Phone
;
case
ademco
:
:
EVENT_I_AM_NB_MACHINE
:
return
common
::
MachineType
::
Nb
;
default
:
return
common
::
MachineType
::
InvalidMachineType
;
}
}
...
...
@@ -38,6 +39,7 @@ static ademco::ADEMCO_EVENT ademcoEventFromMachineType(common::MachineType type)
case
common
:
:
MachineType
::
ThreeSection
:
return
ademco
::
EVENT_I_AM_3_SECTION_MACHINE
;
case
common
:
:
MachineType
::
IoT
:
return
ademco
::
EVENT_I_AM_IOT_MACHINE
;
case
common
:
:
MachineType
::
Gprs_Phone
:
return
ademco
::
EVENT_I_AM_GPRS_PHONE
;
case
common
:
:
MachineType
::
Nb
:
return
ademco
::
EVENT_I_AM_NB_MACHINE
;
default
:
return
ademco
::
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