DiscoverySetup.java
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2013 Yujin Robot.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
00005  * use this file except in compliance with the License. You may obtain a copy of
00006  * the License at
00007  *
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00012  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
00013  * License for the specific language governing permissions and limitations under
00014  * the License.
00015  */
00016 
00017 package com.github.rosjava.android_remocons.common_tools.zeroconf;
00018 
00019 import android.app.ProgressDialog;
00020 import android.content.Context;
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             zconf.addListener("_concert-master._tcp", "local");
00047             zconf.addListener("_concert-master._udp", "local");
00048 
00049         } else {
00050             android.util.Log.i("zeroconf", "Error - DiscoveryTask::doInBackground received #zeroconfs != 1");
00051         }
00052         return null;
00053     }
00054 }


android_remocons
Author(s): Daniel Stonier, Kazuto Murase
autogenerated on Sat Jun 8 2019 19:32:24