Class CanandcolorDetails.Msg
java.lang.Object
com.reduxrobotics.sensors.canandcolor.CanandcolorDetails.Msg
- Enclosing class:
- CanandcolorDetails
Messages.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Clear sticky digout state which is broadcast over CANstatic final int
Clear device sticky faultsstatic final int
Color framestatic final int
Digital output framestatic final int
Distance framestatic final int
CLEAR_STICKY_DIGOUT message lengthstatic final int
COLOR_OUTPUT message lengthstatic final int
DIGITAL_OUTPUT message lengthstatic final int
DISTANCE_OUTPUT message lengthstatic final int
ENUMERATE message lengthstatic final int
REPORT_SETTING message lengthstatic final int
SET_SETTING message lengthstatic final int
STATUS message lengthstatic final int
CLEAR_STICKY_FAULTS message max lengthstatic final int
PARTY_MODE message max lengthstatic final int
SETTING_COMMAND message max lengthstatic final int
CLEAR_STICKY_FAULTS message min lengthstatic final int
PARTY_MODE message min lengthstatic final int
SETTING_COMMAND message min lengthstatic final int
Device enumerate responsestatic final int
Party modestatic final int
setting value report from devicestatic final int
update setting on devicestatic final int
setting control commandstatic final int
Status frame -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkDlcForClearStickyDigout
(int dlc) Check if CLEAR_STICKY_DIGOUT message length is valid.static boolean
checkDlcForClearStickyFaults
(int dlc) Check if CLEAR_STICKY_FAULTS message length is valid.static boolean
checkDlcForColorOutput
(int dlc) Check if COLOR_OUTPUT message length is valid.static boolean
checkDlcForDigitalOutput
(int dlc) Check if DIGITAL_OUTPUT message length is valid.static boolean
checkDlcForDistanceOutput
(int dlc) Check if DISTANCE_OUTPUT message length is valid.static boolean
checkDlcForEnumerate
(int dlc) Check if ENUMERATE message length is valid.static boolean
checkDlcForPartyMode
(int dlc) Check if PARTY_MODE message length is valid.static boolean
checkDlcForReportSetting
(int dlc) Check if REPORT_SETTING message length is valid.static boolean
checkDlcForSetSetting
(int dlc) Check if SET_SETTING message length is valid.static boolean
checkDlcForSettingCommand
(int dlc) Check if SETTING_COMMAND message length is valid.static boolean
checkDlcForStatus
(int dlc) Check if STATUS message length is valid.static long
Constructs a CLEAR_STICKY_DIGOUT message.static long
Constructs a CLEAR_STICKY_FAULTS message.static long
constructColorOutput
(int red, int green, int blue, int period) Constructs a COLOR_OUTPUT message.static long
constructDigitalOutput
(boolean digout1State, boolean digout2State, boolean digout1Sticky, boolean digout2Sticky, int digout1Cond, int digout2Cond) Constructs a DIGITAL_OUTPUT message.static long
constructDistanceOutput
(int distance) Constructs a DISTANCE_OUTPUT message.static long
constructEnumerate
(long serial, boolean isBootloader) Constructs a ENUMERATE message.static long
constructPartyMode
(int partyLevel) Constructs a PARTY_MODE message.static long
constructReportSetting
(int address, long value, int flags) Constructs a REPORT_SETTING message.static long
constructSetSetting
(int address, long value, boolean flagsEphemeral, boolean flagsSynchHold, int flagsSynchMsgCount) Constructs a SET_SETTING message.static long
constructSettingCommand
(int controlFlag, int settingIndex) Constructs a SETTING_COMMAND message.static long
constructStatus
(int faults, int stickyFaults, int temperature) Constructs a STATUS message.static int
extractColorOutput_Blue
(long field) Extracts Blue reading magnitude from ColorOutput.static int
extractColorOutput_Green
(long field) Extracts Green reading magnitude from ColorOutput.static int
extractColorOutput_Period
(long field) Extracts Color integration period from ColorOutput.static int
extractColorOutput_Red
(long field) Extracts Red reading magnitude from ColorOutput.static int
extractDigitalOutput_Digout1Cond
(long field) Extracts DIGOUT1 condition slot flags.static boolean
extractDigitalOutput_Digout1State
(long field) Extracts Digital output state for DIGOUT1 from DigitalOutput.static boolean
extractDigitalOutput_Digout1Sticky
(long field) Extracts Sticky digital output state for DIGOUT1 from DigitalOutput.static int
extractDigitalOutput_Digout2Cond
(long field) Extracts DIGOUT2 condition slot flags.static boolean
extractDigitalOutput_Digout2State
(long field) Extracts Digital output state for DIGOUT2 from DigitalOutput.static boolean
extractDigitalOutput_Digout2Sticky
(long field) Extracts Sticky digital output state for DIGOUT1 from DigitalOutput.static int
extractDistanceOutput_Distance
(long field) Extracts 16-bit distance value.static boolean
extractEnumerate_IsBootloader
(long field) Extracts Device is in bootloader.static long
extractEnumerate_Serial
(long field) Extracts Device-unique serial number from Enumerate.static int
extractPartyMode_PartyLevel
(long field) Extracts Party level.static int
extractReportSetting_Address
(long field) Extracts Setting index to write to from ReportSetting.static int
extractReportSetting_Flags
(long field) Extracts Setting receive status from ReportSetting.static long
extractReportSetting_Value
(long field) Extracts 6-byte setting value from ReportSetting.static int
extractSetSetting_Address
(long field) Extracts Setting index to write to from SetSetting.static boolean
extractSetSetting_Flags_Ephemeral
(long field) Extracts Whether the setting should be set ephemeral from SetSetting_Flags.static boolean
extractSetSetting_Flags_SynchHold
(long field) Extracts Whether the setting should be held until the next synch barrier from SetSetting_Flags.static int
extractSetSetting_Flags_SynchMsgCount
(long field) Extracts Synch message count from SetSetting_Flags.static long
extractSetSetting_Value
(long field) Extracts 6-byte setting value from SetSetting.static int
extractSettingCommand_ControlFlag
(long field) Extracts Setting command index from SettingCommand.static int
extractSettingCommand_SettingIndex
(long field) Extracts setting index to fetch from SettingCommand.static int
extractStatus_Faults
(long field) Extracts 8-bit active faults bitfield from Status.static int
extractStatus_StickyFaults
(long field) Extracts 8-bit sticky faults bitfield from Status.static int
extractStatus_Temperature
(long field) Extracts 16-bit signed temperature byte in 1/256ths of a Celsius from Status.
-
Field Details
-
kDistanceOutput
public static final int kDistanceOutputDistance frame- See Also:
-
kColorOutput
public static final int kColorOutputColor frame- See Also:
-
kDigitalOutput
public static final int kDigitalOutputDigital output frame- See Also:
-
kClearStickyDigout
public static final int kClearStickyDigoutClear sticky digout state which is broadcast over CAN- See Also:
-
kEnumerate
public static final int kEnumerateDevice enumerate response- See Also:
-
kPartyMode
public static final int kPartyModeParty mode- See Also:
-
kStatus
public static final int kStatusStatus frame- See Also:
-
kClearStickyFaults
public static final int kClearStickyFaultsClear device sticky faults- See Also:
-
kReportSetting
public static final int kReportSettingsetting value report from device- See Also:
-
kSetSetting
public static final int kSetSettingupdate setting on device- See Also:
-
kSettingCommand
public static final int kSettingCommandsetting control command- See Also:
-
kDlc_DistanceOutput
public static final int kDlc_DistanceOutputDISTANCE_OUTPUT message length- See Also:
-
kDlc_ColorOutput
public static final int kDlc_ColorOutputCOLOR_OUTPUT message length- See Also:
-
kDlc_DigitalOutput
public static final int kDlc_DigitalOutputDIGITAL_OUTPUT message length- See Also:
-
kDlc_ClearStickyDigout
public static final int kDlc_ClearStickyDigoutCLEAR_STICKY_DIGOUT message length- See Also:
-
kDlc_Enumerate
public static final int kDlc_EnumerateENUMERATE message length- See Also:
-
kDlcMin_PartyMode
public static final int kDlcMin_PartyModePARTY_MODE message min length- See Also:
-
kDlcMax_PartyMode
public static final int kDlcMax_PartyModePARTY_MODE message max length- See Also:
-
kDlc_Status
public static final int kDlc_StatusSTATUS message length- See Also:
-
kDlcMin_ClearStickyFaults
public static final int kDlcMin_ClearStickyFaultsCLEAR_STICKY_FAULTS message min length- See Also:
-
kDlcMax_ClearStickyFaults
public static final int kDlcMax_ClearStickyFaultsCLEAR_STICKY_FAULTS message max length- See Also:
-
kDlc_ReportSetting
public static final int kDlc_ReportSettingREPORT_SETTING message length- See Also:
-
kDlc_SetSetting
public static final int kDlc_SetSettingSET_SETTING message length- See Also:
-
kDlcMin_SettingCommand
public static final int kDlcMin_SettingCommandSETTING_COMMAND message min length- See Also:
-
kDlcMax_SettingCommand
public static final int kDlcMax_SettingCommandSETTING_COMMAND message max length- See Also:
-
-
Method Details
-
extractDistanceOutput_Distance
public static int extractDistanceOutput_Distance(long field) Extracts 16-bit distance value. Actual correspondance to real-world units is config and surface-dependent. from DistanceOutput.- Parameters:
field
- data bitfield- Returns:
- distance as a uint:16
-
extractColorOutput_Red
public static int extractColorOutput_Red(long field) Extracts Red reading magnitude from ColorOutput.- Parameters:
field
- data bitfield- Returns:
- red as a uint:20
-
extractColorOutput_Green
public static int extractColorOutput_Green(long field) Extracts Green reading magnitude from ColorOutput.- Parameters:
field
- data bitfield- Returns:
- green as a uint:20
-
extractColorOutput_Blue
public static int extractColorOutput_Blue(long field) Extracts Blue reading magnitude from ColorOutput.- Parameters:
field
- data bitfield- Returns:
- blue as a uint:20
-
extractColorOutput_Period
public static int extractColorOutput_Period(long field) Extracts Color integration period from ColorOutput.- Parameters:
field
- data bitfield- Returns:
- period as a enum:COLOR_INTEGRATION_PERIOD
-
extractDigitalOutput_Digout1State
public static boolean extractDigitalOutput_Digout1State(long field) Extracts Digital output state for DIGOUT1 from DigitalOutput.- Parameters:
field
- data bitfield- Returns:
- digout1_state as a bool
-
extractDigitalOutput_Digout2State
public static boolean extractDigitalOutput_Digout2State(long field) Extracts Digital output state for DIGOUT2 from DigitalOutput.- Parameters:
field
- data bitfield- Returns:
- digout2_state as a bool
-
extractDigitalOutput_Digout1Sticky
public static boolean extractDigitalOutput_Digout1Sticky(long field) Extracts Sticky digital output state for DIGOUT1 from DigitalOutput.- Parameters:
field
- data bitfield- Returns:
- digout1_sticky as a bool
-
extractDigitalOutput_Digout2Sticky
public static boolean extractDigitalOutput_Digout2Sticky(long field) Extracts Sticky digital output state for DIGOUT1 from DigitalOutput.- Parameters:
field
- data bitfield- Returns:
- digout2_sticky as a bool
-
extractDigitalOutput_Digout1Cond
public static int extractDigitalOutput_Digout1Cond(long field) Extracts DIGOUT1 condition slot flags. A value of 1 for bit N means that condition slot is true. Bits are indexed little-endian. from DigitalOutput.- Parameters:
field
- data bitfield- Returns:
- digout1_cond as a bitset:16
-
extractDigitalOutput_Digout2Cond
public static int extractDigitalOutput_Digout2Cond(long field) Extracts DIGOUT2 condition slot flags. A value of 1 for bit N means that condition slot is true. Bits are indexed little-endian. from DigitalOutput.- Parameters:
field
- data bitfield- Returns:
- digout2_cond as a bitset:16
-
extractEnumerate_Serial
public static long extractEnumerate_Serial(long field) Extracts Device-unique serial number from Enumerate.- Parameters:
field
- data bitfield- Returns:
- serial as a buf:48
-
extractEnumerate_IsBootloader
public static boolean extractEnumerate_IsBootloader(long field) Extracts Device is in bootloader. from Enumerate.- Parameters:
field
- data bitfield- Returns:
- is_bootloader as a bool
-
extractPartyMode_PartyLevel
public static int extractPartyMode_PartyLevel(long field) Extracts Party level. 0 disables the strobe, whereas each increased value up to 10 increases strobe period by 50 ms. from PartyMode.- Parameters:
field
- data bitfield- Returns:
- party_level as a uint:8
-
extractStatus_Faults
public static int extractStatus_Faults(long field) Extracts 8-bit active faults bitfield from Status.- Parameters:
field
- data bitfield- Returns:
- faults as a bitset:8
-
extractStatus_StickyFaults
public static int extractStatus_StickyFaults(long field) Extracts 8-bit sticky faults bitfield from Status.- Parameters:
field
- data bitfield- Returns:
- sticky_faults as a bitset:8
-
extractStatus_Temperature
public static int extractStatus_Temperature(long field) Extracts 16-bit signed temperature byte in 1/256ths of a Celsius from Status.- Parameters:
field
- data bitfield- Returns:
- temperature as a sint:16
-
extractReportSetting_Address
public static int extractReportSetting_Address(long field) Extracts Setting index to write to from ReportSetting.- Parameters:
field
- data bitfield- Returns:
- address as a enum:SETTING
-
extractReportSetting_Value
public static long extractReportSetting_Value(long field) Extracts 6-byte setting value from ReportSetting.- Parameters:
field
- data bitfield- Returns:
- value as a buf:48
-
extractReportSetting_Flags
public static int extractReportSetting_Flags(long field) Extracts Setting receive status from ReportSetting.- Parameters:
field
- data bitfield- Returns:
- flags as a bitset:8
-
extractSetSetting_Address
public static int extractSetSetting_Address(long field) Extracts Setting index to write to from SetSetting.- Parameters:
field
- data bitfield- Returns:
- address as a enum:SETTING
-
extractSetSetting_Value
public static long extractSetSetting_Value(long field) Extracts 6-byte setting value from SetSetting.- Parameters:
field
- data bitfield- Returns:
- value as a buf:48
-
extractSetSetting_Flags_Ephemeral
public static boolean extractSetSetting_Flags_Ephemeral(long field) Extracts Whether the setting should be set ephemeral from SetSetting_Flags.- Parameters:
field
- data bitfield- Returns:
- ephemeral as a bool
-
extractSetSetting_Flags_SynchHold
public static boolean extractSetSetting_Flags_SynchHold(long field) Extracts Whether the setting should be held until the next synch barrier from SetSetting_Flags.- Parameters:
field
- data bitfield- Returns:
- synch_hold as a bool
-
extractSetSetting_Flags_SynchMsgCount
public static int extractSetSetting_Flags_SynchMsgCount(long field) Extracts Synch message count from SetSetting_Flags.- Parameters:
field
- data bitfield- Returns:
- synch_msg_count as a uint:4
-
extractSettingCommand_ControlFlag
public static int extractSettingCommand_ControlFlag(long field) Extracts Setting command index from SettingCommand.- Parameters:
field
- data bitfield- Returns:
- control_flag as a enum:SETTING_COMMAND
-
extractSettingCommand_SettingIndex
public static int extractSettingCommand_SettingIndex(long field) Extracts setting index to fetch from SettingCommand.- Parameters:
field
- data bitfield- Returns:
- setting_index as a enum:SETTING
-
constructDistanceOutput
public static long constructDistanceOutput(int distance) Constructs a DISTANCE_OUTPUT message.- Parameters:
distance
- 16-bit distance value. Actual correspondance to real-world units is config and surface-dependent. (uint:16)- Returns:
- message data as long
-
constructColorOutput
public static long constructColorOutput(int red, int green, int blue, int period) Constructs a COLOR_OUTPUT message.- Parameters:
red
- Red reading magnitude (uint:20)green
- Green reading magnitude (uint:20)blue
- Blue reading magnitude (uint:20)period
- Color integration period (enum:COLOR_INTEGRATION_PERIOD)- Returns:
- message data as long
-
constructDigitalOutput
public static long constructDigitalOutput(boolean digout1State, boolean digout2State, boolean digout1Sticky, boolean digout2Sticky, int digout1Cond, int digout2Cond) Constructs a DIGITAL_OUTPUT message.- Parameters:
digout1State
- Digital output state for DIGOUT1 (bool)digout2State
- Digital output state for DIGOUT2 (bool)digout1Sticky
- Sticky digital output state for DIGOUT1 (bool)digout2Sticky
- Sticky digital output state for DIGOUT1 (bool)digout1Cond
- DIGOUT1 condition slot flags. A value of 1 for bit N means that condition slot is true. Bits are indexed little-endian. (bitset:16)digout2Cond
- DIGOUT2 condition slot flags. A value of 1 for bit N means that condition slot is true. Bits are indexed little-endian. (bitset:16)- Returns:
- message data as long
-
constructClearStickyDigout
public static long constructClearStickyDigout()Constructs a CLEAR_STICKY_DIGOUT message.- Returns:
- message data as long
-
constructEnumerate
public static long constructEnumerate(long serial, boolean isBootloader) Constructs a ENUMERATE message.- Parameters:
serial
- Device-unique serial number (buf:48)isBootloader
- Device is in bootloader. (bool)- Returns:
- message data as long
-
constructPartyMode
public static long constructPartyMode(int partyLevel) Constructs a PARTY_MODE message.- Parameters:
partyLevel
- Party level. 0 disables the strobe, whereas each increased value up to 10 increases strobe period by 50 ms. (uint:8)- Returns:
- message data as long
-
constructStatus
public static long constructStatus(int faults, int stickyFaults, int temperature) Constructs a STATUS message.- Parameters:
faults
- 8-bit active faults bitfield (bitset:8)stickyFaults
- 8-bit sticky faults bitfield (bitset:8)temperature
- 16-bit signed temperature byte in 1/256ths of a Celsius (sint:16)- Returns:
- message data as long
-
constructClearStickyFaults
public static long constructClearStickyFaults()Constructs a CLEAR_STICKY_FAULTS message.- Returns:
- message data as long
-
constructReportSetting
public static long constructReportSetting(int address, long value, int flags) Constructs a REPORT_SETTING message.- Parameters:
address
- Setting index to write to (enum:SETTING)value
- 6-byte setting value (buf:48)flags
- Setting receive status (bitset:8)- Returns:
- message data as long
-
constructSetSetting
public static long constructSetSetting(int address, long value, boolean flagsEphemeral, boolean flagsSynchHold, int flagsSynchMsgCount) Constructs a SET_SETTING message.- Parameters:
address
- Setting index to write to (enum:SETTING)value
- 6-byte setting value (buf:48)flagsEphemeral
- Whether the setting should be set ephemeral (bool)flagsSynchHold
- Whether the setting should be held until the next synch barrier (bool)flagsSynchMsgCount
- Synch message count (uint:4)- Returns:
- message data as long
-
constructSettingCommand
public static long constructSettingCommand(int controlFlag, int settingIndex) Constructs a SETTING_COMMAND message.- Parameters:
controlFlag
- Setting command index (enum:SETTING_COMMAND)settingIndex
- setting index to fetch (enum:SETTING)- Returns:
- message data as long
-
checkDlcForDistanceOutput
public static boolean checkDlcForDistanceOutput(int dlc) Check if DISTANCE_OUTPUT message length is valid.- Parameters:
dlc
- length to check- Returns:
- true if valid
-
checkDlcForColorOutput
public static boolean checkDlcForColorOutput(int dlc) Check if COLOR_OUTPUT message length is valid.- Parameters:
dlc
- length to check- Returns:
- true if valid
-
checkDlcForDigitalOutput
public static boolean checkDlcForDigitalOutput(int dlc) Check if DIGITAL_OUTPUT message length is valid.- Parameters:
dlc
- length to check- Returns:
- true if valid
-
checkDlcForClearStickyDigout
public static boolean checkDlcForClearStickyDigout(int dlc) Check if CLEAR_STICKY_DIGOUT message length is valid.- Parameters:
dlc
- length to check- Returns:
- true if valid
-
checkDlcForEnumerate
public static boolean checkDlcForEnumerate(int dlc) Check if ENUMERATE message length is valid.- Parameters:
dlc
- length to check- Returns:
- true if valid
-
checkDlcForPartyMode
public static boolean checkDlcForPartyMode(int dlc) Check if PARTY_MODE message length is valid.- Parameters:
dlc
- length to check- Returns:
- true if valid
-
checkDlcForStatus
public static boolean checkDlcForStatus(int dlc) Check if STATUS message length is valid.- Parameters:
dlc
- length to check- Returns:
- true if valid
-
checkDlcForClearStickyFaults
public static boolean checkDlcForClearStickyFaults(int dlc) Check if CLEAR_STICKY_FAULTS message length is valid.- Parameters:
dlc
- length to check- Returns:
- true if valid
-
checkDlcForReportSetting
public static boolean checkDlcForReportSetting(int dlc) Check if REPORT_SETTING message length is valid.- Parameters:
dlc
- length to check- Returns:
- true if valid
-
checkDlcForSetSetting
public static boolean checkDlcForSetSetting(int dlc) Check if SET_SETTING message length is valid.- Parameters:
dlc
- length to check- Returns:
- true if valid
-
checkDlcForSettingCommand
public static boolean checkDlcForSettingCommand(int dlc) Check if SETTING_COMMAND message length is valid.- Parameters:
dlc
- length to check- Returns:
- true if valid
-