X2 Standard  Version 1.28
Loading...
Searching...
No Matches
CircuitRefreshInterface Class Reference

The CircuitRefreshInterface allows a power control driver to specify how often TheSkyX should re-query the device for authoritative circuit state. More...

#include <circuitrefreshinterface.h>

Inheritance diagram for CircuitRefreshInterface:
X2PowerControl

Public Member Functions

virtual int circuitRefreshInterval (int &nOutInterval_ms)
 Returns the recommended refresh interval (in milliseconds) for circuit state.

Detailed Description

The CircuitRefreshInterface allows a power control driver to specify how often TheSkyX should re-query the device for authoritative circuit state.

This interface is optional. If the driver does not support this interface, TheSkyX assumes the circuit state only changes as a result of commands issued through this driver instance and will not perform periodic refreshes.

Drivers should support this interface for hardware whose circuit state may change externally (for example, via a front panel, mobile application, web interface, scheduling logic, cloud automation, or other client connections).

The refresh interval applies to the circuit state as a whole (e.g. on/off, locked, access, etc.), and should reflect a balance between responsiveness to external changes and the cost of performing a full circuit state query.

This interface was added in TheSky build 14139. Use the TheSkyXFacadeForDriversInterface::build() method to react by either requiring a certain minimum build or gracefully degrading functionality.

Don't forget to respond accordingly in your queryAbstraction().

Member Function Documentation

◆ circuitRefreshInterval()

virtual int CircuitRefreshInterface::circuitRefreshInterval ( int & nOutInterval_ms)
inlinevirtual

Returns the recommended refresh interval (in milliseconds) for circuit state.

TheSkyX calls this method to determine how often it should re-query the device for authoritative circuit state via PowerControlDriverInterface::circuitState(). The default implementation returns 1000 ms as the default.
The driver should return an interval appropriate for the hardware's expected external change rate and communication cost.

Parameters
nOutInterval_ms(out) The refresh interval in milliseconds.
Returns
0 if successful, otherwise an X2 error code.

Reimplemented in X2PowerControl.


The documentation for this class was generated from the following file:
X2 Examples
(C) 2026 Software Bisque, Inc. All rights reserved.