Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added version fallback behaviour #58

Merged
merged 2 commits into from
Dec 17, 2024
Merged

Conversation

qjgn
Copy link
Contributor

@qjgn qjgn commented Dec 16, 2024

Overview

This PR changes how the CRTProtocol::Connect works, instead of directly failing when there is a version discrepancy. It continues by using CRTProtocol::SetVersion with older versions of the RTProtocol. If all of listed versions fail CRTProtocol::Connect returns false as before.

This enables us to test and use new versions of the RTProtocol before the next QTM is released, while at the same time providing working default values for new users.

Notice: This also means that if the user specifies a certain version, it might not end up as the version used. The user would have to call CRTProtocol::GetVersion to identify which version has been selected.

Background

Packet.h contains the definitions for the default RTProtocol version to be used as default values in CRTProtocol::Connect.
If QTM does not support the version, or the connection is rejected, CRTProtocol::Connect will then fail by returning false.

#define MAJOR_VERSION           1
#define MINOR_VERSION           26

We change these number to signal new changes of the RTProtocol itself. That is, the communication between QTM and the Qualisys Cpp SDK. This version normally lags behind until we released the next version of QTM. The lagging behind is what we are trying to address in this PR.

Change

  • Added utility struct RTVersion which provides a rudimentary abstraction for the RTProtocol version pair.
  • Added utility function RTVersion::VersionList Which takes the desired protocol version as an input, and produces a list of supported versions.
  • Created a loop in CRTProtocol::Connect which, if enabled, will fall-back to older versions of the protocol if SetVersion is declined by QTM.
  • Added a new arugment bNegotiateVersion (default true) to CRTProtocol::Connect which can be used to disable the fallback behaviour.

@qjgn qjgn changed the title Added version fallback system Added version fallback behaviour Dec 16, 2024
@qjgn qjgn merged commit 264f5da into master Dec 17, 2024
@qjgn qjgn deleted the connect_version_negotiation branch February 20, 2025 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants