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)