]> rtime.felk.cvut.cz Git - orte.git/blobdiff - orte/examples/schneider/schneider_subscriber.c
updated email address - petr@smoliku.cz
[orte.git] / orte / examples / schneider / schneider_subscriber.c
index bc1b5800ef7ebf46fec3225fb13cf535c0f18a80..43d6119acb286a5760564b4b21e4470141b89dda 100644 (file)
@@ -2,9 +2,19 @@
  *  $Id: m_subscriber.c,v 0.0.1.0       2005/01/03
  *
  *  DEBUG:  section                     m_subscriber
- *  AUTHOR: Petr Smolik                 petr.smolik@wo.cz
  *
- *  ORTE - OCERA Real-Time Ethernet     http://www.ocera.org/
+ *  -------------------------------------------------------------------  
+ *                                ORTE                                 
+ *                      Open Real-Time Ethernet                       
+ *                                                                    
+ *                      Copyright (C) 2001-2006                       
+ *  Department of Control Engineering FEE CTU Prague, Czech Republic  
+ *                      http://dce.felk.cvut.cz                       
+ *                      http://www.ocera.org                          
+ *                                                                    
+ *  Author:             Petr Smolik    petr@smoliku.cz             
+ *  Advisor:            Pavel Pisa                                   
+ *  Project Responsible: Zdenek Hanzalek                              
  *  --------------------------------------------------------------------
  *
  *  This program is free software; you can redistribute it and/or modify
 #include "orte.h"
 #include <stdio.h>
 
-ORTEDomain        *d = NULL;
-char              instance2Recv[64];
+#ifdef MAIN_RENAMED
+#define main orte_schneider_subscriber_main
+#define exit return
+#endif
 
-int maxDataSize(ORTEGetMaxSizeParam *gms) {
+static ORTEDomain        *d = NULL;
+static char              instance2Recv[64];
+
+int maxDataSize(ORTEGetMaxSizeParam *gms, int num) {
   return gms->max_size;
 }
 
-void
+static void
 recvCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) {
   char *instance=(char*)vinstance;
 
@@ -43,7 +58,7 @@ recvCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam)
 }
 
 
-void *
+static void *
 subscriberCreate(void *arg) {
   ORTESubscription    *s;
   NtpTime             deadline,minimumSeparation;
@@ -65,6 +80,9 @@ subscriberCreate(void *arg) {
 //       StringToIPAddress("225.0.0.2")
        IPADDRESS_INVALID
        );
+  if (s == NULL) {
+    printf("ORTESubscriptionCreate failed\n");
+  }
   return arg;
 }