Package com.reduxrobotics.canand
Class CanandDeviceDetails.Stg
java.lang.Object
com.reduxrobotics.canand.CanandDeviceDetails.Stg
- Enclosing class:
- CanandDeviceDetails
Settings.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Device-specific type identifierstatic final int
Firmware versionstatic final int
Serial numberstatic final int
Status frame period (ms)static int[]
List of settings to fetch for. -
Method Summary
Modifier and TypeMethodDescriptionstatic long
constructDeviceType
(int deviceType) Constructs a DEVICE_TYPE setting.static long
constructFirmwareVersion
(int firmwarePatch, int firmwareMinor, int firmwareYear) Constructs a FIRMWARE_VERSION setting.static long
constructSerialNumber
(long serialNumber) Constructs a SERIAL_NUMBER setting.static long
constructStatusFramePeriod
(int statusFramePeriod) Constructs a STATUS_FRAME_PERIOD setting.static int
extractDeviceType
(long field) Extracts Device-specific type identifier from DeviceType.static int
extractFirmwareVersion_FirmwareMinor
(long field) Extracts Firmware version minor number from FirmwareVersion.static int
extractFirmwareVersion_FirmwarePatch
(long field) Extracts Firmware version patch number from FirmwareVersion.static int
extractFirmwareVersion_FirmwareYear
(long field) Extracts Firmware version year from FirmwareVersion.static long
extractSerialNumber
(long field) Extracts Serial number from SerialNumber.static int
extractStatusFramePeriod
(long field) Extracts Status frame period (ms) from StatusFramePeriod.
-
Field Details
-
kDeviceType
public static final int kDeviceTypeDevice-specific type identifier- See Also:
-
kFirmwareVersion
public static final int kFirmwareVersionFirmware version- See Also:
-
kSerialNumber
public static final int kSerialNumberSerial number- See Also:
-
kStatusFramePeriod
public static final int kStatusFramePeriodStatus frame period (ms)- See Also:
-
settingsAddresses
public static int[] settingsAddressesList of settings to fetch for.
-
-
Method Details
-
extractDeviceType
public static int extractDeviceType(long field) Extracts Device-specific type identifier from DeviceType.- Parameters:
field
- data bitfield- Returns:
- DEVICE_TYPE as a uint:16
-
extractFirmwareVersion_FirmwarePatch
public static int extractFirmwareVersion_FirmwarePatch(long field) Extracts Firmware version patch number from FirmwareVersion.- Parameters:
field
- data bitfield- Returns:
- firmware_patch as a uint:8
-
extractFirmwareVersion_FirmwareMinor
public static int extractFirmwareVersion_FirmwareMinor(long field) Extracts Firmware version minor number from FirmwareVersion.- Parameters:
field
- data bitfield- Returns:
- firmware_minor as a uint:8
-
extractFirmwareVersion_FirmwareYear
public static int extractFirmwareVersion_FirmwareYear(long field) Extracts Firmware version year from FirmwareVersion.- Parameters:
field
- data bitfield- Returns:
- firmware_year as a uint:16
-
extractSerialNumber
public static long extractSerialNumber(long field) Extracts Serial number from SerialNumber.- Parameters:
field
- data bitfield- Returns:
- SERIAL_NUMBER as a buf:48
-
extractStatusFramePeriod
public static int extractStatusFramePeriod(long field) Extracts Status frame period (ms) from StatusFramePeriod.- Parameters:
field
- data bitfield- Returns:
- STATUS_FRAME_PERIOD as a uint:16
-
constructDeviceType
public static long constructDeviceType(int deviceType) Constructs a DEVICE_TYPE setting.- Parameters:
deviceType
- Device-specific type identifier (uint:16)- Returns:
- message data as long
-
constructFirmwareVersion
public static long constructFirmwareVersion(int firmwarePatch, int firmwareMinor, int firmwareYear) Constructs a FIRMWARE_VERSION setting.- Parameters:
firmwarePatch
- Firmware version patch number (uint:8)firmwareMinor
- Firmware version minor number (uint:8)firmwareYear
- Firmware version year (uint:16)- Returns:
- message data as long
-
constructSerialNumber
public static long constructSerialNumber(long serialNumber) Constructs a SERIAL_NUMBER setting.- Parameters:
serialNumber
- Serial number (buf:48)- Returns:
- message data as long
-
constructStatusFramePeriod
public static long constructStatusFramePeriod(int statusFramePeriod) Constructs a STATUS_FRAME_PERIOD setting.- Parameters:
statusFramePeriod
- Status frame period (ms) (uint:16)- Returns:
- message data as long
-