3 接口说明

3.1 设备认证相关接口

JL_Auth_xxx-release 实现了设备认证流程。

关于认证需要特别注意以下几点:

  • 在使用RCSP协议进行交互时,若设备端开启认证,小程序端要在RCSP交互之前进行设备认证,否则设备端是不会回复RCSP协议命令。

  • 不可重复认证,大多数设备(仅有少量手表设备支持重复认证)只能一次连接进行一次认证。

设备认证操作类(Auth)

Auth 设备认证操作类,提供接口如下:

方法名

功能

参数

返回值

startAuth

开始认证

deviceId:string//设备

callback:AuthListener//设备认证监听回调

void

stopAuth

结束认证

void

handlerAuth

接收认证回复数据

deviceId:string//设备deviceId

data:ArrayBuffer//回复数据

void

设备认证监听回调(AuthListener)

设备认证实现类 Auth 的监听回调 AuthListener , 当发送认证数据、认证结束时进行回调。

属性

参数

描述

onSendData

deviceId:string//设备

data:ArrayBuffer//认证数据

发送数据

onAuthSuccess

deviceId:string//设备

认证成功

onAuthFailed

deviceId:string//设备

认证失败

3.2 OTA流程相关接口

JL_OTA_xxx-release 实现了OTA流程,包括单备份升级和双备份升级。

3.2.1 基于RCSP命令的OTA管理类(RcspOTAManager)

基于OTA流程( OTAImpl )和RCSP协议( RcspImpl)实现的OTA管理类。内部处理了OTA流程和RCSP命令的解析打包。

方法

参数

返回值

描述

release

void

释放内存

startOTA

config: OtaConfig //升级配置

callback: OnUpgradeCallback //升级回调

void

开始升级

cancelOTA

void

取消升级

isOTA

boolean

是否正在OTA

getCurrentOTADevice

BtDevice | null

获取正在升级的设备(deviceId,name)

updateRcspImpl

rcspImpl: RcspImpl //命令协议对象

void

更新RCSP协议对象(回连成功后)

3.2.2 OTA流程实现(OTAImpl)

OTAImpl 实现了OTA流程。

方法

参数

返回值

描述

constructor

iOTAOp: IOTAOp //OTA流程操作的协议实现接口,

void

初始化构建

release

void

释放缓存

isOTA

boolean

是否正在升级

startOTA

otaConfig: OtaConfig // OTA配置

callback: OnUpgradeCallback //设备升级流程回调

void

开始OTA

cancelOTA

boolean

取消OTA

onDeviceInit

deviceUpgradeInfo: DeviceUpgradeInfo //设备升级相关信息

isInit:boolean//RCSP是否初始化成功

void

设备初始化

onDeviceDisconnect

void

设备断开通知

notifyUpgradeSize

totalSize:number//总大小

currentSize:number//当前升级大小

void

设备通知文件大小

gainFileBlock

offset:number//文件偏移

len:number//文件块长度

void

设备获取升级文件块

setDeviceBLEMac

bleMac:string | undefined//RCSP的BLEMac地址

void

设置RCSP的BLEMac地址

DeviceUpgradeInfo :设备升级相关信息。 设备连接成功后,需要将设备的升级相关信息同步给 OTAImpl ,可以通过 OTAImpl.onDeviceInit() 进行同步

属性

类型

描述

isSupportDoubleBackup

boolean

是否支持双备份

isNeedBootLoader

boolean

是否需要下载Loader

isMandatoryUpgrade

boolean

是否需要强制升级

IOTAOp OTA流程操作的协议实现接口, RcspOTAManager 已实现该接口。

方法

参数

返回值

描述

isDeviceConnected

boolean

是否已连接设备

changeCommunicationWay

communicationWay: number//通讯方式,0:BLE,1:SPP,2:USB

isSupportNewRebootWay: boolean//是否支持新回连方式

callback: OnResultCallback<number>//回调。设备回复结果 0:不支持新回连,1:支持新回连

void

切换通讯方式

readUpgradeFileFlag

