开发框架
工程介绍
开发说明
其他
本文档是为了方便后续项目维护和管理、记录开发内容而创建。
本文档描述的OTA库是基于杰理的RCSP协议而实现。同时使用于单双备份的OTA流程。
JL_Auth_x.x.x-release.har — RCSP认证库
JL_OTA_x.x.x-release.har — OTA库
JL_RCSP_x.x.x-release.har — RCSP协议库
目前SDK文件是用一个Module lib_rcsp 统一管理,也可以直接放在App Module下。
lib_rcsp
Warning
在引用SDK库文件时,请注意不要修改依赖的module名称,会导致SDK内出错。
示例:正确引用
"dependencies": { "jl-ota": "file:./lib/JL_OTA_1.0.1-release.har", "jl-rcsp": "file:./lib/JL_RCSP_1.0.1-release.har", "jl-auth": "file:./lib/JL_Auth_1.0.1-release.har", }
示例:错误引用(把 jl-ota 改为 jl_ota )
jl-ota
jl_ota
"dependencies": { "jl_ota": "file:./lib/JL_OTA_1.0.1-release.har", "jl_rcsp": "file:./lib/JL_RCSP_1.0.1-release.har", "jl_auth": "file:./lib/JL_Auth_1.0.1-release.har", }
错误提示
digraph flow { start -> createBLEConnection -> setBLEMTU -> isNeedStartAuth; isNeedStartAuth->transmitDeviceStatus[label="设备端未打开认证"] isNeedStartAuth->startAuth[label="设备端已打开认证"] startAuth ->transmitDeviceStatus[label="认证成功"]; transmitDeviceStatus -> startOTA[label="RCSP初始化成功"] ; startOTA -> checkFile->isNeedBootLoader; isNeedBootLoader->singleBackUp[label="单备份"]; isNeedBootLoader->doubleBackUp[label="双备份"]; singleBackUp -> reconnectDisconnectDevice[label="传输完成"] reconnectDisconnectDevice ->reconnectFoundOrConnectDevice[label="开始回连"] reconnectFoundOrConnectDevice ->isNeedReconnectAuth[label="蓝牙连接成功"] isNeedReconnectAuth->reconnectTransmitDeviceStatus[label="设备端未打开认证"] isNeedReconnectAuth->reconnectAuth[label="设备端已打开认证"] reconnectAuth->reconnectTransmitDeviceStatus[label="认证成功"] reconnectTransmitDeviceStatus->reconnectSuccess[label="RCSP初始化成功"] reconnectTransmitDeviceStatus->reconnectFoundOrConnectDevice[label="RCSP初始化失败"] reconnectSuccess->doubleBackUp[label="回连成功"] doubleBackUp->rebootDevice[label="传输完成"] rebootDevice->end; start [label="Start", shape="Mdiamond"]; createBLEConnection [label="发现设备\n连接设备", shape="record"]; setBLEMTU [label="调整MTU", shape="record"]; isNeedStartAuth [label="是否需要认证设备\n (视设备端而定)", shape="diamond"]; startAuth [label="认证设备[JL_Auth]", shape="record"]; transmitDeviceStatus [label="调用RCSP_SDK.transmitDeviceState\n 传输设备状态(获取设备信息)[JL_RCSP]", shape="record"]; startOTA [label="开始OTA[JL_OTA]",shape="record"]; checkFile[label="检查升级文件[JL_OTA]",shape="record"]; isNeedBootLoader [label="是否单备份升级[JL_OTA]", shape="diamond"]; singleBackUp[label="传输最小系统(Loader系统)[JL_OTA]",shape="shape"]; reconnectDisconnectDevice[label="断开设备\n(Ble:设备端主动断开\nSpp:手机端主动断开)",shape="shape"]; reconnectFoundOrConnectDevice[label="发现设备(根据广播包和mac地址判断是不是回连设备)\n连接设备",shape="shape"]; isNeedReconnectAuth [label="是否需要认证设备\n (视设备端而定)", shape="diamond"]; reconnectAuth [label="认证设备[JL_Auth]", shape="record"]; reconnectTransmitDeviceStatus [label="调用RCSP_SDK.transmitDeviceState\n 传输设备状态(获取设备信息)[JL_RCSP]", shape="diamond"]; reconnectSuccess[label="更新RcspImpl[JL_OTA]", shape="record"]; doubleBackUp[label="传输升级内容",shape="record"]; rebootDevice[label="重启设备",shape="record"]; end [label="End", shape="Msquare"]; }
OTA整体流程