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.android_remocons.robot_remocon.zeroconf;
00018
00019 import android.content.Context;
00020 import android.app.ProgressDialog;
00021 import android.os.AsyncTask;
00022
00023 import com.github.rosjava.zeroconf_jmdns_suite.jmdns.Zeroconf;
00024
00025
00030 public class DiscoverySetup extends AsyncTask<Zeroconf, String, Void> {
00031
00032 private ProgressDialog commencing_dialog;
00033 private final Context context;
00034
00035 public DiscoverySetup(Context context) {
00036 this.context = context;
00037 }
00038
00039 protected Void doInBackground(Zeroconf... zeroconfs) {
00040 if ( zeroconfs.length == 1 ) {
00041 Zeroconf zconf = zeroconfs[0];
00042 android.util.Log.i("zeroconf", "*********** Discovery Commencing **************");
00043
00044 zconf.addListener("_ros-master._tcp","local");
00045 zconf.addListener("_ros-master._udp","local");
00046
00047 } else {
00048 android.util.Log.i("zeroconf", "Error - DiscoveryTask::doInBackground received #zeroconfs != 1");
00049 }
00050 return null;
00051 }
00052 }