]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink++.h
Allow Catta to be disabled.
[meshlink] / src / meshlink++.h
index df0a72b594431cf779df8cabbc9e87375c56bc94..b012bb4aa07f0835e053c3616378279c61b86f38 100644 (file)
@@ -1,6 +1,9 @@
+#ifndef MESHLINKPP_H
+#define MESHLINKPP_H
+
 /*
     meshlink++.h -- MeshLink C++ API
-    Copyright (C) 2014 Guus Sliepen <guus@meshlink.io>
+    Copyright (C) 2014, 2017 Guus Sliepen <guus@meshlink.io>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -17,9 +20,6 @@
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef MESHLINKPP_H
-#define MESHLINKPP_H
-
 #include <meshlink.h>
 #include <new> // for 'placement new'
 
@@ -558,6 +558,16 @@ public:
                return meshlink_channel_send(handle, channel, data, len);
        }
 
+       /// Enable or disable zeroconf discovery of local peers
+       /** This controls whether zeroconf discovery using the Catta library will be
+        *  enabled to search for peers on the local network. By default, it is enabled.
+        *
+        *  @param enable  Set to true to enable discovery, false to disable.
+        */
+       void enable_discovery(bool enable = true) {
+               meshlink_enable_discovery(handle, enable);
+       }
+
 private:
        // non-copyable:
        mesh(const mesh&) /* TODO: C++11: = delete */;
@@ -633,4 +643,4 @@ static bool destroy(const char *confbase) {
 }
 }
 
-#endif // MESHLINKPP_H
+#endif