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
e05ae0b9
Commit
e05ae0b9
authored
Aug 24, 2020
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
6a4dde02
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
串口透传协议.md
docs/串口透传协议.md
+1
-1
hb_detail.h
include/hb_detail.h
+5
-4
No files found.
docs/串口透传协议.md
View file @
e05ae0b9
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
|数据|长度|含义|说明|
|数据|长度|含义|说明|
|---|----|----|----|
|---|----|----|----|
|EB BA 3F 07
*P0*
**A0**
*P1 P2 P3*
SUM|10|主机状态回应|
*P0*
:语音;
*P1*
:0布防,1半布防,2撤防,3设置;
*
P2:主机类型|
|EB BA 3F 07
*P0*
**A0**
*P1 P2 P3*
SUM|10|主机状态回应|
*P0*
:语音;
*P1*
:0布防,1半布防,2撤防,3设置;
*
P2:主机类型|
|EB BA 3F
*PN*
*P0*
**A2**
*[Z, P]x(N-8)/2 P1*
SUM|变长|主机防区数据回应|
*PN*
:表示本条数据内包含多少个字节,最大20
,防区/属性字节对的数量为 (N-8)/2
;
<br/>
*P0*
:语音;Z:防区号;P:防区属性;
*P1*
:FF表示没有更多数据了,其他表示还有更多数据|
|EB BA 3F
*PN*
*P0*
**A2**
*[Z, P]x(N-8)/2 P1*
SUM|变长|主机防区数据回应|
*PN*
:表示本条数据内包含多少个字节,最大20
x2+8=48个字节,防区/属性字节对的数量最大为20
;
<br/>
*P0*
:语音;Z:防区号;P:防区属性;
*P1*
:FF表示没有更多数据了,其他表示还有更多数据|
|EB BA 3F 07
*P0*
**A3**
SUM|7|学码开始回应|
*P0*
:语音。因为学码时主机要等待外部无线信号(用户触发探测器),
<br/>
因此先回应A3表示已经开始学码,学码成功时再回 A4|
|EB BA 3F 07
*P0*
**A3**
SUM|7|学码开始回应|
*P0*
:语音。因为学码时主机要等待外部无线信号(用户触发探测器),
<br/>
因此先回应A3表示已经开始学码,学码成功时再回 A4|
|EB BA 3F 0A
*P0*
**A4**
*P1 P2 P3*
SUM|10|修改防区回应|
*P0*
:语音;
*P1*
:防区号;
*P2*
:防区属性;
*P3*
:0失败,1成功,2失败-重码,3失败-空防区|
|EB BA 3F 0A
*P0*
**A4**
*P1 P2 P3*
SUM|10|修改防区回应|
*P0*
:语音;
*P1*
:防区号;
*P2*
:防区属性;
*P3*
:0失败,1成功,2失败-重码,3失败-空防区|
|EB BA 3F 0F
*P0*
**A6**
*H1 M1 H2 M2 H3 M3 H4 M4*
SUM|14|定时器回应|
*P0*
:语音;第一组定时布防:
*H1:M1*
, 定时撤防:
*H2:M2*
;
<br/>
第二组定时布防:
*H3:M3*
,定时撤防:
*H4:M4*
|
|EB BA 3F 0F
*P0*
**A6**
*H1 M1 H2 M2 H3 M3 H4 M4*
SUM|14|定时器回应|
*P0*
:语音;第一组定时布防:
*H1:M1*
, 定时撤防:
*H2:M2*
;
<br/>
第二组定时布防:
*H3:M3*
,定时撤防:
*H4:M4*
|
...
...
include/hb_detail.h
View file @
e05ae0b9
...
@@ -510,9 +510,9 @@ typedef ZoneRequest A1;
...
@@ -510,9 +510,9 @@ typedef ZoneRequest A1;
//! 回应主机防区 EB BA 3F PN P0 A2 [Z, P]xN P1 SUM
//! 回应主机防区 EB BA 3F PN P0 A2 [Z, P]xN P1 SUM
struct
ZoneResponse
{
struct
ZoneResponse
{
static
constexpr
Char
min_len
=
8
;
// 无防区
防拆
数据时长度最小为8
static
constexpr
Char
min_len
=
8
;
// 无防区数据时长度最小为8
static
constexpr
Char
max_
len
=
20
;
// 一包数据最多有20个字节
static
constexpr
Char
max_
zone
=
20
;
// 最多可以包含 20 个防区
static
constexpr
Char
max_
zone
=
(
max_len
-
min_len
)
/
2
;
// 最多可以包含 (20 - 8) / 2 = 6 个防区
static
constexpr
Char
max_
len
=
min_len
+
max_zone
*
2
;
// 一包数据最多有8+20*2=48个字节
/*
/*
* when param is not 0xFF, means there's more zone coming; vice versa
* when param is not 0xFF, means there's more zone coming; vice versa
* zone&prop can be placed as much as 20 times
* zone&prop can be placed as much as 20 times
...
@@ -720,7 +720,8 @@ struct QuerySensorLostSettingsResponse {
...
@@ -720,7 +720,8 @@ struct QuerySensorLostSettingsResponse {
static
constexpr
Char
P1FlagZoneAs1Char
=
0xF0
;
static
constexpr
Char
P1FlagZoneAs1Char
=
0xF0
;
static
constexpr
Char
P1FlagZoneAs2Chars
=
0xF1
;
static
constexpr
Char
P1FlagZoneAs2Chars
=
0xF1
;
static
constexpr
Char
min_len
=
9
;
// 无防区防拆数据时长度最小为9
static
constexpr
Char
min_len
=
9
;
// 无防区防拆数据时长度最小为9
static
constexpr
Char
max_len
=
20
;
static
constexpr
Char
max_zone
=
20
;
// 最多包含20个防区
static
constexpr
Char
max_len
=
min_len
+
max_zone
*
2
;
// 最多有 9 + 20 *2 = 49 个字节
Char
data
[
max_len
]
=
{};
Char
data
[
max_len
]
=
{};
Char
len
=
9
;
// init as minimum len
Char
len
=
9
;
// init as minimum len
...
...
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