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
b1dfcec1
Commit
b1dfcec1
authored
Aug 31, 2020
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
assign to Req_A2
parent
89614f16
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
hb_detail.h
include/hb_detail.h
+8
-1
No files found.
include/hb_detail.h
View file @
b1dfcec1
...
...
@@ -549,7 +549,14 @@ struct ZoneResponse {
};
typedef
std
::
vector
<
ZoneAndProperty
>
ZoneAndProperties
;
//! parser, make sure to call ResponseParser::parse first and return is A2_response to check data valid, then copy data/len to member.
bool
assign
(
const
char
*
in_data
,
Char
in_len
)
{
if
(
in_len
>
max_len
)
{
return
false
;
}
memcpy
(
data
,
in_data
,
in_len
);
len
=
in_len
;
return
true
;
}
//! parser, make sure to call ResponseParser::parse first and return is A2_response to check data valid, then call assign.
bool
parse
(
ZoneAndProperties
&
zps
,
bool
&
hasMore
)
{
if
(
len
<
min_len
||
data
[
3
]
!=
len
)
{
return
false
;
}
// check valid again
Char
sum_
=
data
[
len
-
1
];
sum
(
data
,
len
);
if
(
sum_
!=
data
[
len
-
1
])
{
return
false
;
}
// check sum again
...
...
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