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
cb3e0d48
Commit
cb3e0d48
authored
4 years ago
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server_demo_libevent 支持按下Q发送1798查询主机类型
parent
ad767169
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
server_demo_libevent.cpp
examples/server_demo_libevent/server_demo_libevent.cpp
+8
-1
No files found.
examples/server_demo_libevent/server_demo_libevent.cpp
View file @
cb3e0d48
...
...
@@ -67,7 +67,7 @@ int disable_data_print = 0;
void
op_usage
()
{
printf
(
"Press A for Arm, D for Disarm, E for Emergency, Q for Quit
\n
"
);
printf
(
"Press A for Arm, D for Disarm, E for Emergency,
T for query machine type,
Q for Quit
\n
"
);
}
void
usage
(
const
char
*
name
)
...
...
@@ -376,6 +376,13 @@ int main(int argc, char** argv)
threads_to_handled_event
=
thread_count
;
}
fire_command
();
}
else
if
(
cmd
==
't'
||
cmd
==
'T'
)
{
{
std
::
lock_guard
<
std
::
mutex
>
lg
(
mutex
);
events
.
push_back
(
EVENT_WHAT_IS_YOUR_TYPE
);
threads_to_handled_event
=
thread_count
;
}
fire_command
();
}
else
if
(
cmd
==
'\r'
||
cmd
==
'\n'
)
{
}
else
if
(
cmd
==
'q'
||
cmd
==
'Q'
)
{
timeval
tv
{
0
,
1000
};
...
...
This diff is collapsed.
Click to expand it.
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