From e46bc2e49f48fd23181b6dc6e36ddee767765c8a Mon Sep 17 00:00:00 2001 From: rodolpheh Date: Fri, 8 Dec 2023 09:07:39 +0000 Subject: [PATCH] Fix missing EOL in server_namespace --- src/ultraleap.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ultraleap.cpp b/src/ultraleap.cpp index 491d693..6e004ff 100644 --- a/src/ultraleap.cpp +++ b/src/ultraleap.cpp @@ -344,15 +344,16 @@ void UltraleapHandTracking::start() { started = true; - LEAP_CONNECTION_CONFIG config; + LEAP_CONNECTION_CONFIG config = {0}; // Set connection to multi-device aware - memset(&config, 0, sizeof(config)); config.size = sizeof(config); - config.flags = eLeapConnectionConfig_MultiDeviceAware; - config.server_namespace = generate_connection_payload().utf8().get_data(); + config.flags = (uint32_t)eLeapConnectionConfig_MultiDeviceAware; - if(connectionHandle || LeapCreateConnection(&config, &connectionHandle) == eLeapRS_Success) { + CharString server_namespace = generate_connection_payload().utf8(); + config.server_namespace = server_namespace.get_data(); + + if (LeapCreateConnection(&config, &connectionHandle) == eLeapRS_Success) { eLeapRS result = LeapOpenConnection(connectionHandle); if(result == eLeapRS_Success) { opened = true;