com.ibm.wiotp.sdk.devicemgmt.internal.handler

Class FirmwareUpdateRequestHandler

  • All Implemented Interfaces:
    org.eclipse.paho.client.mqttv3.IMqttMessageListener


    public class FirmwareUpdateRequestHandler
    extends DMRequestHandler
    Request handler for MMqttClient.SERVER_TOPIC_INITIATE_FIRMWARE_UPDATE
    Expected request message format
    { "reqId": "string" }
    • Constructor Detail

      • FirmwareUpdateRequestHandler

        public FirmwareUpdateRequestHandler(ManagedClient dmClient)
    • Method Detail

      • handleRequest

        public void handleRequest(com.google.gson.JsonObject jsonRequest,
                                  String topic)
        If this operation can be initiated immediately, rc should be set to 202. If firmware was not previously downloaded successfully, rc should be set to 400. If firmware update attempt fails, rc should be set to 500 and the message field can optionally be set to contain relevant information. If firmware update is not supported rc should be set to 501 and the message field can optionally be set to contain relevant information. If mgmt.firmware.state is not 2 (Downloaded), an error should be reported with rc set to 400 and an optional message text. Otherwise, mgmt.firmware.updateStatus should be set to 1 (In Progress) and firmware installation should start. If firmware installation fails, mgmt.firmware.updateStatus should be set to either: 2 (Out of Memory) 5 (Unsupported Image) Once firmware update is complete, mgmt.firmware.updateStatus should be set to 0 (Success), mgmt.firmware.state should be set to 0 (Idle), downloaded firmware image can be deleted from the device and deviceInfo.fwVersion should be set to the value of mgmt.firmware.version.
        Specified by:
        handleRequest in class DMRequestHandler

Copyright © 2019. All rights reserved.