callback: OnResultCallback<FileOffset>//回调。设备回复结果,头信息的偏移和长度

void

读取文件头信息偏移

inquiryDeviceCanOTA

data: Uint8Array//头信息数据

callback: OnResultCallback<number>//回调。设备回复结果:是否能进行升级

void

查询设备是否可升级

changeReceiveMtu

void

调整RCSP库的设备收数据的MTU(App的缓存),让数据可以成功发出

enterUpdateMode

callback: OnResultCallback<number>//回调。设备回复结果:是否成功进入升级模式

void

进入升级模式

exitUpdateMode

callback: OnResultCallback<number>//回调。设备回复结果:是否成功退出升级模式

void

退出升级模式

queryUpdateResult

callback: OnResultCallback<number>//回调。设备回复结果:设备升级状态

void

读取设备升级状态

rebootDevice

callback: OnResultCallback<number>//回调。设备回复结果:是否成功重启或关闭设备

void

重启或关闭设备

stopNotifyADV

callback: OnResultCallback<number>//回调。设备回复结果:设置TWS设备通知

void

设置TWS设备通知(不用处理)

receiveFileBlock

offset: number//数据块偏移地址

len: number//数据块长度

data: Uint8Array//数据块数据

callback: OnResultCallback<boolean> //回调发送结果。

void

回复发送升级固件数据块

release

void

释放

3.2.3 OTA配置(OtaConfig)

OTAConfig :OTA配置。 在 startOTA() 时, 作为参数对 OTAImpl 进行配置

属性

类型

描述

communicationWay

number

通讯方式(目前只支持BLE)

isSupportNewRebootWay

boolean

是否支持新的回连方式

3.2.4 设备升级流程回调(OnUpgradeCallback)

OnUpgradeCallback :设备升级流程回调。 升级过程中的进度和结果都将从这里回调出去。

方法

参数

返回值

描述

onStartOTA

void

OTA开始

onReadData

offset: number// 数据偏移

size: number//数据大小

Uint8Array

读取升级数据并返回

onNeedReconnect

reConnectMsg: ReconnectInfo //回连信息

void

需要回连的回调

onProgress

type: UpgradeType //升级类型

progress: number//进度

void

进度回调

onStopOTA

void

OTA结束

onCancelOTA

void

OTA取消

onError

error: number//错误码 OtaError

message: string//错误信息

void

OTA失败

3.2.5 回连信息(ReconnectInfo)

ReconnectInfo :回连信息

属性

类型

描述

isSupportNewReconnectADV

boolean

是否支持新回连方式

deviceBleMac

string

BLE_Mac地址

Note

isSupportNewReconnectADV = false时,回连设备可直接通过deviceId比对判断是不是正在升级的设备,然后进行回连操作。 当 isSupportNewReconnectADV = true时,公版程序回连设备是通过比对设备广播包中的携带的OTA标识和MAC地址进行判断是不是正在升级的设备,然后进行回连操作。

Important

当打开设备Auth的时候,回连设备时也要进行认证才可以进行通讯。

3.2.6 设备升级阶段类型(UpgradeType)

UpgradeType : 升级阶段类型, OnUpgradeCallback.onProgress 回调进度时需进行区分 。当类型=0时,说明在ubootloader下载,当类型=1时,说明在固件升级。

Note

单备份有类型=0和类型=1,双备份只有类型等于1

3.3 RCSP协议库相关接口

JL_RCSP_xxx-release RCSP协议库,负责rcsp命令打包命令和解析命令。 RcspImpl 为实现类接口。

3.3.1 Rcsp协议接口(RcspImpl)

RcspImpl Rcsp协议接口

方法

参数

返回值

描述

constructor

void

初始化构建

destroy

void

销毁

getUsingDevice

BtDevice | null

获取当前使用设备

setOnSendDataCallback

callback: OnSendDataCallback | undefined

void

设置RCSP数据发送回调

isDeviceConnected

void

是否已连接设备

getDeviceInfo

device: BtDevice

获取设备信息

