/*
meshlink.c -- Implementation of the MeshLink API.
- Copyright (C) 2014, 2017 Guus Sliepen <guus@meshlink.io>
+ Copyright (C) 2014-2018 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
mesh->threadstarted = true;
+#if HAVE_CATTA
if(mesh->discovery) {
discovery_start(mesh);
}
+#endif
pthread_mutex_unlock(&(mesh->mesh_mutex));
return true;
pthread_mutex_lock(&(mesh->mesh_mutex));
logger(mesh, MESHLINK_DEBUG, "meshlink_stop called\n");
+#if HAVE_CATTA
// Stop discovery
if(mesh->discovery) {
discovery_stop(mesh);
}
+#endif
// Shut down the main thread
event_loop_stop(&mesh->loop);
}
void meshlink_enable_discovery(meshlink_handle_t *mesh, bool enable) {
+#if HAVE_CATTA
if(!mesh) {
meshlink_errno = MESHLINK_EINVAL;
return;
end:
pthread_mutex_unlock(&mesh->mesh_mutex);
+#else
+ (void)mesh;
+ (void)enable;
+ meshlink_errno = MESHLINK_ENOTSUP;
+#endif
}
static void __attribute__((constructor)) meshlink_init(void) {