|
|
|
@ -43,13 +43,13 @@ import org.thingsboard.server.common.data.DeviceTransportType; |
|
|
|
import org.thingsboard.server.common.data.device.data.lwm2m.BootstrapConfiguration; |
|
|
|
import org.thingsboard.server.common.data.device.profile.DeviceProfileTransportConfiguration; |
|
|
|
import org.thingsboard.server.common.data.device.profile.Lwm2mDeviceProfileTransportConfiguration; |
|
|
|
import org.thingsboard.server.common.data.ota.OtaPackageKey; |
|
|
|
import org.thingsboard.server.common.data.ota.OtaPackageType; |
|
|
|
import org.thingsboard.server.common.data.ota.OtaPackageUpdateStatus; |
|
|
|
import org.thingsboard.server.common.data.ota.OtaPackageUtil; |
|
|
|
import org.thingsboard.server.common.transport.TransportServiceCallback; |
|
|
|
import org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient; |
|
|
|
import org.thingsboard.server.transport.lwm2m.server.client.ResourceValue; |
|
|
|
import org.thingsboard.server.transport.lwm2m.server.ota.firmware.UpdateResultFw; |
|
|
|
import org.thingsboard.server.transport.lwm2m.server.ota.firmware.UpdateStateFw; |
|
|
|
import org.thingsboard.server.transport.lwm2m.server.ota.software.UpdateResultSw; |
|
|
|
import org.thingsboard.server.transport.lwm2m.server.ota.software.UpdateStateSw; |
|
|
|
import org.thingsboard.server.transport.lwm2m.server.uplink.DefaultLwM2MUplinkMsgHandler; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
@ -77,277 +77,20 @@ import static org.eclipse.leshan.core.model.ResourceModel.Type.STRING; |
|
|
|
import static org.eclipse.leshan.core.model.ResourceModel.Type.TIME; |
|
|
|
import static org.thingsboard.server.common.data.lwm2m.LwM2mConstants.LWM2M_SEPARATOR_KEY; |
|
|
|
import static org.thingsboard.server.common.data.lwm2m.LwM2mConstants.LWM2M_SEPARATOR_PATH; |
|
|
|
import static org.thingsboard.server.common.data.ota.OtaPackageUpdateStatus.DOWNLOADED; |
|
|
|
import static org.thingsboard.server.common.data.ota.OtaPackageUpdateStatus.DOWNLOADING; |
|
|
|
import static org.thingsboard.server.common.data.ota.OtaPackageUpdateStatus.FAILED; |
|
|
|
import static org.thingsboard.server.common.data.ota.OtaPackageUpdateStatus.UPDATED; |
|
|
|
import static org.thingsboard.server.common.data.ota.OtaPackageUpdateStatus.UPDATING; |
|
|
|
import static org.thingsboard.server.common.data.ota.OtaPackageUpdateStatus.VERIFIED; |
|
|
|
import static org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.FW_RESULT_ID; |
|
|
|
import static org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.FW_STATE_ID; |
|
|
|
import static org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.SW_RESULT_ID; |
|
|
|
import static org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.SW_UPDATE_STATE_ID; |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
public class LwM2mTransportUtil { |
|
|
|
|
|
|
|
public static final String EVENT_AWAKE = "AWAKE"; |
|
|
|
public static final String RESPONSE_REQUEST_CHANNEL = "RESP_REQ"; |
|
|
|
public static final String RESPONSE_CHANNEL = "RESP"; |
|
|
|
public static final String OBSERVE_CHANNEL = "OBSERVE"; |
|
|
|
|
|
|
|
public static final String TRANSPORT_DEFAULT_LWM2M_VERSION = "1.0"; |
|
|
|
public static final String CLIENT_LWM2M_SETTINGS = "clientLwM2mSettings"; |
|
|
|
public static final String BOOTSTRAP = "bootstrap"; |
|
|
|
public static final String SERVERS = "servers"; |
|
|
|
public static final String LWM2M_SERVER = "lwm2mServer"; |
|
|
|
public static final String BOOTSTRAP_SERVER = "bootstrapServer"; |
|
|
|
public static final String OBSERVE_ATTRIBUTE_TELEMETRY = "observeAttr"; |
|
|
|
public static final String ATTRIBUTE = "attribute"; |
|
|
|
public static final String TELEMETRY = "telemetry"; |
|
|
|
public static final String KEY_NAME = "keyName"; |
|
|
|
public static final String OBSERVE_LWM2M = "observe"; |
|
|
|
public static final String ATTRIBUTE_LWM2M = "attributeLwm2m"; |
|
|
|
|
|
|
|
private static final String REQUEST = "/request"; |
|
|
|
private static final String ATTRIBUTES = "/" + ATTRIBUTE; |
|
|
|
public static final String TELEMETRIES = "/" + TELEMETRY; |
|
|
|
public static final String ATTRIBUTES_REQUEST = ATTRIBUTES + REQUEST; |
|
|
|
public static final String DEVICE_ATTRIBUTES_REQUEST = ATTRIBUTES_REQUEST + "/"; |
|
|
|
|
|
|
|
public static final long DEFAULT_TIMEOUT = 2 * 60 * 1000L; // 2min in ms
|
|
|
|
public static final String LWM2M_VERSION_DEFAULT = "1.0"; |
|
|
|
|
|
|
|
public static final String LOG_LWM2M_TELEMETRY = "logLwm2m"; |
|
|
|
public static final String LOG_LWM2M_INFO = "info"; |
|
|
|
public static final String LOG_LWM2M_ERROR = "error"; |
|
|
|
public static final String LOG_LWM2M_WARN = "warn"; |
|
|
|
public static final String LOG_LWM2M_VALUE = "value"; |
|
|
|
|
|
|
|
public static final String CLIENT_NOT_AUTHORIZED = "Client not authorized"; |
|
|
|
public static final String LWM2M_VERSION_DEFAULT = "1.0"; |
|
|
|
|
|
|
|
// Firmware
|
|
|
|
public static final String FIRMWARE_UPDATE_COAP_RECOURSE = "tbfw"; |
|
|
|
public static final String FW_UPDATE = "Firmware update"; |
|
|
|
public static final Integer FW_5_ID = 5; |
|
|
|
public static final Integer FW_19_ID = 19; |
|
|
|
|
|
|
|
// Package W
|
|
|
|
public static final String FW_PACKAGE_5_ID = "/5/0/0"; |
|
|
|
public static final String FW_PACKAGE_19_ID = "/19/0/0"; |
|
|
|
// Package URI
|
|
|
|
public static final String FW_PACKAGE_URI_ID = "/5/0/1"; |
|
|
|
// State R
|
|
|
|
public static final String FW_STATE_ID = "/5/0/3"; |
|
|
|
// Update Result R
|
|
|
|
public static final String FW_RESULT_ID = "/5/0/5"; |
|
|
|
|
|
|
|
public static final String FW_DELIVERY_METHOD = "/5/0/9"; |
|
|
|
|
|
|
|
// PkgName R
|
|
|
|
public static final String FW_NAME_ID = "/5/0/6"; |
|
|
|
// PkgVersion R
|
|
|
|
public static final String FW_5_VER_ID = "/5/0/7"; |
|
|
|
|
|
|
|
/** |
|
|
|
* Quectel@Hi15RM1-HLB_V1.0@BC68JAR01A10,V150R100C20B300SP7,V150R100C20B300SP7@8 |
|
|
|
* BC68JAR01A10 |
|
|
|
* # Request prodct type number |
|
|
|
* ATI |
|
|
|
* Quectel |
|
|
|
* BC68 |
|
|
|
* Revision:BC68JAR01A10 |
|
|
|
*/ |
|
|
|
public static final String FW_3_VER_ID = "/3/0/3"; |
|
|
|
// Update E
|
|
|
|
public static final String FW_UPDATE_ID = "/5/0/2"; |
|
|
|
|
|
|
|
// Software
|
|
|
|
public static final String SOFTWARE_UPDATE_COAP_RECOURSE = "softwareUpdateCoapRecourse"; |
|
|
|
public static final String SW_UPDATE = "Software update"; |
|
|
|
public static final Integer SW_ID = 9; |
|
|
|
// Package W
|
|
|
|
public static final String SW_PACKAGE_ID = "/9/0/2"; |
|
|
|
// Package URI
|
|
|
|
public static final String SW_PACKAGE_URI_ID = "/9/0/3"; |
|
|
|
// Update State R
|
|
|
|
public static final String SW_UPDATE_STATE_ID = "/9/0/7"; |
|
|
|
// Update Result R
|
|
|
|
public static final String SW_RESULT_ID = "/9/0/9"; |
|
|
|
// PkgName R
|
|
|
|
public static final String SW_NAME_ID = "/9/0/0"; |
|
|
|
// PkgVersion R
|
|
|
|
public static final String SW_VER_ID = "/9/0/1"; |
|
|
|
// Install E
|
|
|
|
public static final String SW_INSTALL_ID = "/9/0/4"; |
|
|
|
// Uninstall E
|
|
|
|
public static final String SW_UN_INSTALL_ID = "/9/0/6"; |
|
|
|
|
|
|
|
public enum LwM2mTypeServer { |
|
|
|
BOOTSTRAP(0, "bootstrap"), |
|
|
|
CLIENT(1, "client"); |
|
|
|
|
|
|
|
public int code; |
|
|
|
public String type; |
|
|
|
|
|
|
|
LwM2mTypeServer(int code, String type) { |
|
|
|
this.code = code; |
|
|
|
this.type = type; |
|
|
|
} |
|
|
|
|
|
|
|
public static LwM2mTypeServer fromLwM2mTypeServer(String type) { |
|
|
|
for (LwM2mTypeServer sm : LwM2mTypeServer.values()) { |
|
|
|
if (sm.type.equals(type)) { |
|
|
|
return sm; |
|
|
|
} |
|
|
|
} |
|
|
|
throw new IllegalArgumentException(String.format("Unsupported typeServer type : %d", type)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static Optional<OtaPackageUpdateStatus> toOtaPackageUpdateStatus(UpdateResultFw updateResultFw) { |
|
|
|
switch (updateResultFw) { |
|
|
|
case INITIAL: |
|
|
|
return Optional.empty(); |
|
|
|
case UPDATE_SUCCESSFULLY: |
|
|
|
return Optional.of(UPDATED); |
|
|
|
case NOT_ENOUGH: |
|
|
|
case OUT_OFF_MEMORY: |
|
|
|
case CONNECTION_LOST: |
|
|
|
case INTEGRITY_CHECK_FAILURE: |
|
|
|
case UNSUPPORTED_TYPE: |
|
|
|
case INVALID_URI: |
|
|
|
case UPDATE_FAILED: |
|
|
|
case UNSUPPORTED_PROTOCOL: |
|
|
|
return Optional.of(FAILED); |
|
|
|
default: |
|
|
|
throw new CodecException("Invalid value stateFw %s for FirmwareUpdateStatus.", updateResultFw.name()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static Optional<OtaPackageUpdateStatus> toOtaPackageUpdateStatus(UpdateStateFw updateStateFw) { |
|
|
|
switch (updateStateFw) { |
|
|
|
case IDLE: |
|
|
|
return Optional.empty(); |
|
|
|
case DOWNLOADING: |
|
|
|
return Optional.of(DOWNLOADING); |
|
|
|
case DOWNLOADED: |
|
|
|
return Optional.of(DOWNLOADED); |
|
|
|
case UPDATING: |
|
|
|
return Optional.of(UPDATING); |
|
|
|
default: |
|
|
|
throw new CodecException("Invalid value stateFw %d for FirmwareUpdateStatus.", updateStateFw); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* SW Update State R |
|
|
|
* 0: INITIAL Before downloading. (see 5.1.2.1) |
|
|
|
* 1: DOWNLOAD STARTED The downloading process has started and is on-going. (see 5.1.2.2) |
|
|
|
* 2: DOWNLOADED The package has been completely downloaded (see 5.1.2.3) |
|
|
|
* 3: DELIVERED In that state, the package has been correctly downloaded and is ready to be installed. (see 5.1.2.4) |
|
|
|
* If executing the Install Resource failed, the state remains at DELIVERED. |
|
|
|
* If executing the Install Resource was successful, the state changes from DELIVERED to INSTALLED. |
|
|
|
* After executing the UnInstall Resource, the state changes to INITIAL. |
|
|
|
* 4: INSTALLED |
|
|
|
*/ |
|
|
|
public enum UpdateStateSw { |
|
|
|
INITIAL(0, "Initial"), |
|
|
|
DOWNLOAD_STARTED(1, "DownloadStarted"), |
|
|
|
DOWNLOADED(2, "Downloaded"), |
|
|
|
DELIVERED(3, "Delivered"), |
|
|
|
INSTALLED(4, "Installed"); |
|
|
|
|
|
|
|
public int code; |
|
|
|
public String type; |
|
|
|
|
|
|
|
UpdateStateSw(int code, String type) { |
|
|
|
this.code = code; |
|
|
|
this.type = type; |
|
|
|
} |
|
|
|
|
|
|
|
public static UpdateStateSw fromUpdateStateSwByType(String type) { |
|
|
|
for (UpdateStateSw to : UpdateStateSw.values()) { |
|
|
|
if (to.type.equals(type)) { |
|
|
|
return to; |
|
|
|
} |
|
|
|
} |
|
|
|
throw new IllegalArgumentException(String.format("Unsupported SW State type : %s", type)); |
|
|
|
} |
|
|
|
|
|
|
|
public static UpdateStateSw fromUpdateStateSwByCode(int code) { |
|
|
|
for (UpdateStateSw to : UpdateStateSw.values()) { |
|
|
|
if (to.code == code) { |
|
|
|
return to; |
|
|
|
} |
|
|
|
} |
|
|
|
throw new IllegalArgumentException(String.format("Unsupported SW State type : %s", code)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* SW Update Result |
|
|
|
* Contains the result of downloading or installing/uninstalling the software |
|
|
|
* 0: Initial value. |
|
|
|
* - Prior to download any new package in the Device, Update Result MUST be reset to this initial value. |
|
|
|
* - One side effect of executing the Uninstall resource is to reset Update Result to this initial value "0". |
|
|
|
* 1: Downloading. |
|
|
|
* - The package downloading process is on-going. |
|
|
|
* 2: Software successfully installed. |
|
|
|
* 3: Successfully Downloaded and package integrity verified |
|
|
|
* (( 4-49, for expansion, of other scenarios)) |
|
|
|
* ** Failed |
|
|
|
* 50: Not enough storage for the new software package. |
|
|
|
* 51: Out of memory during downloading process. |
|
|
|
* 52: Connection lost during downloading process. |
|
|
|
* 53: Package integrity check failure. |
|
|
|
* 54: Unsupported package type. |
|
|
|
* 56: Invalid URI |
|
|
|
* 57: Device defined update error |
|
|
|
* 58: Software installation failure |
|
|
|
* 59: Uninstallation Failure during forUpdate(arg=0) |
|
|
|
* 60-200 : (for expansion, selection to be in blocks depending on new introduction of features) |
|
|
|
* This Resource MAY be reported by sending Observe operation. |
|
|
|
*/ |
|
|
|
public enum UpdateResultSw { |
|
|
|
INITIAL(0, "Initial value", false), |
|
|
|
DOWNLOADING(1, "Downloading", false), |
|
|
|
SUCCESSFULLY_INSTALLED(2, "Software successfully installed", false), |
|
|
|
SUCCESSFULLY_DOWNLOADED_VERIFIED(3, "Successfully Downloaded and package integrity verified", false), |
|
|
|
NOT_ENOUGH_STORAGE(50, "Not enough storage for the new software package", true), |
|
|
|
OUT_OFF_MEMORY(51, "Out of memory during downloading process", true), |
|
|
|
CONNECTION_LOST(52, "Connection lost during downloading process", false), |
|
|
|
PACKAGE_CHECK_FAILURE(53, "Package integrity check failure.", false), |
|
|
|
UNSUPPORTED_PACKAGE_TYPE(54, "Unsupported package type", false), |
|
|
|
INVALID_URI(56, "Invalid URI", true), |
|
|
|
UPDATE_ERROR(57, "Device defined update error", true), |
|
|
|
INSTALL_FAILURE(58, "Software installation failure", true), |
|
|
|
UN_INSTALL_FAILURE(59, "Uninstallation Failure during forUpdate(arg=0)", true); |
|
|
|
|
|
|
|
public int code; |
|
|
|
public String type; |
|
|
|
public boolean isAgain; |
|
|
|
|
|
|
|
UpdateResultSw(int code, String type, boolean isAgain) { |
|
|
|
this.code = code; |
|
|
|
this.type = type; |
|
|
|
this.isAgain = isAgain; |
|
|
|
} |
|
|
|
|
|
|
|
public static UpdateResultSw fromUpdateResultSwByType(String type) { |
|
|
|
for (UpdateResultSw to : UpdateResultSw.values()) { |
|
|
|
if (to.type.equals(type)) { |
|
|
|
return to; |
|
|
|
} |
|
|
|
} |
|
|
|
throw new IllegalArgumentException(String.format("Unsupported SW Update Result type : %s", type)); |
|
|
|
} |
|
|
|
|
|
|
|
public static UpdateResultSw fromUpdateResultSwByCode(int code) { |
|
|
|
for (UpdateResultSw to : UpdateResultSw.values()) { |
|
|
|
if (to.code == code) { |
|
|
|
return to; |
|
|
|
} |
|
|
|
} |
|
|
|
throw new IllegalArgumentException(String.format("Unsupported SW Update Result code : %s", code)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public enum LwM2MClientStrategy { |
|
|
|
CLIENT_STRATEGY_1(1, "Read only resources marked as observation"), |
|
|
|
@ -380,45 +123,7 @@ public class LwM2mTransportUtil { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* FirmwareUpdateStatus { |
|
|
|
* DOWNLOADING, DOWNLOADED, VERIFIED, UPDATING, UPDATED, FAILED |
|
|
|
*/ |
|
|
|
public static OtaPackageUpdateStatus EqualsSwSateToFirmwareUpdateStatus(UpdateStateSw updateStateSw, UpdateResultSw updateResultSw) { |
|
|
|
switch (updateResultSw) { |
|
|
|
case INITIAL: |
|
|
|
switch (updateStateSw) { |
|
|
|
case INITIAL: |
|
|
|
case DOWNLOAD_STARTED: |
|
|
|
return DOWNLOADING; |
|
|
|
case DOWNLOADED: |
|
|
|
return DOWNLOADED; |
|
|
|
case DELIVERED: |
|
|
|
return VERIFIED; |
|
|
|
} |
|
|
|
case DOWNLOADING: |
|
|
|
return DOWNLOADING; |
|
|
|
case SUCCESSFULLY_INSTALLED: |
|
|
|
return UPDATED; |
|
|
|
case SUCCESSFULLY_DOWNLOADED_VERIFIED: |
|
|
|
return VERIFIED; |
|
|
|
case NOT_ENOUGH_STORAGE: |
|
|
|
case OUT_OFF_MEMORY: |
|
|
|
case CONNECTION_LOST: |
|
|
|
case PACKAGE_CHECK_FAILURE: |
|
|
|
case UNSUPPORTED_PACKAGE_TYPE: |
|
|
|
case INVALID_URI: |
|
|
|
case UPDATE_ERROR: |
|
|
|
case INSTALL_FAILURE: |
|
|
|
case UN_INSTALL_FAILURE: |
|
|
|
return FAILED; |
|
|
|
default: |
|
|
|
throw new CodecException("Invalid value stateFw %s %s for FirmwareUpdateStatus.", updateStateSw.name(), updateResultSw.name()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static boolean equalsResourceValue(Object valueOld, Object valueNew, ResourceModel.Type type, LwM2mPath |
|
|
|
public static boolean equalsResourceValue(Object valueOld, Object valueNew, ResourceModel.Type type, LwM2mPath |
|
|
|
resourcePath) throws CodecException { |
|
|
|
switch (type) { |
|
|
|
case BOOLEAN: |
|
|
|
@ -477,18 +182,6 @@ public class LwM2mTransportUtil { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
// public static LwM2mClientProfile getNewProfileParameters(JsonObject profilesConfigData, TenantId tenantId) {
|
|
|
|
// LwM2mClientProfile lwM2MClientProfile = new LwM2mClientProfile();
|
|
|
|
// lwM2MClientProfile.setTenantId(tenantId);
|
|
|
|
// lwM2MClientProfile.setPostClientLwM2mSettings(profilesConfigData.get(CLIENT_LWM2M_SETTINGS).getAsJsonObject());
|
|
|
|
// lwM2MClientProfile.setPostKeyNameProfile(profilesConfigData.get(OBSERVE_ATTRIBUTE_TELEMETRY).getAsJsonObject().get(KEY_NAME).getAsJsonObject());
|
|
|
|
// lwM2MClientProfile.setPostAttributeProfile(profilesConfigData.get(OBSERVE_ATTRIBUTE_TELEMETRY).getAsJsonObject().get(ATTRIBUTE).getAsJsonArray());
|
|
|
|
// lwM2MClientProfile.setPostTelemetryProfile(profilesConfigData.get(OBSERVE_ATTRIBUTE_TELEMETRY).getAsJsonObject().get(TELEMETRY).getAsJsonArray());
|
|
|
|
// lwM2MClientProfile.setPostObserveProfile(profilesConfigData.get(OBSERVE_ATTRIBUTE_TELEMETRY).getAsJsonObject().get(OBSERVE_LWM2M).getAsJsonArray());
|
|
|
|
// lwM2MClientProfile.setPostAttributeLwm2mProfile(profilesConfigData.get(OBSERVE_ATTRIBUTE_TELEMETRY).getAsJsonObject().get(ATTRIBUTE_LWM2M).getAsJsonObject());
|
|
|
|
// return lwM2MClientProfile;
|
|
|
|
// }
|
|
|
|
|
|
|
|
public static Lwm2mDeviceProfileTransportConfiguration toLwM2MClientProfile(DeviceProfile deviceProfile) { |
|
|
|
DeviceProfileTransportConfiguration transportConfiguration = deviceProfile.getProfileData().getTransportConfiguration(); |
|
|
|
if (transportConfiguration.getType().equals(DeviceTransportType.LWM2M)) { |
|
|
|
@ -603,7 +296,6 @@ public class LwM2mTransportUtil { |
|
|
|
if (keyArray.length > 1 && keyArray[1].split(LWM2M_SEPARATOR_KEY).length == 2) { |
|
|
|
return pathIdVer; |
|
|
|
} else { |
|
|
|
LwM2mPath pathObjId = new LwM2mPath(pathIdVer); |
|
|
|
return convertObjectIdToVersionedId(pathIdVer, registration); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -743,18 +435,18 @@ public class LwM2mTransportUtil { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static boolean isFwSwWords(String pathName) { |
|
|
|
return OtaPackageUtil.getAttributeKey(OtaPackageType.FIRMWARE, OtaPackageKey.VERSION).equals(pathName) |
|
|
|
|| OtaPackageUtil.getAttributeKey(OtaPackageType.FIRMWARE, OtaPackageKey.TITLE).equals(pathName) |
|
|
|
|| OtaPackageUtil.getAttributeKey(OtaPackageType.FIRMWARE, OtaPackageKey.CHECKSUM).equals(pathName) |
|
|
|
|| OtaPackageUtil.getAttributeKey(OtaPackageType.FIRMWARE, OtaPackageKey.CHECKSUM_ALGORITHM).equals(pathName) |
|
|
|
|| OtaPackageUtil.getAttributeKey(OtaPackageType.FIRMWARE, OtaPackageKey.SIZE).equals(pathName) |
|
|
|
|| OtaPackageUtil.getAttributeKey(OtaPackageType.SOFTWARE, OtaPackageKey.VERSION).equals(pathName) |
|
|
|
|| OtaPackageUtil.getAttributeKey(OtaPackageType.SOFTWARE, OtaPackageKey.TITLE).equals(pathName) |
|
|
|
|| OtaPackageUtil.getAttributeKey(OtaPackageType.SOFTWARE, OtaPackageKey.CHECKSUM).equals(pathName) |
|
|
|
|| OtaPackageUtil.getAttributeKey(OtaPackageType.SOFTWARE, OtaPackageKey.CHECKSUM_ALGORITHM).equals(pathName) |
|
|
|
|| OtaPackageUtil.getAttributeKey(OtaPackageType.SOFTWARE, OtaPackageKey.SIZE).equals(pathName); |
|
|
|
} |
|
|
|
// public static boolean isFwSwWords(String pathName) {
|
|
|
|
// return OtaPackageUtil.getAttributeKey(OtaPackageType.FIRMWARE, OtaPackageKey.VERSION).equals(pathName)
|
|
|
|
// || OtaPackageUtil.getAttributeKey(OtaPackageType.FIRMWARE, OtaPackageKey.TITLE).equals(pathName)
|
|
|
|
// || OtaPackageUtil.getAttributeKey(OtaPackageType.FIRMWARE, OtaPackageKey.CHECKSUM).equals(pathName)
|
|
|
|
// || OtaPackageUtil.getAttributeKey(OtaPackageType.FIRMWARE, OtaPackageKey.CHECKSUM_ALGORITHM).equals(pathName)
|
|
|
|
// || OtaPackageUtil.getAttributeKey(OtaPackageType.FIRMWARE, OtaPackageKey.SIZE).equals(pathName)
|
|
|
|
// || OtaPackageUtil.getAttributeKey(OtaPackageType.SOFTWARE, OtaPackageKey.VERSION).equals(pathName)
|
|
|
|
// || OtaPackageUtil.getAttributeKey(OtaPackageType.SOFTWARE, OtaPackageKey.TITLE).equals(pathName)
|
|
|
|
// || OtaPackageUtil.getAttributeKey(OtaPackageType.SOFTWARE, OtaPackageKey.CHECKSUM).equals(pathName)
|
|
|
|
// || OtaPackageUtil.getAttributeKey(OtaPackageType.SOFTWARE, OtaPackageKey.CHECKSUM_ALGORITHM).equals(pathName)
|
|
|
|
// || OtaPackageUtil.getAttributeKey(OtaPackageType.SOFTWARE, OtaPackageKey.SIZE).equals(pathName);
|
|
|
|
// }
|
|
|
|
|
|
|
|
/** |
|
|
|
* @param lwM2MClient - |
|
|
|
|