addOnRcspCallback

callback: OnRcspCallback

void

添加Rcsp事件回调

removeOnRcspCallback

callback: OnRcspCallback

void

移除Rcsp事件回调

transmitDeviceState

device: BtDevice

status: ConnectState

void

通知设备状态

transmitDeviceData

device: BtDevice

data: Uint8Array

void

通知设备发送的数据

sendDataToDevice

device: BtDevice

data: Uint8Array

void

发送数据给设备(裸蓝牙数据)

sendRCSPCommand

device: BtDevice

command: Command

timeoutMs: number //命令超时

callback: CommandCallback<Command> | null //命令回调

void

发送RCSP命令给设备

syncDeviceInfo

device: BtDevice

param: ParamTargetInfo//设备信息参数

callback: OnResultCallback<ResponseTargetInfo> //结果回调

void

异步获取设备信息

3.3.2 Rcsp事件回调(OnRcspCallback)

OnRcspCallback Rcsp事件回调, 当收到设备主动发送的RCSP命令回复或者RCSP初始化都从此接口回调。

/** Rcsp事件回调*/
export class OnRcspCallback {
  /**
  * Rcsp协议初始化回调
  *
  * @param _device 已连接设备
  * @param _isInit 初始化结果
  */
  public onRcspInit: (_device: RcspBase.BtDevice | null, _isInit: boolean) => void =
    (_device: RcspBase.BtDevice | null, _isInit: boolean) => {

    }

  /**
  * 设备主动发送的rcsp命令回调
  *
  * @param _device  已连接设备
  * @param _command RCSP命令
  */
  public onRcspCommand: (_device: RcspBase.BtDevice | null, _command: RcspBase.Command) => void =
    (_device: RcspBase.BtDevice | null, _command: RcspBase.Command) => {
    }

  /**
  * 设备回复的rcsp命令回调
  *
  * @param _device  已连接设备
  * @param _command RCSP命令
  */
  public onRcspResponse: (_device: RcspBase.BtDevice | null, _command: RcspBase.Command) => void =
    (_device: RcspBase.BtDevice | null, _command: RcspBase.Command) => {
    }

  /**
  * 设备主动发送的数据命令回调
  *
  * @param _device  已连接设备
  * @param _dataCmd 数据命令
  */
  public onRcspDataCmd: (_device: RcspBase.BtDevice | null, _dataCmd: RcspBase.Command) => void =
    (_device: RcspBase.BtDevice | null, _dataCmd: RcspBase.Command) => {
    }

  /**
  * RCSP错误事件回调
  *
  * @param _device  设备对象
  * @param _error   错误码 (参考{@link com.jieli.rcsp.data.constant.RcspError})
  * @param _message 错误描述
  */
  public onRcspError: (_device: RcspBase.BtDevice | null, _error: number, _message: string) => void =
    (_device: RcspBase.BtDevice | null, _error: number, _message: string) => {
    }

  /**
  * 需要强制升级回调
  *
  * @param _device 需要强制升级的设备
  */
  public onMandatoryUpgrade: (_device: RcspBase.BtDevice | null) => void =
    (_device: RcspBase.BtDevice | null) => {
    }

  /**
  * 设备连接状态
  *
  * @param _device 蓝牙设备
  * @param _status 连接状态
  */
  public onConnectStateChange: (_device: RcspBase.BtDevice | null, _status: RcspBase.ConnectState) => void =
    (_device: RcspBase.BtDevice | null, _status: RcspBase.ConnectState) => {
    }
}

3.3.3 RCSP数据发送回调(OnSendDataCallback)

OnSendDataCallback RCSP数据发送回调, RCSP库将协议数据打包后,从此接口回调给上层发数。

Important

使用RCSP协议库时,该接口必须实现。实现该接口时,上层需要根据mtu进行分包发送处理

