Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 package com.github.rosjava.zeroconf_jmdns_suite.jmdns.tutorials;
00018 
00019 import java.io.IOException;
00020 
00021 
00022 
00023 
00024 
00025 
00035 public class Main {
00036     public static void main(String argv[]) throws IOException {
00037         int argc = argv.length;
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056                 if (argc == 0) {
00057                 Main.usage();
00058             System.exit(1);
00059                 } else if ( "--polling".equals(argv[0])) {
00060                         Discovery.main_polling();
00061                 } else if ( "--publisher".equals(argv[0]) ) {
00062                         Publisher.main_publisher();
00063                 } else if ( "--discovery".equals(argv[0]) ) {
00064                         Discovery.main_handler();
00065         } else {
00066                 Main.usage();
00067             System.exit(1);
00068         }
00069     }
00070     public static void usage() {
00071         System.out.println();
00072         System.out.println("This bundle incorporates several jmdns tutorials, specify which one you wish to run:\n");
00073         System.out.println("     --publisher      - publishes a _ros-master._tcp for 8s");
00074         System.out.println("     --polling        - polling discovery for ros masters (_ros-master._tcp)");
00075         System.out.println("     --discovery      - callback discovery for ros services (ros, concert, app-manager)");
00076         System.out.println();
00077     }
00078 }