1:裁剪系统、、配置的时候禁止了页请求node
emAfReadOrWriteAttribute 不会触发属性变化与上报机制服务器
emberAfWriteServerAttribute 会触发属性变化与上报机制函数
{ui
这个里面会调用读写属性this
emAfReadOrWriteAttribute ()spa
}server
2:禁止上电主动查询OTA服务器;ci
要升级的时候,网关直接单播升级通告get
plugin ota-server notify (args)
<uint16_t> The node ID (can be a broadcast address) to which this OTA Notify mess ...
<uint8_t> Target endpoint for the OTA Notify message (only really meaningful for ...
<uint8_t> Used to specify which parameters you want included in the OTA Notify c ...
<uint8_t> Corresponds to QueryJitter parameter in the OTA Upgrade cluster specif ...
<uint16_t> Manufacturer ID for the image being advertised (should match the mfr I ...
<uint16_t> Image type ID for the image being advertised (should match the image t ...
<uint32_t> Firmware version of the image being advertised (should match the versi ...回调函数
plugin ota-server notify 0x9858 1 0 12 0x1002 0 30
void emberAfPluginOtaClientStackStatusCallback(EmberStatus status)
{
直接返回;
}
3:关于外部SPI存储器,在进入WHILE循环以前有2个初始化
emberAfPluginEepromInitCallback();这个只是检测FALSH存在不
emberAfOtaStorageInitCallback()初始化回调函数。这个若是FLASH不在,会不停的复位芯片
4:网关发送通告
4. 1:bool emberAfOtaClientIncomingMessageRawCallback(EmberAfClusterCommand* message)
4. 2:commandParse
{
收到 ZCL_IMAGE_NOTIFY_COMMAND_ID命令,把SPI FLASH清空,准备升级,
若是单播,就回一个默认应答成功(本身添加的),告诉网关通告命令成功。
启动服务发现,或者查询下一个映象;若是代码不出错,会直接启动服务发现,由于每次下载成功,会从新复位一次,那单片机就不知道OTA服务器
}
4.3:启动服务发现,就是发送匹配描述符,广播
emAfServiceDiscoveryIncoming(服务进来处理)
{
ServiceDiscoveryState *state = &states[emberGetCurrentNetwork()];
result.status = (isUnicastQuery(state)
? EMBER_AF_UNICAST_SERVICE_DISCOVERY_COMPLETE_WITH_RESPONSE
: EMBER_AF_BROADCAST_SERVICE_DISCOVERY_RESPONSE_RECEIVED); //不是单播
executeCallback(state, &result)
}
服务发现完成
static void serviceDiscoveryComplete(uint8_t networkIndex)
{
找到服务器,而后 euiLookup(); 读外部存储器的数据,看里面的东西来决定,若是里面有一份下了一半的,就继续下载,若是有一个比当前新的就更新,一个旧的就向网关发送映象查询,
},
queryNextImageResponseParse{
映象应答
}
emberAfOtaStorageClearTempDataCallback (擦除外部FLASH)