Note: This tutorial assumes that you have completed the previous tutorials: Understanding Service Types.

Publishing Services

Description: Illustrates how to use the zeroconf_jmdns api to publish services.

Keywords: zeroconf, jmdns

Tutorial Level: INTERMEDIATE

Contents

  1. Code
  2. Example

Code

Publishing is very straightforward. The following explicitly details each element required to publish a ros master.

   1 import ros.zeroconf.jmdns.Zeroconf;
   2 
   3 Zeroconf publisher = new Zeroconf(new StandardLogger());
   4 publisher.addService("DudeMaster", "_ros-master._tcp", "local", 8888, "Dude's test master");

For ros master services in particular, we could pull ros information directly from rosjava to fill out some of the above details - if you have an interest in getting this implemented contact <d DOT stonier AT gmail DOT com>.

Example

Example code can be found in zeroconf_jmdns_demos (pc) and also zeroconf_android_jmdns_demos (android).

Wiki: zeroconf_jmdns/Tutorials/Publishing Services (last edited 2012-01-03 15:27:19 by DanielStonier)