Skip to content

Commit

Permalink
Restyled by google-java-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and joonhaengHeo committed Nov 2, 2023
1 parent 28099f4 commit 83c9875
Showing 1 changed file with 32 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
package chip.devicecontroller;

import javax.annotation.Nullable;
import javax.management.Query;

/**
* Delegate for OTA Provider.
*
* See detailed in {@link ChipDeviceController#startOTAProvider(OTAProviderDelegate)}
* <p>See detailed in {@link ChipDeviceController#startOTAProvider(OTAProviderDelegate)}
*/
public interface OTAProviderDelegate {
/**
* Called to handle a QueryImage command and is responsible for sending the response (if success) or status (if error).
* Called to handle a QueryImage command and is responsible for sending the response (if success)
* or status (if error).
*
* @param vendorId Vendor ID applying to the OTA Requestor’s Node.
* @param productId Product ID applying to the OTA Requestor’s Node.
Expand All @@ -37,8 +37,8 @@ public interface OTAProviderDelegate {
* @param location OTA Requestor's current location. Can be set null.
* @param requestorCanConsent Variable for whether user consent is required. Can be set null.
* @param metadataForProvider Manufacturer-specific payload. Can be set null.
*
* @return QueryImageResponse Send Firmware image information, See detailed in {@link OTAProviderDelegate#QueryImageResponse}
* @return QueryImageResponse Send Firmware image information, See detailed in {@link
* OTAProviderDelegate#QueryImageResponse}
*/
public QueryImageResponse handleQueryImage(
int vendorId,
Expand All @@ -50,15 +50,17 @@ public QueryImageResponse handleQueryImage(
@Nullable byte[] metadataForProvider);

/**
* The callback will be invoked when receiving or responding to a QueryImage, it is called with an ErrorCode.
* The callback will be invoked when receiving or responding to a QueryImage, it is called with an
* ErrorCode.
*/
public void handleOTAQueryFailure(int error);

/**
* The callback will be invoked when BDX Transfer session is begined.
*
* @param nodeId OTA Requester's Node ID
* @param fileDesignator a variable-length identifier chosen by the Initiator to identify the payload to be transferred.
* @param fileDesignator a variable-length identifier chosen by the Initiator to identify the
* payload to be transferred.
* @param offset image's offset
*/
public void handleBDXTransferSessionBegin(long nodeId, String fileDesignator, long offset);
Expand All @@ -70,13 +72,11 @@ public QueryImageResponse handleQueryImage(
* @param blockSize Max blockSize that can be sent
* @param blockIndex block Index value
* @param bytesToSkip Bytes to skip
*
* @return BDXData sending packet in image, See detailed in {@link OTAProviderDelegate#BDXData}
*
**/
*/
public BDXData handleBDXQuery(long nodeId, int blockSize, long blockIndex, long bytesToSkip);

/**
/**
* The callback will be invoked when BDX Transfer session is ended.
*
* @param nodeId errorCode if transfer is failed.
Expand All @@ -85,12 +85,13 @@ public QueryImageResponse handleQueryImage(
public void handleBDXTransferSessionEnd(long errorCode, long nodeId);

/**
* Called to handle an ApplyUpdateRequest command and is responsible for sending the response (if success) or status (if error).
* Called to handle an ApplyUpdateRequest command and is responsible for sending the response (if
* success) or status (if error).
*
* @param nodeId OTA Requester's Node ID
* @param newVersion New version to update
*
* @return ApplyUpdateResponse response for future action. See detailed in {@link OTAProvider#ApplyUpdateResponse}
* @return ApplyUpdateResponse response for future action. See detailed in {@link
* OTAProvider#ApplyUpdateResponse}
*/
public ApplyUpdateResponse handleApplyUpdateRequest(long nodeId, long newVersion);

Expand All @@ -101,10 +102,10 @@ public QueryImageResponse handleQueryImage(
*/
public default void handleNotifyUpdateApplied(long nodeId) {}

/**
* This is a class used when transmitting using the BDX Protocol.
* If isEOF value set true, OTA Requester treats the data transfer as finished.
*/
/**
* This is a class used when transmitting using the BDX Protocol. If isEOF value set true, OTA
* Requester treats the data transfer as finished.
*/
public class BDXData {
@Nullable private byte[] data;
private boolean isEOF;
Expand All @@ -123,9 +124,7 @@ public boolean isEOF() {
}
}

/**
* This is a class used to send Image information.
*/
/** This is a class used to send Image information. */
public class QueryImageResponse {
@Nullable Long softwareVersion;
@Nullable String softwareVersionString;
Expand All @@ -151,10 +150,11 @@ public String getFilePath() {
}
}

/**
* This class is used to inform whether the OTA Requester starts updating.
* Class can set Delay Time and Enum value for next action. See {@link OTAProviderDelegate#ApplyUpdateActionEnum} for more information.
*/
/**
* This class is used to inform whether the OTA Requester starts updating. Class can set Delay
* Time and Enum value for next action. See {@link OTAProviderDelegate#ApplyUpdateActionEnum} for
* more information.
*/
public class ApplyUpdateResponse {
private ApplyUpdateActionEnum action;
private long delayedActionTime;
Expand All @@ -172,21 +172,16 @@ public long getDelayedActionTime() {
return delayedActionTime;
}
}
/**
* The Action field SHALL express the action that the OTA Provider requests from the OTA Requestor.
*/
/**
* The Action field SHALL express the action that the OTA Provider requests from the OTA
* Requestor.
*/
public enum ApplyUpdateActionEnum {
/**
* Apply the update.
*/
/** Apply the update. */
Proceed(0),
/**
* Wait at least the given delay time.
*/
/** Wait at least the given delay time. */
AwaitNextAction(1),
/**
* The OTA Provider is conveying a desire to rescind a previously provided Software Image.
*/
/** The OTA Provider is conveying a desire to rescind a previously provided Software Image. */
Discontinue(2);

private int value;
Expand Down

0 comments on commit 83c9875

Please sign in to comment.