mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[wpilib] Add method to get breaker fault at a specific channel in PowerDistribution[Sticky]Faults (#5521)
Co-authored-by: Ryan Blue <ryanzblue@gmail.com>
This commit is contained in:
@@ -158,6 +158,15 @@ class PneumaticHub : public PneumaticsBase {
|
||||
uint32_t Brownout : 1;
|
||||
uint32_t CanWarning : 1;
|
||||
uint32_t HardwareFault : 1;
|
||||
|
||||
/**
|
||||
* Gets whether there is a fault at the specified channel.
|
||||
* @param channel Channel to check for faults.
|
||||
* @return True if a a fault exists at the channel, otherwise false.
|
||||
* @throws A ChannelIndexOutOfRange error if the provided channel is outside
|
||||
* of the range supported by the hardware.
|
||||
*/
|
||||
bool GetChannelFault(int channel) const;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -159,6 +159,15 @@ class PowerDistribution : public wpi::Sendable,
|
||||
uint32_t Brownout : 1;
|
||||
uint32_t CanWarning : 1;
|
||||
uint32_t HardwareFault : 1;
|
||||
|
||||
/**
|
||||
* Gets whether there is a breaker fault at a specified channel.
|
||||
* @param channel Channel to check for faults.
|
||||
* @return If there is a breaker fault.
|
||||
* @throws A ChannelIndexOutOfRange error if the given int is outside of the
|
||||
* range supported by the hardware.
|
||||
*/
|
||||
bool GetBreakerFault(int channel) const;
|
||||
};
|
||||
|
||||
Faults GetFaults() const;
|
||||
@@ -192,6 +201,16 @@ class PowerDistribution : public wpi::Sendable,
|
||||
uint32_t CanWarning : 1;
|
||||
uint32_t CanBusOff : 1;
|
||||
uint32_t HasReset : 1;
|
||||
|
||||
/**
|
||||
* Gets whether there is a sticky breaker fault at the specified channel.
|
||||
* @param channel Index to check for sticky faults.
|
||||
* @return True if there is a sticky breaker fault at the channel, otherwise
|
||||
* false.
|
||||
* @throws A ChannelIndexOutOfRange error if the provided channel is outside
|
||||
* of the range supported by the hardware.
|
||||
*/
|
||||
bool GetBreakerFault(int channel) const;
|
||||
};
|
||||
|
||||
StickyFaults GetStickyFaults() const;
|
||||
|
||||
Reference in New Issue
Block a user