diff --git a/libraries/AP_Relay/AP_Relay.h b/libraries/AP_Relay/AP_Relay.h index 9a7dcdf389..18aad6e93b 100644 --- a/libraries/AP_Relay/AP_Relay.h +++ b/libraries/AP_Relay/AP_Relay.h @@ -32,6 +32,11 @@ public: // de-activate the relay void off(uint8_t instance) { set(instance, false); } + // get state of relay + uint8_t get(uint8_t instance) const { + return instance < AP_RELAY_NUM_RELAYS ? _pin_states & (1U<