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;