/** 数据发送回调 */
export interface OnSendDataCallback {
  /**
  * 向设备发送RCSP数据包
  *
  * @param device 操作设备
  * @param data   RCSP数据包
  * @return 结果
  * <p>
  * 说明:
  * 1. 该方法需要用户自行实现
  * 2. 该方法运行在子线程,允许阻塞处理
  * 3. 该方法会回调完整的一包RCSP数据, 用户实现需要根据实际发送MTU进行分包处理
  * </p>
  */
  sendDataToDevice: (device: RcspBase.BtDevice, data: Uint8Array) => boolean;
}

3.3.4 设备信息(DeviceInfo)

DeviceInfo 设备信息。具体使用请查阅相关文档 DeviceInfo

3.3.4.1 设备信息(DeviceInfo)

设备信息。只支持读,不支持写。

名称

类型

可读

可写

说明

versionName

string | undefined

设备版本名称

versionCode

number | undefined

设备版本信息

protocolVersion

string | undefined

协议版本。

sendMtu

number

协议发送MTU(App接收<-设备发送)。默认值:530,以设备回复为准。

receiveMtu

number

协议接收MTU(App发送->设备接收)。默认值:530,以设备回复为准。

edrAddr

string | undefined

经典蓝牙相关信息-经典蓝牙地址

edrStatus

number

经典蓝牙相关信息-经典蓝牙的连接状态

edrProfile

number

经典蓝牙相关信息-经典蓝牙支持的协议。 BIT(0): SPP。BIT(1): HFP。BIT(2): A2DP。BIT(3): AVRCP。BIT(4): HID。BIT(5): AVDTP。BIT(6): PBAP。BIT(7): 优先使⽤通信⽅式( 0:RCSP优先⽤ble,  1:RCSP优先⽤spp)。

bleAddr

string | undefined

BLE相关信息-BLE地址

platform

number

ai平台相关参数-AI平台类型(0:图灵;1:deepbrain;2:小米)

license

string | undefined

ai平台相关参数-设备唯一标示

volume

number

设备音量-当前值

maxVol

number

设备音量-最大值

quantity

number

设备电量

upgradeMinQuantity

number

升级最低电量

functionMask

number

功能支持掩码

curFunction

number

功能支持掩码-当前模式

btEnable

boolean

功能支持掩码-支持蓝牙模式

devMusicEnable

boolean

功能支持掩码-支持设备音乐模式

rtcEnable

boolean

功能支持掩码-支持RTC模式(闹钟)

lineInEanble

boolean

功能支持掩码-支持LineIn模式

fmEnable

boolean

功能支持掩码-支持FM接收模式

lightEnable

boolean

功能支持掩码-支持灯光模式

fmTXEnable

boolean

功能支持掩码-支持FM发射模式

eqEnable

boolean

功能支持掩码-支持EQ模式

supportOfflineShow

boolean

是否支持usb、sd、linein不在线时显示功能图标

supportUsb

boolean

是否支持usb

supportSd0

boolean

是否支持sd0

supportSd1

boolean

是否支持sd1

hideNetRadio

boolean

是否隐藏网络电台

sdkType

number

sdk类型。0:AI SDK (692X_AI智能⾳箱SDK)。1:ST SDK (692X_标准⾳箱SDK)。2:693x_TWS SDK。3:695xSDK。4:697x_TWS SDK。5:696x_soundbox。6:696x_tws。7:695x_sound_card。8:695x_sound_watch。9:701x_sound_watch。A:manifest_earphone。B:manifest_soundbox。C: Charging Case SDK(彩屏充电仓)

name

string | undefined

名字

pid

number

产品ID

vid

number

厂商ID

uid

number

客户ID

mandatoryUpgradeFlag

number

强制升级。1:需要强制升级,0:不需要强制升级

requestOtaFlag

number

请求升级标志

ubootVersionCode

number

uboot 版本号

ubootVersionName

string | undefined

uboot 版本名称

isSupportDoubleBackup

boolean

是否支持双备份升级(单备份[false],需要断开回连过程;双备份[true],不需要断开回连过程)

isNeedBootLoader

boolean

是否需要下载boot loader

singleBackupOtaWay

number

