]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink++.h
Make ping intervals and timeouts configurable for each device class.
[meshlink] / src / meshlink++.h
index 7877aeca22becc6d0e32c67abf9e10b67cc99460..5550a9e302339c02a2ce5a66862072384d86ee62 100644 (file)
@@ -871,6 +871,16 @@ public:
                meshlink_enable_discovery(handle, enable);
        }
 
+       /// Set device class timeouts
+       /** This sets the ping interval and timeout for a given device class.
+        *
+        *  @param devclass      The device class to update
+        *  @param pinginterval  The interval between keepalive packets, in seconds. The default is 60.
+        *  @param pingtimeout   The required time within which a peer should respond, in seconds. The default is 5.
+        *                       The timeout must be smaller than the interval.
+        */
+       void set_dev_class_timeouts(dev_class_t devclass, int pinginterval, int pingtimeout);
+
 private:
        // non-copyable:
        mesh(const mesh &) /* TODO: C++11: = delete */;