Class CanandcolorDetails.Bitsets
java.lang.Object
com.reduxrobotics.sensors.canandcolor.CanandcolorDetails.Bitsets
- Enclosing class:
- CanandcolorDetails
Canandcolor bitsets.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
digout_cond - Slot 0static final int
digout_cond - Slot 1static final int
digout_cond - Slot 10static final int
digout_cond - Slot 11static final int
digout_cond - Slot 12static final int
digout_cond - Slot 13static final int
digout_cond - Slot 14static final int
digout_cond - Slot 15static final int
digout_cond - Slot 2static final int
digout_cond - Slot 3static final int
digout_cond - Slot 4static final int
digout_cond - Slot 5static final int
digout_cond - Slot 6static final int
digout_cond - Slot 7static final int
digout_cond - Slot 8static final int
digout_cond - Slot 9static final int
faults - The CAN general error flag, which will raise if the device encounters a CAN fault during operation.static final int
faults - The CAN ID conflict flag, which is set to true if there is a CAN id conflict.static final int
faults - The hardware fault flag corresponding to the color sensor IC, which will raise if a hardware issue is detected.static final int
faults - The hardware fault flag corresponding to the distance sensor IC, which will raise if a hardware issue is detected.static final int
faults - The I2C bus recovery flag, which will raise when the device needs to completely restart the I2C bus.static final int
faults - The temperature range flag, which will raise if the device is not between 0-70 degrees Celsius.static final int
faults - The power cycle fault flag, which is set to true when the device first boots.static final int
setting_report_flags - Whether the setting synch commit was successfulstatic final int
setting_report_flags - Whether the setting set/fetch was successful -
Method Summary
Modifier and TypeMethodDescriptionstatic int
constructDigoutCond
(boolean slot0, boolean slot1, boolean slot2, boolean slot3, boolean slot4, boolean slot5, boolean slot6, boolean slot7, boolean slot8, boolean slot9, boolean slot10, boolean slot11, boolean slot12, boolean slot13, boolean slot14, boolean slot15) Constructs a digout_cond bitset.static int
constructFaults
(boolean powerCycle, boolean canIdConflict, boolean canGeneralError, boolean outOfTemperatureRange, boolean hardwareFaultDistance, boolean hardwareFaultColor, boolean i2cBusRecovery) Constructs a faults bitset.static int
constructSettingReportFlags
(boolean setSuccess, boolean commitSuccess) Constructs a setting_report_flags bitset.static boolean
extractDigoutCond_Slot0
(int field) Extracts slot0 from digout_cond.static boolean
extractDigoutCond_Slot1
(int field) Extracts slot1 from digout_cond.static boolean
extractDigoutCond_Slot10
(int field) Extracts slot10 from digout_cond.static boolean
extractDigoutCond_Slot11
(int field) Extracts slot11 from digout_cond.static boolean
extractDigoutCond_Slot12
(int field) Extracts slot12 from digout_cond.static boolean
extractDigoutCond_Slot13
(int field) Extracts slot13 from digout_cond.static boolean
extractDigoutCond_Slot14
(int field) Extracts slot14 from digout_cond.static boolean
extractDigoutCond_Slot15
(int field) Extracts slot15 from digout_cond.static boolean
extractDigoutCond_Slot2
(int field) Extracts slot2 from digout_cond.static boolean
extractDigoutCond_Slot3
(int field) Extracts slot3 from digout_cond.static boolean
extractDigoutCond_Slot4
(int field) Extracts slot4 from digout_cond.static boolean
extractDigoutCond_Slot5
(int field) Extracts slot5 from digout_cond.static boolean
extractDigoutCond_Slot6
(int field) Extracts slot6 from digout_cond.static boolean
extractDigoutCond_Slot7
(int field) Extracts slot7 from digout_cond.static boolean
extractDigoutCond_Slot8
(int field) Extracts slot8 from digout_cond.static boolean
extractDigoutCond_Slot9
(int field) Extracts slot9 from digout_cond.static boolean
extractFaults_CanGeneralError
(int field) Extracts can_general_error from faults.static boolean
extractFaults_CanIdConflict
(int field) Extracts can_id_conflict from faults.static boolean
extractFaults_HardwareFaultColor
(int field) Extracts hardware_fault_color from faults.static boolean
extractFaults_HardwareFaultDistance
(int field) Extracts hardware_fault_distance from faults.static boolean
extractFaults_I2cBusRecovery
(int field) Extracts i2c_bus_recovery from faults.static boolean
extractFaults_OutOfTemperatureRange
(int field) Extracts out_of_temperature_range from faults.static boolean
extractFaults_PowerCycle
(int field) Extracts power_cycle from faults.static boolean
extractSettingReportFlags_CommitSuccess
(int field) Extracts commit_success from setting_report_flags.static boolean
extractSettingReportFlags_SetSuccess
(int field) Extracts set_success from setting_report_flags.
-
Field Details
-
kSettingReportFlags_SetSuccess
public static final int kSettingReportFlags_SetSuccesssetting_report_flags - Whether the setting set/fetch was successful- See Also:
-
kSettingReportFlags_CommitSuccess
public static final int kSettingReportFlags_CommitSuccesssetting_report_flags - Whether the setting synch commit was successful- See Also:
-
kFaults_PowerCycle
public static final int kFaults_PowerCyclefaults - The power cycle fault flag, which is set to true when the device first boots. Clearing sticky faults and then checking this flag can be used to determine if the device rebooted.- See Also:
-
kFaults_CanIdConflict
public static final int kFaults_CanIdConflictfaults - The CAN ID conflict flag, which is set to true if there is a CAN id conflict. In practice, you should physically inspect the device to ensure it's not flashing blue.- See Also:
-
kFaults_CanGeneralError
public static final int kFaults_CanGeneralErrorfaults - The CAN general error flag, which will raise if the device encounters a CAN fault during operation. If communication with the device still functions, this will not register as an active fault for long if at all. This may raise due to wiring issues, such as an intermittently shorted CAN bus.- See Also:
-
kFaults_OutOfTemperatureRange
public static final int kFaults_OutOfTemperatureRangefaults - The temperature range flag, which will raise if the device is not between 0-70 degrees Celsius. This may be of concern if the device is near very active motors.- See Also:
-
kFaults_HardwareFaultDistance
public static final int kFaults_HardwareFaultDistancefaults - The hardware fault flag corresponding to the distance sensor IC, which will raise if a hardware issue is detected. Generally will raise if the device's controller cannot read the physical sensor itself.- See Also:
-
kFaults_HardwareFaultColor
public static final int kFaults_HardwareFaultColorfaults - The hardware fault flag corresponding to the color sensor IC, which will raise if a hardware issue is detected. Generally will raise if the device's controller cannot read the physical sensor itself.- See Also:
-
kFaults_I2cBusRecovery
public static final int kFaults_I2cBusRecoveryfaults - The I2C bus recovery flag, which will raise when the device needs to completely restart the I2C bus. This fault flag should not be active for very long; if it is stuck as an active fault, that may indicate a hardware issue.- See Also:
-
kDigoutCond_Slot0
public static final int kDigoutCond_Slot0digout_cond - Slot 0- See Also:
-
kDigoutCond_Slot1
public static final int kDigoutCond_Slot1digout_cond - Slot 1- See Also:
-
kDigoutCond_Slot2
public static final int kDigoutCond_Slot2digout_cond - Slot 2- See Also:
-
kDigoutCond_Slot3
public static final int kDigoutCond_Slot3digout_cond - Slot 3- See Also:
-
kDigoutCond_Slot4
public static final int kDigoutCond_Slot4digout_cond - Slot 4- See Also:
-
kDigoutCond_Slot5
public static final int kDigoutCond_Slot5digout_cond - Slot 5- See Also:
-
kDigoutCond_Slot6
public static final int kDigoutCond_Slot6digout_cond - Slot 6- See Also:
-
kDigoutCond_Slot7
public static final int kDigoutCond_Slot7digout_cond - Slot 7- See Also:
-
kDigoutCond_Slot8
public static final int kDigoutCond_Slot8digout_cond - Slot 8- See Also:
-
kDigoutCond_Slot9
public static final int kDigoutCond_Slot9digout_cond - Slot 9- See Also:
-
kDigoutCond_Slot10
public static final int kDigoutCond_Slot10digout_cond - Slot 10- See Also:
-
kDigoutCond_Slot11
public static final int kDigoutCond_Slot11digout_cond - Slot 11- See Also:
-
kDigoutCond_Slot12
public static final int kDigoutCond_Slot12digout_cond - Slot 12- See Also:
-
kDigoutCond_Slot13
public static final int kDigoutCond_Slot13digout_cond - Slot 13- See Also:
-
kDigoutCond_Slot14
public static final int kDigoutCond_Slot14digout_cond - Slot 14- See Also:
-
kDigoutCond_Slot15
public static final int kDigoutCond_Slot15digout_cond - Slot 15- See Also:
-
-
Method Details
-
constructSettingReportFlags
public static int constructSettingReportFlags(boolean setSuccess, boolean commitSuccess) Constructs a setting_report_flags bitset.- Parameters:
setSuccess
- Whether the setting set/fetch was successfulcommitSuccess
- Whether the setting synch commit was successful- Returns:
- bitset data as int
-
constructFaults
public static int constructFaults(boolean powerCycle, boolean canIdConflict, boolean canGeneralError, boolean outOfTemperatureRange, boolean hardwareFaultDistance, boolean hardwareFaultColor, boolean i2cBusRecovery) Constructs a faults bitset.- Parameters:
powerCycle
- The power cycle fault flag, which is set to true when the device first boots. Clearing sticky faults and then checking this flag can be used to determine if the device rebooted.canIdConflict
- The CAN ID conflict flag, which is set to true if there is a CAN id conflict. In practice, you should physically inspect the device to ensure it's not flashing blue.canGeneralError
- The CAN general error flag, which will raise if the device encounters a CAN fault during operation. If communication with the device still functions, this will not register as an active fault for long if at all. This may raise due to wiring issues, such as an intermittently shorted CAN bus.outOfTemperatureRange
- The temperature range flag, which will raise if the device is not between 0-70 degrees Celsius. This may be of concern if the device is near very active motors.hardwareFaultDistance
- The hardware fault flag corresponding to the distance sensor IC, which will raise if a hardware issue is detected. Generally will raise if the device's controller cannot read the physical sensor itself.hardwareFaultColor
- The hardware fault flag corresponding to the color sensor IC, which will raise if a hardware issue is detected. Generally will raise if the device's controller cannot read the physical sensor itself.i2cBusRecovery
- The I2C bus recovery flag, which will raise when the device needs to completely restart the I2C bus. This fault flag should not be active for very long; if it is stuck as an active fault, that may indicate a hardware issue.- Returns:
- bitset data as int
-
constructDigoutCond
public static int constructDigoutCond(boolean slot0, boolean slot1, boolean slot2, boolean slot3, boolean slot4, boolean slot5, boolean slot6, boolean slot7, boolean slot8, boolean slot9, boolean slot10, boolean slot11, boolean slot12, boolean slot13, boolean slot14, boolean slot15) Constructs a digout_cond bitset.- Parameters:
slot0
- Slot 0slot1
- Slot 1slot2
- Slot 2slot3
- Slot 3slot4
- Slot 4slot5
- Slot 5slot6
- Slot 6slot7
- Slot 7slot8
- Slot 8slot9
- Slot 9slot10
- Slot 10slot11
- Slot 11slot12
- Slot 12slot13
- Slot 13slot14
- Slot 14slot15
- Slot 15- Returns:
- bitset data as int
-
extractSettingReportFlags_SetSuccess
public static boolean extractSettingReportFlags_SetSuccess(int field) Extracts set_success from setting_report_flags.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractSettingReportFlags_CommitSuccess
public static boolean extractSettingReportFlags_CommitSuccess(int field) Extracts commit_success from setting_report_flags.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_PowerCycle
public static boolean extractFaults_PowerCycle(int field) Extracts power_cycle from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_CanIdConflict
public static boolean extractFaults_CanIdConflict(int field) Extracts can_id_conflict from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_CanGeneralError
public static boolean extractFaults_CanGeneralError(int field) Extracts can_general_error from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_OutOfTemperatureRange
public static boolean extractFaults_OutOfTemperatureRange(int field) Extracts out_of_temperature_range from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_HardwareFaultDistance
public static boolean extractFaults_HardwareFaultDistance(int field) Extracts hardware_fault_distance from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_HardwareFaultColor
public static boolean extractFaults_HardwareFaultColor(int field) Extracts hardware_fault_color from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_I2cBusRecovery
public static boolean extractFaults_I2cBusRecovery(int field) Extracts i2c_bus_recovery from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot0
public static boolean extractDigoutCond_Slot0(int field) Extracts slot0 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot1
public static boolean extractDigoutCond_Slot1(int field) Extracts slot1 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot2
public static boolean extractDigoutCond_Slot2(int field) Extracts slot2 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot3
public static boolean extractDigoutCond_Slot3(int field) Extracts slot3 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot4
public static boolean extractDigoutCond_Slot4(int field) Extracts slot4 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot5
public static boolean extractDigoutCond_Slot5(int field) Extracts slot5 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot6
public static boolean extractDigoutCond_Slot6(int field) Extracts slot6 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot7
public static boolean extractDigoutCond_Slot7(int field) Extracts slot7 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot8
public static boolean extractDigoutCond_Slot8(int field) Extracts slot8 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot9
public static boolean extractDigoutCond_Slot9(int field) Extracts slot9 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot10
public static boolean extractDigoutCond_Slot10(int field) Extracts slot10 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot11
public static boolean extractDigoutCond_Slot11(int field) Extracts slot11 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot12
public static boolean extractDigoutCond_Slot12(int field) Extracts slot12 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot13
public static boolean extractDigoutCond_Slot13(int field) Extracts slot13 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot14
public static boolean extractDigoutCond_Slot14(int field) Extracts slot14 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractDigoutCond_Slot15
public static boolean extractDigoutCond_Slot15(int field) Extracts slot15 from digout_cond.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-