/* 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_SELECTED_INLET_MASK = 0x7;       ///< Number of inlet selected on bypass switch (0 = automatic)
        constant int STATE_SELECTED_INLET_IS_ACTIVE = 0x8;  ///< Whether the bypass activated the selected inlet
        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
