summaryrefslogtreecommitdiff
path: root/examples/live_stream
diff options
context:
space:
mode:
authorJean-Baptiste Maillet <jean-baptiste.maillet@parrot.com>2014-12-08 14:00:02 +0100
committerJean-Baptiste Maillet <jean-baptiste.maillet@parrot.com>2014-12-08 14:00:02 +0100
commite375dffcae39418feead88d2662d07e81d0f6421 (patch)
treeabb82991feaa75183a280b986f9a559c3d7eabdc /examples/live_stream
parent1442d9715e59aa641656922a03f0c19fc2e2e04d (diff)
downloadOpen-AVB-e375dffcae39418feead88d2662d07e81d0f6421.tar.gz
MRP client code listener side: except for send_msg(), fincs return 0 or -1
Callers of send_msg() are able to ckeck the message length returned. Callers of higher level functions get 0 for sucess, -1 for failure.
Diffstat (limited to 'examples/live_stream')
-rw-r--r--examples/live_stream/listener.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/examples/live_stream/listener.c b/examples/live_stream/listener.c
index b756e630..a7ae7dd0 100644
--- a/examples/live_stream/listener.c
+++ b/examples/live_stream/listener.c
@@ -37,10 +37,15 @@ unsigned char glob_dest_addr[] = { 0x91, 0xE0, 0xF0, 0x00, 0x0E, 0x80 };
void sigint_handler(int signum)
{
+ int ret;
+
fprintf(stderr, "Received signal %d:leaving...\n", signum);
#if USE_MRPD
- if (0 != talker)
- send_leave();
+ if (0 != talker) {
+ ret = send_leave();
+ if (ret)
+ printf("send_leave failed\n");
+ }
#endif /* USE_MRPD */
if (2 > control_socket)
{
@@ -64,6 +69,7 @@ int main(int argc, char *argv[ ])
unsigned char frame[MAX_FRAME_SIZE];
int size, length;
struct sched_param sched;
+ int rc;
if (argc < 2) {
fprintf(stderr, "Usage : %s <interface_name> <payload>\n",argv[0]);
@@ -77,10 +83,20 @@ int main(int argc, char *argv[ ])
return errno;
}
- report_domain_status();
+ rc = report_domain_status();
+ if (rc) {
+ printf("report_domain_status failed\n");
+ return EXIT_FAILURE;
+ }
+
fprintf(stdout,"Waiting for talker...\n");
await_talker();
- send_ready();
+ rc = send_ready();
+ if (rc) {
+ printf("send_ready failed\n");
+ return EXIT_FAILURE;
+ }
+
#endif /* USE_MRPD */
iface = strdup(argv[1]);