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
2a185760
Commit
2a185760
authored
Aug 09, 2020
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deep copy
parent
28e4ee62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
ademco_packet.h
include/ademco_packet.h
+34
-0
No files found.
include/ademco_packet.h
View file @
2a185760
...
...
@@ -304,6 +304,12 @@ struct XData
XData
()
{}
XData
(
const
XData
&
rhs
)
{
lengthFormat_
=
rhs
.
lengthFormat_
;
data_
=
rhs
.
data_
;
rawData_
=
rhs
.
rawData_
;
}
size_t
size
()
const
{
return
data_
.
size
();
}
size_t
rawSize
()
const
{
return
rawData_
.
size
();
}
...
...
@@ -453,6 +459,15 @@ struct AdemcoTimeStamp
time_t
time_
=
0
;
AdemcoTimeStamp
()
{
make
();
}
AdemcoTimeStamp
(
const
AdemcoTimeStamp
&
rhs
)
{
memcpy
(
data_
,
rhs
.
data_
,
length
+
1
);
time_
=
rhs
.
time_
;
}
AdemcoTimeStamp
&
operator
=
(
const
AdemcoTimeStamp
&
rhs
)
{
memcpy
(
data_
,
rhs
.
data_
,
length
+
1
);
time_
=
rhs
.
time_
;
return
*
this
;
}
void
make
()
{
time_
=
time
(
nullptr
);
...
...
@@ -731,6 +746,25 @@ struct AdemcoPacket
static
constexpr
char
CR
=
0x0D
;
AdemcoPacket
()
{}
AdemcoPacket
(
const
AdemcoPacket
&
rhs
)
{
deepCopy
(
rhs
);
}
AdemcoPacket
&
operator
=
(
const
AdemcoPacket
&
rhs
)
{
deepCopy
(
rhs
);
return
*
this
;
}
void
deepCopy
(
const
AdemcoPacket
&
rhs
)
{
crc_
=
rhs
.
crc_
;
len_
=
rhs
.
len_
;
id_
=
rhs
.
id_
;
seq_
=
rhs
.
seq_
;
rrcvr_
=
rhs
.
rrcvr_
;
lpref_
=
rhs
.
lpref_
;
acct_
=
rhs
.
acct_
;
ademcoData_
=
rhs
.
ademcoData_
;
if
(
rhs
.
xdata_
)
{
xdata_
=
std
::
make_shared
<
XData
>
(
*
rhs
.
xdata_
);
}
else
{
xdata_
.
reset
();
}
timestamp_
=
rhs
.
timestamp_
;
}
void
clear
()
{
crc_
=
0
;
...
...
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