Other Parts Discussed in Thread: Z-STACK
I added OTA server feature upon ZNP project,but zclOTA_HdlIncoming callback function can't be call on OTA server side. Z-Stack 3.0 ZNP project.
zcl_registerPlugin ( ZCL_CLUSTER_ID_OTA,ZCL_CLUSTER_ID_OTA,zclOTA_HdlIncoming );
This is my following steps:
1. add zclOTA_Init( taskID++ ); at last of osalInitTasks() func;
2. add zclOTA_event_loop events callback at last tasksArr arrary;
3. add Preprocessor MT_OTA_FUNC OTA_SERVER=TRUE OTA_HA in ZNP project options per line;
zcl_registerPlugin ( ZCL_CLUSTER_ID_OTA,
ZCL_CLUSTER_ID_OTA,
zclOTA_HdlIncoming );
4. But zclOTA_HdlIncoming callback function can't be call when other OTA client sent a "Query Next Image Request" to ZNP(coordinator mode),what's wrong with me?following image is Ubiqua sniffer capture log:
5. The following image is IAR workbench step through when OTA client(0xF033) sent image request to ZNP(0x0000):
6. I review all Z-Stack 3.0 project source code,I have found ZCL_STANDALONE don't defined by default,I don't know what's meaning. Very very important is zcl_Init( taskID++ ); and zcl_event_loop is not be call in all ZNP project,this caused zcl task can't be create,this may be caused zcl_TaskID task can't receive any AF message?
// Endpoint for OTA Cluster
static endPointDesc_t zclOTA_Ep =
{
ZCL_OTA_ENDPOINT,
0,
#ifndef ZCL_STANDALONE
&zcl_TaskID,
#else
&zclOTA_TaskID,
#endif
( SimpleDescriptionFormat_t * ) &zclOTA_SimpleDesc,
( afNetworkLatencyReq_t ) 0
};
void zclOTA_Init ( uint8 task_id )
{
zclOTA_TaskID = task_id;
// Register for the cluster endpoint
afRegister ( &zclOTA_Ep );
// Register as a ZCL Plugin
zcl_registerPlugin ( ZCL_CLUSTER_ID_OTA,
ZCL_CLUSTER_ID_OTA,
zclOTA_HdlIncoming );
......
......
}



