From 90c35a878f09c0659077c5108f3fc24acd249c3a Mon Sep 17 00:00:00 2001 From: Chadwick Boulay Date: Sun, 12 Jun 2022 21:00:56 -0400 Subject: [PATCH] SendDataCBlocking fixes and add to examples list. --- examples/CMakeLists.txt | 1 + examples/SendDataCBlocking.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index eca4d200..51f5057f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -44,6 +44,7 @@ addlslexample(SendMultipleStreams cpp) addlslexample(SendStringMarkers cpp) addlslexample(SendStringMarkersC c) addlslexample(TestSyncWithoutData cpp) +addlslexample(SendDataCBlocking c) target_link_libraries(TestSyncWithoutData PRIVATE Threads::Threads) diff --git a/examples/SendDataCBlocking.c b/examples/SendDataCBlocking.c index 355e9c02..56d7f37b 100644 --- a/examples/SendDataCBlocking.c +++ b/examples/SendDataCBlocking.c @@ -139,7 +139,7 @@ void transmit_thread(void *vargp) { lsl_xml_ptr desc = lsl_get_desc(info); lsl_append_child_value(desc, "manufacturer", "LSL"); lsl_xml_ptr chns = lsl_append_child(desc, "channels"); - char chanlabel[12]; + char chanlabel[20]; for (int c = 0; c < device->nchans; c++) { lsl_xml_ptr chn = lsl_append_child(chns, "channel"); snprintf(chanlabel, 20, "Chan-%d", c); @@ -150,7 +150,7 @@ void transmit_thread(void *vargp) { /* make a new outlet */ lsl_outlet outlet = - lsl_create_outlet_d(info, params->chunk_size, params->buffer_dur, params->do_async); + lsl_create_outlet_ex(info, params->chunk_size, params->buffer_dur, params->do_async ? transp_sync_blocking : 0); printf("Now sending data...\n"); params->thread_status = 1;