This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2652P: Z-stack initialization configuration

Part Number: CC2652P
Other Parts Discussed in Thread: Z-STACK

Hi Team,

Protocol stack initialization; First, I use the editor as the official CCS, open the official Z-stack routine, delete the official application layer, and configure the Z-stack initialization according to the official API. Can't it be configured like this way? This is done according to the official API
The configuration is as follows:

static void zclGenericApp_Initvoid )

{

  //Register Endpoint

//Register one or more Zigbee Device Endpoints by calling Zstackapi_AfRegisterReq().

  zclGenericAppEpDesc.endPoint = GENERICAPP_ENDPOINT;

  zclGenericAppEpDesc.simpleDesc = &zclGenericApp_SimpleDesc;

  zclport_registerEndpoint(appServiceTaskId, &zclGenericAppEpDesc);//Zstackapi_AfRegisterReq

 

/*Register for Z-Stack Callback (asynchronous) messages by calling Zstackapi_DevZDOCBReq() with the wanted callbacks.*/

 SetupZStackCallbacks();//Zstackapi_DevZDOCBReq

 

 

/*Write Z-Stack parameters by calling Zstackapi_sysConfigWriteReq() with the wanted parameters. */

  myZstackapi_sysConfigWriteReq();//Zstackapi_sysConfigWriteReq

 

 

/*Call Zstackapi_DevStartReq() to start the Z-Stack Thread's automatic joining process.*/

  myZstackapi_DevStartReq();

 

 

/* call zclport_getDeviceInfo()to retrieve the device's joined network parameters.//

  zclport_getDeviceInfo(appServiceTaskId);

*/

}

 

by calling Zstackapi_AfDataReq() to send application proprietary messages.

Void  send(){    Zstackapi_AfDataReq()          

API:

The functions defined in zstackapi.h are functions that communicate with the Z-Stack image through OsalPort messaging. If an immediate response, not over the air, is expected, the function will block for the response message.

To setup communicate with the Z-Stack thread, your application should do the following initialization (simplified):

When the joining process is complete, you'll receive a zstackmsg_CmdIDs_DEV_STATE_CHANGE_IND message with a state of:

You should then call zclport_getDeviceInfo(), or Zstackapi_sysNwkInfoReadReq() if your application isn't a ZCL project, to retrieve the device's joined network parameters.

You're free to do device discovery through ZDO commands (ie. Zstackapi_ZdoMatchDescReq()) and send data either through ZCL commands or by calling Zstackapi_AfDataReq() to send application proprietary messages.

Once you've registed an endpoint, your application will recieve any data message addressed to that endpoint as an AF Incoming Data Indication [zstackmsg_afIncomingMsgInd_t with a message event of zstackmsg_CmdIDs_AF_INCOMING_MSG_IND] through an OsalPort message.

Also, any indications or response message that you have signed up for using Zstackapi_DevZDOCBReq() will be delivered to your application as an OsalPort message. For example, the Device State Change message [zstackmsg_devStateChangeInd_t with a message event of zstackmsg_CmdIDs_DEV_STATE_CHANGE_IND].

Regards,

Susan Ren