set_sync_flag(channel->priv, true);
}
-int main() {
+int main(void) {
meshlink_set_log_cb(NULL, MESHLINK_DEBUG, log_cb);
meshlink_handle_t *a, *b;
assert(nb);
struct sync_flag channel_opened = {.flag = false};
+ init_sync_flag(&channel_opened);
meshlink_channel_t *channel = meshlink_channel_open(a, nb, 7, a_receive_cb, &channel_opened, 0);
assert(channel);
// Send a message to b
struct sync_flag channel_closed = {.flag = false};
+ init_sync_flag(&channel_closed);
channel->priv = &channel_closed;
assert(meshlink_channel_send(a, channel, "Hello", 5) == 5);
// Try to create a second channel
struct sync_flag channel_polled = {.flag = false};
+ init_sync_flag(&channel_polled);
meshlink_channel_t *channel2 = meshlink_channel_open(a, nb, 7, a_receive_cb, &channel_polled, 0);
assert(channel2);