Z-Stack API Reference  3.2.0
Z-Stack TI-RTOS API
Date
2015-02-12 12:13:13 -0800 (Thu, 12 Feb 2015)
Revision
42527

Overview

To write an application for the Texas Instruments CC2630/CC2650 Z-Stack SDK you first need to understand that the embedded system for the CC2630/CC2650 is divided into 2 seperate images.

HighLevelImages.PNG


Each image is maintained as seperate projects that are built and downloaded to the CC2630/CC2650 seperately.

The functions defined in zstackapi.h are functions that communicate with the ZStack image through ICall messages. If an immediate response, not over the air, is expected, the function will block for the response ICall message.

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

  • Register one or more Zigbee Device Endpoints by calling Zstackapi_AfRegisterReq().
  • Register for ZStack Callback (asynchronous) messages by calling Zstackapi_DevZDOCBReq() with the wanted callbacks. For example, if you would like to receive device state change notifications, you will have to set the has_devStateChange and devStateChange fields to true in a zstack_devZDOCBReq_t, then call Zstackapi_DevZDOCBReq().
  • Write ZStack parameters by calling Zstackapi_sysConfigWriteReq() with the wanted parameters. Example parameters are channel mask, PAN ID, poll rates, timeouts, etc...
  • Call Zstackapi_DevStartReq() to start the ZStack Thread's automatic joining process.

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 ICall message.

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

ZStack API

ZStack Indications (callbacks)

The following messages will be delivered to your application through an ICall message after you register at least one endpoint with Zstackapi_AfRegisterReq(), you must call Zstackapi_freeIndMsg() to free the message when you are done processing:

The following messages will be delivered to your application through an ICall message after you request them by setting the correct fields (has and flag) to 'true' in zstack_devZDOCBReq_t and calling Zstackapi_DevZDOCBReq(), you must call Zstackapi_freeIndMsg() to free the message when you are done processing:

The following messages will be delivered to your application through an ICall message after a request to perform any BDB commissioning process, for instance, Zstackapi_bdbStartCommissioningReq calls will trigger zstackmsg_CmdIDs_BDB_NOTIFICATION on the requested commissioning methods, you must call Zstackapi_freeIndMsg() to free the message when you are done processing:

The following messages will be delivered to your application through an ICall message when GP messages are process by the stack and must be process by Green Power Proxy or sink application side, which by default are already handled by example apps to the respective green power application. you must call Zstackapi_freeIndMsg() to free the message when you are done processing:

Application Helper Modules

  • Utilities - Middleware Timer/Clock and integer-to-string functions.
  • ZCL Porting functions - Functions needed by ZCL to communication with the ZStack Thread.
  • LED Support - Middleware to control the development board LEDs.
  • LCD Support - Middleware to control the development board LCD.
  • Key Press Support - Middleware to setup and receive key press indications.






Copyright 2014 - 2015 Texas Instruments Incorporated. All rights reserved.

IMPORTANT: Your use of this Software is limited to those specific rights granted under the terms of a software license agreement between the user who downloaded the software, his/her employer (which must be your employer) and Texas Instruments Incorporated (the "License"). You may not use this Software unless you agree to abide by the terms of the License. The License limits your use, and you acknowledge, that the Software may not be modified, copied or distributed unless embedded on a Texas Instruments microcontroller or used solely and exclusively in conjunction with a Texas Instruments radio frequency transceiver, which is integrated into your product. Other than for the foregoing purpose, you may not use, reproduce, copy, prepare derivative works of, modify, distribute, perform, display or sell this Software and/or its documentation for any purpose.

YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE PROVIDED ``AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.

Should you have any questions regarding your right to use this Software, contact Texas Instruments Incorporated at www.TI.com.