How to add manual GPS switch

Hello ArduPilot developers!

For my project I need to implement a GPS selector switch in Plane. A 3-position switch on the transmitter should be used to select between GPS 1, GPS 2 and Auto-switch.

Previously I got it working on Copter 3.4 by adding a value to aux_sw_func enum and implementing an appropriate handler in ArduCopter/switches.cpp.

I see now that Plane is using a different architecture in mapping RC inputs and outputs, by specifying functions for servo outputs instead of specifying functions for RC inputs. As my intended function does not need a Servo output, this approach does not work for me.

Can you please hint me on where would this kind of functionality better fit in Plane code?

Thanks in advance!

PS. Please excuse me if this is not the appropriate category for my question.

I’ve ended up copying the parachute release switch approach. Please advise if there is a cleaner way.