Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
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
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Beam Positoning Monitor - Software
Commits
3a0fe8e2
Commit
3a0fe8e2
authored
May 25, 2014
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples/client.c: modify client example to use libclient
parent
e501703d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
38 deletions
+2
-38
client.c
examples/client.c
+2
-38
No files found.
examples/client.c
View file @
3a0fe8e2
...
...
@@ -7,48 +7,12 @@
#include <czmq.h>
#include <inttypes.h>
#include <bpm_client.h>
#define DFLT_BIND_FOLDER "/tmp/bpm"
#define DFLT_BIND_ADDR "0"
#define LEDS_OPERATION 0
/* Our tructure */
typedef
struct
_bpm_client_t
{
mdp_client_t
*
mdp_client
;
}
bpm_client_t
;
/* Our API */
bpm_client_t
*
bpm_client_new
(
char
*
broker_endp
,
int
verbose
)
{
bpm_client_t
*
self
=
zmalloc
(
sizeof
*
self
);
self
->
mdp_client
=
mdp_client_new
(
broker_endp
,
verbose
);
return
self
;
}
void
bpm_client_destroy
(
bpm_client_t
**
self_p
)
{
assert
(
self_p
);
if
(
*
self_p
)
{
bpm_client_t
*
self
=
*
self_p
;
mdp_client_destroy
(
&
self
->
mdp_client
);
*
self_p
=
NULL
;
}
}
int
bpm_blink_leds
(
bpm_client_t
*
self
,
char
*
service
,
uint32_t
leds
)
{
uint32_t
operation
=
LEDS_OPERATION
;
zmsg_t
*
request
=
zmsg_new
();
zmsg_addmem
(
request
,
&
operation
,
sizeof
(
operation
));
zmsg_addmem
(
request
,
&
leds
,
sizeof
(
leds
));
mdp_client_send
(
self
->
mdp_client
,
service
,
&
request
);
return
0
;
}
void
print_help
(
char
*
program_name
)
{
printf
(
"Usage: %s [options]
\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