单备份OTA连接方式(00 – 不使能 01 – BLE 02 – SPP)

expandMode

number

拓展模式 0:不启用 1: 升级资源模式

allowConnectFlag

number

是否允许连接 0 – 允许 1 – 不允许

authKey

string | undefined

用于服务器校验产品信息-认证秘钥

projectCode

string | undefined

用于服务器校验产品信息-项目标识码

customVersionMsg

string | undefined

用于自定义版本信息

bleOnly

boolean

是否仅仅连接ble设备

emitterSupport

boolean

是否支持外设模式

emitterStatus

number

外设状态:0x00:普通模式 0x01:外设模式

isSupportMD5

boolean

是否支持MD5读取

isGameMode

boolean

是否游戏模式

isSupportSearchDevice

boolean

是否支持查找设备

supportVolumeSync

boolean

是否支持音量同步

supportSoundCard

boolean

是否支持声卡功能

supportExternalFlashTransfer

boolean

是否支持外挂Flash传输功能

supportAnc

boolean

是否支持主动降噪功能

banEq

boolean

禁止app调节设备eq

supportReadErrorMsg

boolean

是否支持异常信息读取功能

supportPackageCrc16

boolean

大文件传输是否支持分包crc16校验

getFileByNameWithDev

boolean

以新的文件名方式读取固件文件(支持多设备)

contactsTransferBySmallFile

boolean

联系人传输是否使用小文件方式

watchSettingMask

number

手表设置功能支持状态的掩码

3.3.5 设备(BtDevice)

BtDevice 设备。

属性

类型

说明

deviceId

string

设备deviceId,不等于mac

name

string | undefined

设备名

3.4 错误码

3.4.1 RCSP 错误码(RCSPErrorCode)

名称

说明

ERR_NONE

0(0)

(操作成功)Success

ERR_INVALID_PARAMETER

0x1001(4097)

(无效参数)Input invalid parameter

ERR_CANCEL_OP

0x1002(4098)

(取消操作)Cancel operation.

ERR_OPERATION_TIMEOUT

0x1003(4099)

(操作超时)Operation timeout.

ERR_OTHER

0x1004(4100)

(其他错误)Other error.

ERR_REMOTE_NOT_CONNECT

0x2000(8192)

(远端设备未连接)The remote device is not connected

ERR_DEVICE_NOT_MATCH

0x2001(8193)

(操作设备不一致)The device is not the same as the device in use.

ERR_USE_SYSTEM_API

0x2002(8194)

(调用系统接口失败)Failed to use system reflection function

ERR_AUTH_DEVICE

0x2003(8195)

(设备认证失败)Failed to auth device

ERR_CMD_SEND

0x3000(12288)

(命令发送失败)Command sending failed.Please check the connection

ERR_PARSE_DATA

0x3001(12289)

(解析数据异常)Error parsing RCSP data

ERR_RESPONSE_TIMEOUT

0x3002(12290)

(等待设备回复命令超时)Waiting for a reply packet timed out

ERR_SYSTEM_BUSY

0x3003(12291)

(系统繁忙)System is busy

ERR_RESPONSE_BAD_STATUS

0x3004(12292)

(设备返回错误状态)Device response a bad status

ERR_RESPONSE_BAD_RESULT

0x3005(12293)

(设备返回错误结果)Device response a bad result

ERR_STORAGE_OFFLINE

0x4000(16384)

(存储设备下线)Storage offline.

ERR_FILE_BROWSING

0x4001(16385)

(文件浏览中)File browsing

ERR_DATA_LOAD_COMPLETE

0x4002(16386)

(数据加载完成)File data is loaded.

ERR_MISSING_FILE_DATA

0x4003(16387)

(丢失文件数据)Missing file data

ERR_DIR_TOO_DEEP

0x4004(16388)

(文件夹层级过深)Directory hierarchy is too deep.

ERR_IO_EXCEPTION

0x4005(16389)

(读写异常)IO exception.

ERR_FILE_NOT_IN_STORAGE

0x4006(16390)

