Class BitwardsResource.ResourceHardware

java.lang.Object
fi.bitwards.service.BitwardsResource.ResourceHardware
Enclosing class:
BitwardsResource

public static class BitwardsResource.ResourceHardware extends Object
This class describes hardware features of the resource.
  • Field Details

    • MAINTENANCE_STATUS_UNKNOWN

      public static final int MAINTENANCE_STATUS_UNKNOWN
      Resource maintenance is unknown.
      See Also:
    • MAINTENANCE_STATUS_NORMAL

      public static final int MAINTENANCE_STATUS_NORMAL
      Resource maintenance was successfully completed, or skipped intentionally.
      See Also:
    • MAINTENANCE_STATUS_FAILED

      public static final int MAINTENANCE_STATUS_FAILED
      Resource maintenance failed.
      See Also:
  • Method Details

    • getBuildHash

      public byte[] getBuildHash()
      Get the build hash of the firmware of the resource.
      Returns:
      the build hash, null if not available.
    • getFirmwareInfo

      public byte[] getFirmwareInfo()
      Get the firmware information of the resource.
      Returns:
      the firmware information, null if not available.
    • getSerialNumber

      public byte[] getSerialNumber()
      Get the serial number of the resource.
      Returns:
      the serial number, null if not available.
    • getResourceTime

      public Date getResourceTime()
      Get the time of the resource. This is the time when resource was last accessed. Smallest time unit is minutes.
      Returns:
      the resource time, null if not available.
    • getResourceProtocolVersion

      public String getResourceProtocolVersion()
      Get the resource protocol version.
      Returns:
      the resource protocol version, null if not available.
    • hasBatteryAlarm

      public boolean hasBatteryAlarm()
      Check if the resource low battery level (applicable to battery powered resources). If value is true, the battery in the resource should be replaced.
      Note: The battery level indication is only available when the resource has been accessed. Possible return values:
      • true: a battery powered resource has been accessed recently, and it has indicated that it has low battery
      • false: the resource has not been accessed recently and hence battery level unknown
      • false: the resource is not battery powered and has an external power source
      • false: the resource is battery powered and battery level is good
      Returns:
      true if battery powered resource has low battery and should be replaced; false otherwise (see method description for details).
    • getLatestRetryCount

      public int getLatestRetryCount()
      Get the retry count for latest resource access attempt.
      Returns:
      the retry count, or -1 if unknown
    • getLatestMaintenanceStatus

      public int getLatestMaintenanceStatus()
      Get status of the resource maintenance after last access attempt.
      • MAINTENANCE_STATUS_UNKNOWN: maintenance status is unknown, i.e., resource has not been accessed recently.
      • MAINTENANCE_STATUS_NORMAL: maintenance status is normal, i.e., maintenance was performed normally, or skipped intentionally during last access attempt.
      • MAINTENANCE_STATUS_FAILED: maintenance status indicates failure, i.e., maintenance was not successful during last access attempt.
      Returns:
      the maintenance status of the latest access attempt.