How to programmatically read the gateway version for a TagProvider

Hello, I would like to know how to programmatically obtain the version e.g 8.1.2 of a TagProviders gateway.

Kindly let me know if I need to provide any other info

You're missing a lot of context.

I assume since you don't already know the version, what you're actually after is the version from a remote gateway?

If you just care about the local gateway where your code is running, just run:
com.inductiveautomation.ignition.common.BundleUtil.get().getPlatformVersion()

Exactly, I am interested in the version of the remote gateway.

To provide context, I have observed that there are interoperability issues between v8.0.x gateways and v.7.x remote gateways. I want to check the local and remote versions and if there is a mismatch, log a warning to that effect.

Assuming you have a GatewayContext and a ServerId, you invoke the GanNodeDetailsService to retrieve a remote version:

                    var ganNodeDetailsService = context.getGatewayAreaNetworkManager()
                        .getServiceManager()
                        .getService(serverId, GanNodeDetailsService.class)
                        .get();
                    remoteVersion = Version.parse(ganNodeDetailsService.getPlatformVersion());
1 Like