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
fe357ded
Commit
fe357ded
authored
Aug 20, 2020
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix gcc cry
parent
11907471
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
hb_detail.h
include/hb_detail.h
+7
-6
No files found.
include/hb_detail.h
View file @
fe357ded
...
...
@@ -526,9 +526,10 @@ struct ZoneResponse {
Char
count
=
len
-
8
/
2
;
// zone/prop pairs
if
(
count
==
0
)
{
zps
.
clear
();
hasMore
=
false
;
return
true
;
}
for
(
Char
i
=
0
;
i
<
count
;
i
++
)
{
Char
zone
=
data
[
5
+
i
*
2
];
ZoneProperty
prop
=
zonePropertyFromChar
(
data
[
6
+
i
*
2
]);
if
(
prop
!=
ZoneProperty
::
InvalidZoneProperty
)
{
zps
.
emplace_back
(
ZoneAndProperty
{
zone
,
prop
});
}
ZoneAndProperty
zp
;
zp
.
zone
=
data
[
5
+
i
*
2
];
zp
.
prop
=
zonePropertyFromChar
(
data
[
6
+
i
*
2
]);
if
(
zp
.
prop
!=
ZoneProperty
::
InvalidZoneProperty
)
{
zps
.
emplace_back
(
zp
);
}
}
hasMore
=
data
[
len
-
2
]
==
0xFF
;
return
true
;
...
...
@@ -997,20 +998,20 @@ enum Key : Char {
typedef
std
::
vector
<
Key
>
Keys
;
//! 用于将Key的值Char转为Key,不特殊处理Key_0
static
constexpr
Key
keyFromChar
(
Char
c
)
{
static
Key
keyFromChar
(
Char
c
)
{
if
((
Key_1
<=
c
&&
c
<=
Key_STOP_SOUND
)
||
(
c
==
Key_STOP_ALARM
))
{
return
static_cast
<
Key
>
(
c
);
}
return
Key_NULL
;
}
//! 将 0~9转换为Key,特殊处理Key_0
static
constexpr
Key
keyFromNumber
(
int
i
)
{
static
Key
keyFromNumber
(
int
i
)
{
if
(
i
==
0
)
{
return
Key_0
;
}
else
if
(
1
<=
i
&&
i
<=
9
)
{
return
static_cast
<
Key
>
(
i
);
}
else
{
return
Key_NULL
;
}
}
static
c
onstexpr
c
har
keyToPrintableChar
(
Key
key
)
{
static
char
keyToPrintableChar
(
Key
key
)
{
switch
(
key
)
{
case
Key_1
:
case
Key_2
:
case
Key_3
:
case
Key_4
:
case
Key_5
:
...
...
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