#include <sys/time.h>
#include "../src/meshlink.h"
+#include "../src/node.h"
volatile bool bar_reachable = false;
volatile bool bar_responded = false;
return 1;
}
+ // XXX not enough to wait for reachable, must wait for SPTPS to complete
+ for(int i=0; i < 20; i++) {
+ sleep(1);
+ if(((node_t *)bar)->status.validkey)
+ break;
+ }
+ if(!((node_t *)bar)->status.validkey) {
+ fprintf(stderr, "No key exchange after 20 seconds\n");
+ return 1;
+ }
+
meshlink_channel_t *channel = meshlink_channel_open(mesh1, bar, 7, foo_receive_cb, NULL, 0);
meshlink_set_channel_poll_cb(mesh1, channel, poll_cb);