X2 Standard  Version 1.26
Public Member Functions | List of all members
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>

Public Member Functions

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

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. 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.

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