2 * $Id: HelloWorldSubscriber.c,v 0.0.0.1 2003/12/26
4 * DEBUG: section HelloWorldSubscriber
5 * AUTHOR: Petr Smolik petr.smolik@wo.cz
7 * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/
8 * --------------------------------------------------------------------
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
23 #include <orte_config.h>
26 #ifdef CONFIG_ORTE_RTL
28 #include <posix/pthread.h>
29 #define printf rtl_printf
30 #elif defined(CONFIG_ORTE_RTAI)
31 #include <linux/module.h>
33 #include <rtai_sched.h>
35 #define printf rt_printk
44 recvCallBack(const ORTERecvInfo *info,void *vinstance, void *recvCallBackParam) {
45 char *instance=(char*)vinstance;
47 switch (info->status) {
49 printf("%s\n",instance);
52 printf("deadline occured\n");
58 subscriberCreate(void) {
61 NtpTime deadline,minimumSeparation;
62 char instance2Recv[64];
65 // ORTEVerbositySetOptions("ALL,5");
66 ORTEDomainPropDefaultGet(&dp);
67 #ifdef CONFIG_ORTE_RTL
68 dp.appLocalManager=StringToIPAddress("192.168.4.1");
70 d=ORTEDomainAppCreate(ORTE_DEFAULT_DOMAIN,&dp,NULL,ORTE_FALSE);
72 printf("ORTEDomainAppCreate failed!\n");
75 ORTETypeRegisterAdd(d,"HelloMsg",NULL,NULL,64);
76 NTPTIME_BUILD(deadline,20);
77 NTPTIME_BUILD(minimumSeparation,0);
78 s=ORTESubscriptionCreate(
91 #ifndef CONFIG_ORTE_RT
93 main(int argc, char *args[]) {
100 MODULE_LICENSE("GPL");
107 cleanup_module(void) {
109 ORTEDomainAppDestroy(d);