public class OTAService extends AbstractService
限定符和类型 | 字段和说明 |
---|---|
static int |
OTA_CODE_BUSY |
static int |
OTA_CODE_CHECK_FAIL |
static int |
OTA_CODE_DOWNLOAD_TIMEOUT |
static int |
OTA_CODE_INNER_ERROR |
static int |
OTA_CODE_INSTALL_FAIL |
static int |
OTA_CODE_LOW_MEMORY |
static int |
OTA_CODE_LOW_POWER |
static int |
OTA_CODE_LOW_SPACE |
static int |
OTA_CODE_NO_NEED |
static int |
OTA_CODE_SIGNAL_BAD |
static int |
OTA_CODE_SUCCESS |
static int |
OTA_CODE_UNKNOWN_TYPE |
构造器和说明 |
---|
OTAService() |
限定符和类型 | 方法和说明 |
---|---|
void |
onEvent(DeviceEvent deviceEvent)
接收OTA事件处理
|
void |
reportOtaStatus(int result,
int progress,
java.lang.String version,
java.lang.String description)
上报升级状态
|
void |
reportVersion(java.lang.String version)
上报固件版本信息
|
void |
setOtaListener(OTAListener otaListener)
设置OTA监听器
|
disableAutoReport, enableAutoReport, firePropertiesChanged, getIotDevice, getServiceId, onCommand, onRead, onWrite, setIotDevice, setServiceId
public static final int OTA_CODE_SUCCESS
public static final int OTA_CODE_BUSY
public static final int OTA_CODE_SIGNAL_BAD
public static final int OTA_CODE_NO_NEED
public static final int OTA_CODE_LOW_POWER
public static final int OTA_CODE_LOW_SPACE
public static final int OTA_CODE_DOWNLOAD_TIMEOUT
public static final int OTA_CODE_CHECK_FAIL
public static final int OTA_CODE_UNKNOWN_TYPE
public static final int OTA_CODE_LOW_MEMORY
public static final int OTA_CODE_INSTALL_FAIL
public static final int OTA_CODE_INNER_ERROR
public void setOtaListener(OTAListener otaListener)
otaListener
- OTA监听器public void reportOtaStatus(int result, int progress, java.lang.String version, java.lang.String description)
result
- 升级结果progress
- 升级进度0-100version
- 当前版本description
- 具体失败的原因,可选参数public void reportVersion(java.lang.String version)
version
- 固件版本public void onEvent(DeviceEvent deviceEvent)
onEvent
在接口中 IService
onEvent
在类中 AbstractService
deviceEvent
- 服务事件