How to detect which motion controller is connected

I have been developing a VR game with my CV1 and testing on a Quest 2 with link cable and everything looked good.

I just started testing on an Index and found my hand meshes on the motion controllers are not lined up correctly on the Index so I need to detect which controller is being used and adjust accordingly.

Unfortunately I can’t seem to find a way to detect which motion controller is connected?

Can anyone point me in the right direction, preferably a C++ solution?