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
c860bb2d
Commit
c860bb2d
authored
Oct 09, 2019
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ea294ed3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
12 deletions
+11
-12
demo.cpp
demo/demo.cpp
+9
-2
demo.vcxproj
demo/demo.vcxproj
+0
-2
demo.vcxproj.filters
demo/demo.vcxproj.filters
+0
-6
ademco_packet.h
include/ademco_packet.h
+2
-2
No files found.
demo/demo.cpp
View file @
c860bb2d
...
@@ -68,8 +68,15 @@ void handle_network_data(const char* data_from_network)
...
@@ -68,8 +68,15 @@ void handle_network_data(const char* data_from_network)
// success
// success
break
;
break
;
case
AdemcoId
:
:
id_hb
:
case
AdemcoId
:
:
id_hb
:
// event report
// event report
// reply ack
{
char
ack
[
1024
];
ap
.
make_ack
(
ack
,
sizeof
(
ack
),
ap
.
seq_
.
value_
,
ap
.
acct_
.
acct
(),
ap
.
ademcoData_
.
ademco_id_
);
// send to machine via network
}
// handle event
printf
(
"%s
\n
"
,
ap
.
ademcoData_
.
toString
().
data
());
printf
(
"%s
\n
"
,
ap
.
ademcoData_
.
toString
().
data
());
break
;
break
;
...
...
demo/demo.vcxproj
View file @
c860bb2d
...
@@ -131,8 +131,6 @@
...
@@ -131,8 +131,6 @@
<ClInclude
Include=
"..\include\ademco_detail.h"
/>
<ClInclude
Include=
"..\include\ademco_detail.h"
/>
<ClInclude
Include=
"..\include\ademco_event.h"
/>
<ClInclude
Include=
"..\include\ademco_event.h"
/>
<ClInclude
Include=
"..\include\ademco_packet.h"
/>
<ClInclude
Include=
"..\include\ademco_packet.h"
/>
<ClInclude
Include=
"..\include\hb.h"
/>
<ClInclude
Include=
"..\include\hb_detail.h"
/>
</ItemGroup>
</ItemGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.targets"
/>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.targets"
/>
<ImportGroup
Label=
"ExtensionTargets"
>
<ImportGroup
Label=
"ExtensionTargets"
>
...
...
demo/demo.vcxproj.filters
View file @
c860bb2d
...
@@ -32,11 +32,5 @@
...
@@ -32,11 +32,5 @@
<ClInclude
Include=
"..\include\ademco_packet.h"
>
<ClInclude
Include=
"..\include\ademco_packet.h"
>
<Filter>
include
</Filter>
<Filter>
include
</Filter>
</ClInclude>
</ClInclude>
<ClInclude
Include=
"..\include\hb.h"
>
<Filter>
include
</Filter>
</ClInclude>
<ClInclude
Include=
"..\include\hb_detail.h"
>
<Filter>
include
</Filter>
</ClInclude>
</ItemGroup>
</ItemGroup>
</Project>
</Project>
\ No newline at end of file
include/ademco_packet.h
View file @
c860bb2d
...
@@ -50,7 +50,7 @@ struct AdemcoData
...
@@ -50,7 +50,7 @@ struct AdemcoData
return
str
;
return
str
;
}
}
void
assignAdecoId
(
size_t
ademco_id
)
{
void
assignAde
m
coId
(
size_t
ademco_id
)
{
char
aid
[
7
]
=
{
0
};
char
aid
[
7
]
=
{
0
};
snprintf
(
aid
,
sizeof
(
aid
),
"%06X"
,
static_cast
<
int
>
(
ademco_id
%
1000000
));
snprintf
(
aid
,
sizeof
(
aid
),
"%06X"
,
static_cast
<
int
>
(
ademco_id
%
1000000
));
std
::
copy
(
aid
,
aid
+
6
,
std
::
back_inserter
(
data_
));
std
::
copy
(
aid
,
aid
+
6
,
std
::
back_inserter
(
data_
));
...
@@ -94,7 +94,7 @@ struct AdemcoData
...
@@ -94,7 +94,7 @@ struct AdemcoData
data_
.
reserve
(
21
);
// [#000000|1400 00 000]
data_
.
reserve
(
21
);
// [#000000|1400 00 000]
data_
.
push_back
(
'['
);
data_
.
push_back
(
'['
);
data_
.
push_back
(
'#'
);
data_
.
push_back
(
'#'
);
assignAdecoId
(
ademco_id
);
assignAde
m
coId
(
ademco_id
);
data_
.
push_back
(
'|'
);
data_
.
push_back
(
'|'
);
assignAdemcoEvent
(
ademco_event
);
assignAdemcoEvent
(
ademco_event
);
data_
.
push_back
(
' '
);
data_
.
push_back
(
' '
);
...
...
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