(文件与存储器不一致)File does not match storage.

3.4.2 RCSP操作错误码(RCSPOpErrorCode)

RCSPOpErrorCode 中包含 RCSPErrorCode 错误码。下表只列举两者不同部分。

名称

说明

ERR_IN_PROGRESS

0x1100(4352)

(操作进行中)in progress.

ERR_FUNC_NOT_SUPPORT

0x1101(4353)

(功能不支持)Feature not supported

ERR_CRC_CHECK

0x3100(12544)

(CRC校验失败)CRC is error

ERR_DEVICE_IN_CALLING

0x3101(12545)

(设备处于通话状态)The device is in calling.

ERR_OP_NOT_ALLOW

0x3102(12546)

(操作不被允许)The operation is not allowed

ERR_FAT_DISK

0x4101(16641)

(系统IO读写异常)A hard error occurred in the low level disk I/O layer

ERR_FAT_INIT

0x4102(16642)

(断言失败)Assertion failed.

ERR_FAT_NOT_READY

0x4103(16643)

(驱动未工作)The physical drive cannot work.

ERR_FAT_NO_FILE

0x4104(16644)

(未找到文件)Could not find the file.

ERR_FAT_NO_PATH

0x4105(16645)

(未找到路径)Could not find the path.

ERR_FAT_INVALID_NAME

0x4106(16646)

(路径名称无效)The path name format is invalid.

ERR_FAT_DENIED

0x4107(16647)

(拒绝访问)Access denied due to prohibited access or directory full.

ERR_FAT_EXIST

0x4108(16648)

(禁止访问)Access denied due to prohibited access.

ERR_FAT_INVALID_OBJECT

0x4109(16649)

(文件/目录无效)The file/directory object is invalid.

ERR_FAT_WRITE_PROTECTED

0x410A(16650)

(写保护)The physical drive is write protected.

ERR_FAT_INVALID_DRIVE

0x410B(16651)

(盘号无效)The logical drive number is invalid.

ERR_FAT_NOT_ENABLED

0x410C(16652)

(该卷没有工作区域)The volume has no work area.

ERR_FAT_NO_FILESYSTEM

0x410D(16653)

(缺失系统配置)There is no valid FAT volume.

ERR_FAT_MKFS_ABORTED

0x410E(16654)

(创建目录被中止)The f_mkfs() aborted due to any problem.

ERR_FAT_TIMEOUT

0x410F(16655)

(访问超时)Could not get a grant to access the volume within defined period.

ERR_FAT_LOCKED

0x4110(16656)

(操作被阻塞)The operation is rejected according to the file sharing policy.

ERR_FAT_NOT_ENOUGH_CORE

0x4111(16657)

(分配空间失败)LFN working buffer could not be allocated.

ERR_FAT_TOO_MANY_OPEN_FILES

0x4112(16658)

(打开文件超过限制)Number of open files > FF_FS_LOCK.

ERR_FAT_INVALID_PARAMETER

0x4113(16659)

(输入参数无效)Given parameter is invalid.

ERR_FAT_TOO_BIG

0x4114(16660)

(文件过大,剩余空间不足以添加)Image size to big, do not to support big size image.

ERR_FAT_JNI_INIT

0x4116(16662)

(手表系统未初始化)Watch system has not been initialized.

ERR_FAT_WRITE

0x4117(16663)

(写数据失败)Write data failed.

ERR_FAT_READ

0x4118(16664)

(读数据失败)Read data failed.

ERR_FAT_SYNC

0x4119(16665)

(同步数据失败)Sync data error.

ERR_FAT_BEGIN

0x411B(16667)

(流程开始出错)Process start error.

ERR_FAT_END

0x411C(16668)

(流程结束出错)Process end error.

ERR_VERSION_NOT_MATCH

0x4200(16896)

文件信息不匹配)File information does not match.

