com.ibm.wiotp.sdk.devicemgmt

Class DeviceFirmware



  • public class DeviceFirmware
    extends Resource
    Device Firmware as specified in Watson IoT Platform Device Model. The following attributes are present as part of the Device Firmware,
    • mgmt.firmware.version
    • mgmt.firmware.name
    • mgmt.firmware.url
    • mgmt.firmware.verifier
    • mgmt.firmware.state
    • mgmt.firmware.updateStatus
    • mgmt.firmware.updatedDateTime
    • Method Detail

      • update

        public int update(DeviceFirmware firmware)
        Update the Firmware object with new values
        Parameters:
        firmware - The device firmware object to be updated
        Returns:
        code indicating whether the update is successful or not (200 means success, otherwise unsuccessful)
      • update

        public int update(com.google.gson.JsonElement firmware)
        Update the Firmware object with new values
        Specified by:
        update in class Resource
        Parameters:
        firmware - The device firmware object to be updated
        Returns:
        code indicating whether the update is successful or not (200 means success, otherwise unsuccessful)
      • update

        public int update(com.google.gson.JsonElement firmware,
                          boolean fireEvent)
        Update the Firmware object with new values
        Specified by:
        update in class Resource
        Parameters:
        firmware - The device firmware object to be updated
        fireEvent - - whether to fire an update event of not
        Returns:
        code indicating whether the update is successful or not (200 means success, otherwise unsuccessful)
      • getVersion

        public String getVersion()
        returns the version of the firmware
        Returns:
        version
      • setVersion

        public void setVersion(String version)
        Set the firmware with the given version
        Parameters:
        version - version to be updated
      • getUrl

        public String getUrl()
        Returns the firmware URL
        Returns:
        String the Firmware URL
      • setUrl

        public void setUrl(String url)
        Set the firmware URL
        Parameters:
        url - URL that needs to be set
      • getVerifier

        public String getVerifier()
        Returns the firmware Verifier
        Returns:
        String returns the Firmware verifier or null
      • setVerifier

        public void setVerifier(String verifier)
        Set the firmware verifier
        Parameters:
        verifier - verifier that needs to be set
      • getState

        public int getState()
        Returns the firmware state
        Returns:
        returns the state of the Firmware
      • getName

        public String getName()
        Returns the name of the firmware
        Returns:
        returns the name of the firmware
      • setName

        public void setName(String name)
        Set the name of the firmware
        Parameters:
        name - The name of the firmware to be set to
      • getUpdateStatus

        public int getUpdateStatus()
        Returns the Firmware Update status
        Returns:
        Returns the Firmware Update status.
      • setUpdateStatus

        public void setUpdateStatus(DeviceFirmware.FirmwareUpdateStatus updateStatus)
        Set the Firmware Update status
        Parameters:
        updateStatus - the firmware update status to be set to
      • toJsonObject

        public com.google.gson.JsonObject toJsonObject()
        Specified by:
        toJsonObject in class Resource
        Returns:
        JsonObject of the DeviceInfo
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        JSON string of the DeviceInfo
      • getDeviceId

        public String getDeviceId()
      • getTypeId

        public String getTypeId()

Copyright © 2019. All rights reserved.