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
bb2b8adc
Commit
bb2b8adc
authored
Aug 09, 2021
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add version
parent
8bf24ba2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
README.md
README.md
+5
-0
hb_detail.h
include/hb_detail.h
+9
-2
No files found.
README.md
View file @
bb2b8adc
...
...
@@ -32,3 +32,8 @@
## 测试及演示工具,已编译的dll等请点击 [releases](https://github.com/captainwong/ademco_hb/releases)下载
## ChangeLog
|版本|发布日期|更新内容|
|----|-------|-------|
|v0.1|2021-8-10 00:29:12|启用版本号|
include/hb_detail.h
View file @
bb2b8adc
...
...
@@ -2135,7 +2135,7 @@ struct WirelessAddress {
bool
operator
==
(
const
WirelessAddress
&
rhs
)
const
{
return
hi
==
rhs
.
hi
&&
lo
==
rhs
.
lo
;
}
bool
operator
==
(
uint16_t
addr
)
const
{
return
toUInt16
()
==
addr
;
}
void
fromUInt16
(
uint16_t
addr
){
hi
=
static_cast
<
Char
>
((
addr
>>
8
)
&
0xFF
);
lo
=
static_cast
<
Char
>
(
addr
&
0xFF
);
}
uint16_t
toUInt16
()
const
{
return
static_cast
<
Char
>
(((
hi
<<
8
)
|
lo
)
&
mask
);
}
uint16_t
toUInt16
()
const
{
return
static_cast
<
uint16_t
>
(((
hi
<<
8
)
|
lo
)
&
mask
);
}
bool
valid
()
const
{
return
toUInt16
()
!=
mask
;
}
void
reset
()
{
hi
=
lo
=
0xFF
;
}
...
...
@@ -2143,6 +2143,13 @@ struct WirelessAddress {
WirelessAddress
addr
=
static_cast
<
uint16_t
>
(
rand
()
%
mask
);
return
addr
;
}
static
WirelessAddress
fromToChar
(
Char
hi
,
Char
lo
)
{
WirelessAddress
addr
;
addr
.
hi
=
hi
;
addr
.
lo
=
lo
;
return
addr
;
}
};
...
...
@@ -2355,7 +2362,7 @@ struct WriteToMachineRequest {
};
//! 从 EB B1 。。。命令[5]提取的事件码
ademco
::
ADEMCO_EVENT
ademcoEventFromCode
(
Char
code
)
{
inline
ademco
::
ADEMCO_EVENT
ademcoEventFromCode
(
Char
code
)
{
switch
(
code
)
{
case
MachineStatus
:
:
Arm
:
return
ademco
::
ADEMCO_EVENT
::
EVENT_ARM
;
case
MachineStatus
:
:
Disarm
:
return
ademco
::
ADEMCO_EVENT
::
EVENT_DISARM
;
...
...
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