X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink.c;h=c720c766e48deda084ad42a03b22eddff4f410f8;hb=f13d66f20a227a87075f6456f41b83ce269b67f4;hp=573dfe498cd6969fcb789a571403a576f2743c0b;hpb=9b93553d7d5dbe39e2aef6221e68dab62c2f3c08;p=meshlink diff --git a/src/meshlink.c b/src/meshlink.c index 573dfe49..c720c766 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -1,6 +1,6 @@ /* meshlink.c -- Implementation of the MeshLink API. - Copyright (C) 2014, 2017 Guus Sliepen + Copyright (C) 2014-2018 Guus Sliepen 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 @@ -1215,9 +1215,11 @@ bool meshlink_start(meshlink_handle_t *mesh) { mesh->threadstarted = true; +#if HAVE_CATTA if(mesh->discovery) { discovery_start(mesh); } +#endif pthread_mutex_unlock(&(mesh->mesh_mutex)); return true; @@ -1232,10 +1234,12 @@ void meshlink_stop(meshlink_handle_t *mesh) { 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); @@ -2653,6 +2657,7 @@ void update_node_status(meshlink_handle_t *mesh, node_t *n) { } void meshlink_enable_discovery(meshlink_handle_t *mesh, bool enable) { +#if HAVE_CATTA if(!mesh) { meshlink_errno = MESHLINK_EINVAL; return; @@ -2676,6 +2681,11 @@ void meshlink_enable_discovery(meshlink_handle_t *mesh, bool enable) { end: pthread_mutex_unlock(&mesh->mesh_mutex); +#else + (void)mesh; + (void)enable; + meshlink_errno = MESHLINK_ENOTSUP; +#endif } static void __attribute__((constructor)) meshlink_init(void) {