(ERR_SPACE_TO_UPDATE

0x4201(16897)

(剩余空间不足以更新)Insufficient space to update multiple files.

ERR_RENAME_FILE

0x4202(16898)

(重命名失败)Failed to rename the file.

ERR_DATA_OVER_LIMIT

0x4203(16899)

(数据长度越界)The data sent exceeds the limit.

ERR_NETWORK_OTA_UNKNOWN

0x5000(20480)

(未定义的升级错误码)Undefined upgrade error code.

ERR_NETWORK_OTA_FAILED

0x5001(20481)

(网络模块升级失败)Network module upgrade failed.

ERR_NETWORK_OTA_TIMEOUT

0x5002(20482)

(网络模块升级超时)Network module upgrade timeout.

ERR_NETWORK_OTA_WAITING_COMMAND_TIMEOUT

0x5003(20483)

(等待升级命令超时)Network module timeout waiting for upgrade command.

3.4.3 OTA错误码(OtaError)

OtaError 中包含 RCSPErrorCode 错误码。下表只列举两者不同部分。

名称

说明

ERR_OTA_DEVICE_LOW_VOLTAGE

0x6001(24577)

(设备电量低)Equipment low voltage

ERR_OTA_FIRMWARE_INFO_ERROR

0x6002(24578)

(升级固件信息错误)Upgrade firmware information error

ERR_OTA_FIRMWARE_VERSION_NO_CHANGE

0x6003(24579)

(升级文件的固件版本一致)The firmware version of the upgrade file is consistent

ERR_OTA_TWS_NOT_CONNECT

0x6004(24580)

(TWS未连接)TWS not connected

ERR_OTA_HEADSET_NOT_IN_CHARGING_BIN

0x6005(24581)

(耳机未在充电仓)The earphones are not in the charging compartment

ERR_OTA_DATA_CHECK_ERROR

0x6006(24582)

(升级数据校验出错)Upgrade data verification error

ERR_OTA_FAIL

0x6007(24583)

(升级失败)Upgrade failed

ERR_OTA_ENCRYPTED_KEY_NOT_MATCH

0x6008(24584)

(加密key不匹配)Encryption key mismatch

ERR_OTA_UPGRADE_FILE_ERROR

0x6009(24585)

(升级文件出错)Upgrade file error

ERR_OTA_UPGRADE_TYPE_ERROR

0x600A(24586)

(升级类型出错)Upgrade type error

ERR_OTA_LENGTH_OVER

0x600B(24587)

(升级过程中出现长度错误)Length error occurred during the upgrade process

ERR_OTA_FLASH_IO_EXCEPTION

0x600C(24588)

(出现flash读写错误)Flash read/write error occurred

ERR_OTA_CMD_TIMEOUT

0x600D(24589)

(升级过程中指令超时)Command timeout during upgrade process

ERR_OTA_IN_PROGRESS

0x600E(24590)

(正在OTA)OTA in progress

ERR_OTA_COMMAND_TIMEOUT

0x600F(24591)

(等待升级命令超时)Waiting for ota command timeout

ERR_OTA_RECONNECT_DEVICE_TIMEOUT

0x6010(24592)

(回连设备超时)Reconnect device timeout

ERR_OTA_USE_CANCEL

0x6011(24593)

(用户取消升级)User cancels upgrade

ERR_OTA_SAME_FILE

0x6012(24594)

(升级文件相同)Upgrade files are the same

3.5 SDK版本号

在杰理SDK的文件中,有一个***SdkVersion.class专门负责管理SDK版本号。

对应的SDKClass

SDK文件

说明

class名

JL_Auth_x.x.x-release.har

RCSP认证库

AuthSdkVersion

JL_OTA_x.x.x-release.har

OTA库

OTASdkVersion

JL_RCSP_x.x.x-release.har

RCSP协议库

RCSPSdkVersion

***SdkVersion.class

export class ***SdkVersion { //这里是伪代码,具体SdkVersion名字请参考上面的表格
    static get VersionCode() {
        return this.versionCode;
    }
    static get VersionName() {
        return this.versionName;
    }
}
***SdkVersion.versionCode = 2;
***SdkVersion.versionName = '1.0.1';