meshlink_set_invitation_timeout(handle, timeout);
}
+ /// Set the scheduling granularity of the application
+ /** This should be set to the effective scheduling granularity for the application.
+ * This depends on the scheduling granularity of the operating system, the application's
+ * process priority and whether it is running as realtime or not.
+ * The default value is 10000 (10 milliseconds).
+ *
+ * @param granularity The scheduling granularity of the application in microseconds.
+ */
+ void set_granularity(long granularity) {
+ meshlink_set_scheduling_granularity(handle, granularity);
+ }
+
/// Invite another node into the mesh.
/** This function generates an invitation that can be used by another node to join the same mesh as the local node.
* The generated invitation is a string containing a URL.
pthread_mutex_unlock(&mesh->mutex);
}
+void meshlink_set_scheduling_granularity(struct meshlink_handle *mesh, long granularity) {
+ if(!mesh || granularity < 0) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ utcp_set_clock_granularity(granularity);
+}
+
void handle_network_change(meshlink_handle_t *mesh, bool online) {
(void)online;
static void __attribute__((constructor)) meshlink_init(void) {
crypto_init();
+ utcp_set_clock_granularity(10000);
}
static void __attribute__((destructor)) meshlink_exit(void) {
*/
extern void meshlink_set_external_address_discovery_url(struct meshlink_handle *mesh, const char *url);
+/// Set the scheduling granularity of the application
+/** This should be set to the effective scheduling granularity for the application.
+ * This depends on the scheduling granularity of the operating system, the application's
+ * process priority and whether it is running as realtime or not.
+ * The default value is 10000 (10 milliseconds).
+ *
+ * \memberof meshlink_handle
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param granularity The scheduling granularity of the application in microseconds.
+ */
+extern void meshlink_set_scheduling_granularity(struct meshlink_handle *mesh, long granularity);
+
#ifdef __cplusplus
}
#endif
meshlink_channel_aio_send
meshlink_channel_close
meshlink_channel_get_flags
+meshlink_channel_get_mss
meshlink_channel_get_recvq
meshlink_channel_get_sendq
meshlink_channel_open
meshlink_set_node_status_cb
meshlink_set_port
meshlink_set_receive_cb
+meshlink_set_scheduling_granularity
meshlink_sign
meshlink_start
meshlink_stop