+#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
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MESHLINKPP_H
-#define MESHLINKPP_H
-
#include <meshlink.h>
#include <new> // for 'placement new'
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 */;
}
}
-#endif // MESHLINKPP_H
+#endif