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
75c488e4
Commit
75c488e4
authored
Mar 11, 2020
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
适配丛文的主机上下线事件码 3B0, 3B2
parent
c8cb32a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
32 deletions
+36
-32
ademco_packet.h
include/ademco_packet.h
+36
-32
No files found.
include/ademco_packet.h
View file @
75c488e4
...
...
@@ -230,56 +230,60 @@ struct CongwinFe100Packet
size_t
zone
=
data
->
zone_
;
int
ndx
=
0
;
data_
[
ndx
++
]
=
0x0A
;
// LF
data_
[
ndx
++
]
=
0x20
;
data_
[
ndx
++
]
=
'\n'
;
// LF
data_
[
ndx
++
]
=
' '
;
data_
[
ndx
++
]
=
0x30
;
// RG
data_
[
ndx
++
]
=
0x30
;
data_
[
ndx
++
]
=
0x20
;
data_
[
ndx
++
]
=
'0'
;
// RG
data_
[
ndx
++
]
=
'0'
;
data_
[
ndx
++
]
=
' '
;
ndx
+=
snprintf
(
data_
+
ndx
,
sizeof
(
data_
)
-
ndx
,
"%08d"
,
static_cast
<
int
>
(
acct
));
// acct
//ndx += 4;
data_
[
ndx
++
]
=
0x20
;
data_
[
ndx
++
]
=
' '
;
data_
[
ndx
++
]
=
0x31
;
// 18
data_
[
ndx
++
]
=
0x38
;
data_
[
ndx
++
]
=
0x20
;
data_
[
ndx
++
]
=
'1'
;
// 18
data_
[
ndx
++
]
=
'8'
;
data_
[
ndx
++
]
=
' '
;
bool
status_evnt
=
isStatusEvent
(
evnt
);
if
(
status_evnt
)
{
//data_[ndx++] = 'E';
// E for open, R for close
if
(
evnt
/
1000
==
1
||
evnt
==
3456
)
{
data_
[
ndx
++
]
=
'E'
;
}
else
{
data_
[
ndx
++
]
=
'R'
;
}
if
(
evnt
/
1000
==
1
)
{
data_
[
ndx
++
]
=
'E'
;
// 2020年3月11日16:37:18 修改
// 丛文使用 3B0 表示主机断线,3B2 表示主机上线
if
(
evnt
==
ADEMCO_EVENT
::
EVENT_OFFLINE
)
{
data_
[
ndx
++
]
=
'3'
;
data_
[
ndx
++
]
=
'B'
;
data_
[
ndx
++
]
=
'0'
;
}
else
if
(
evnt
==
ADEMCO_EVENT
::
EVENT_ONLINE
)
{
data_
[
ndx
++
]
=
'3'
;
data_
[
ndx
++
]
=
'B'
;
data_
[
ndx
++
]
=
'2'
;
}
else
{
if
(
evnt
==
3456
)
{
data_
[
ndx
++
]
=
'E'
;
}
else
{
data_
[
ndx
++
]
=
'R'
;
}
snprintf
(
data_
+
ndx
,
sizeof
(
data_
)
-
ndx
,
"%03d"
,
static_cast
<
int
>
(
evnt
%
1000
));
// event
}
snprintf
(
data_
+
ndx
,
sizeof
(
data_
)
-
ndx
,
"%03d"
,
static_cast
<
int
>
(
evnt
%
1000
));
// event
ndx
+=
3
;
data_
[
ndx
++
]
=
0x20
;
data_
[
ndx
++
]
=
' '
;
data_
[
ndx
++
]
=
0x30
;
// gg is always 00
data_
[
ndx
++
]
=
0x30
;
data_
[
ndx
++
]
=
0x20
;
data_
[
ndx
++
]
=
'0'
;
// gg is always 00
data_
[
ndx
++
]
=
'0'
;
data_
[
ndx
++
]
=
' '
;
//
data_[ndx++] = 0x43; // FCCC, F is always,
'C' for zone, 'U' for user
if
(
status_evnt
)
{
data_
[
ndx
++
]
=
0x55
;
// U
// 'C' for zone, 'U' for user
if
(
isStatusEvent
(
evnt
)
)
{
data_
[
ndx
++
]
=
'U'
;
// U
}
else
{
data_
[
ndx
++
]
=
0x43
;
// C
data_
[
ndx
++
]
=
'C'
;
// C
}
sprintf
(
data_
+
ndx
,
"%03d"
,
static_cast
<
int
>
(
zone
%
10000
));
ndx
+=
3
;
data_
[
ndx
++
]
=
0x20
;
data_
[
ndx
++
]
=
0x0D
;
data_
[
ndx
++
]
=
' '
;
data_
[
ndx
++
]
=
'\r'
;
return
true
;
}
...
...
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