/* SPDX-License-Identifier: BSD-3-Clause */
/*
 * Copyright 2017 Raritan Inc. All rights reserved.
 */

#ifndef __PDUMODEL_TRANSFER_SWITCH_BYPASS_STATE_SENSOR_IDL__
#define __PDUMODEL_TRANSFER_SWITCH_BYPASS_STATE_SENSOR_IDL__

#include <StateSensor.idl>

/** PDU Model */
module pdumodel {

    /** Overcurrent protector trip sensor interface */
    interface TransferSwitchBypassStateSensor extends sensors.StateSensor_4_0_7 {
        /* Bit masks for sensor state */
        constant int STATE_ACTIVE_INLET_MASK = 0x7;    ///< Active inlet, can be 0 (off), 1 or 2
        constant int STATE_IS_BYPASS_SELECTED = 0x8;   ///< Whether the "bypass" position is selected
        constant int STATE_FAULT = 0x10;               ///< If set, communication to the bypass controller failed unexpectedly

        /**
         * Acknowledge communication fault as expected
         *
         * If a bypass was present in the unit and later on removed, the STATE_FAULT bit will be set in the bypass state.
         * If removing the bypass happened deliberately, this method can be used to reset the state back to 'unavailable'
         * until the bypass is added to the unit again.
         */
        void acknowledgeFault();
    };

}

#endif
