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
6eecff1a
Commit
6eecff1a
authored
May 25, 2020
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持按下E使主机报警
parent
abff9349
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
server_demo.cpp
server_demo/server_demo.cpp
+5
-2
No files found.
server_demo/server_demo.cpp
View file @
6eecff1a
...
@@ -30,7 +30,7 @@ using namespace ademco;
...
@@ -30,7 +30,7 @@ using namespace ademco;
void
usage
(
const
char
*
name
)
void
usage
(
const
char
*
name
)
{
{
printf
(
"Usage: %s listening_port
\n
While connection established, press A for Arm, D for Disarm, Q for Quit
\n
"
,
name
);
printf
(
"Usage: %s listening_port
\n
While connection established, press A for Arm, D for Disarm,
E for Emergency,
Q for Quit
\n
"
,
name
);
}
}
constexpr
size_t
BUFF_SIZE
=
4096
;
constexpr
size_t
BUFF_SIZE
=
4096
;
...
@@ -298,13 +298,16 @@ int main(int argc, char** argv)
...
@@ -298,13 +298,16 @@ int main(int argc, char** argv)
}
while
(
strlen
(
pwd
)
!=
6
);
}
while
(
strlen
(
pwd
)
!=
6
);
std
::
lock_guard
<
std
::
mutex
>
lg
(
mutex
);
std
::
lock_guard
<
std
::
mutex
>
lg
(
mutex
);
evntsWaiting4Send
.
push_back
(
EVENT_DISARM
);
evntsWaiting4Send
.
push_back
(
EVENT_DISARM
);
}
else
if
(
cmd
==
'e'
||
cmd
==
'E'
)
{
std
::
lock_guard
<
std
::
mutex
>
lg
(
mutex
);
evntsWaiting4Send
.
push_back
(
EVENT_EMERGENCY
);
}
else
if
(
cmd
==
'\r'
||
cmd
==
'\n'
)
{
}
else
if
(
cmd
==
'\r'
||
cmd
==
'\n'
)
{
}
else
if
(
cmd
==
'q'
||
cmd
==
'Q'
)
{
}
else
if
(
cmd
==
'q'
||
cmd
==
'Q'
)
{
running
=
false
;
running
=
false
;
worker
.
join
();
worker
.
join
();
break
;
break
;
}
else
{
}
else
{
printf
(
"Press A for Arm, D for Disarm, Q for Quit
\n
"
);
printf
(
"Press A for Arm, D for Disarm,
E for Emergency,
Q for Quit
\n
"
);
}
}
}
}
...
...
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