![]() |
![]() |
|
Z-Stack API Reference
7.10.00.10
|
To write an application for the Texas Instruments SimpleLink CC13x2 / CC26x2 Software Development Kit you first need to understand that the embedded system for the CC13x2/CC26x2 is organized as follows
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].
The following messages will be delivered to your application through an OsalPort 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 OsalPort 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 OsalPort 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 OsalPort 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:
Copyright 2014 - 2018 Texas Instruments Incorporated.
All rights reserved not granted herein. Limited License.
Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive license under copyrights and patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell ("Utilize") this software subject to the terms herein. With respect to the foregoing patent license, such license is granted solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software, other than combinations with devices manufactured by or for TI ("TI Devices"). No hardware patent is licensed hereunder.
Redistributions must preserve existing copyright notices and reproduce this license (including the above copyright notice and the disclaimer and (if applicable) source code license limitations below) in the documentation and/or other materials provided with the distribution.
Redistribution and use in binary form, without modification, are permitted provided that the following conditions are met:
No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any software provided in binary form. Any redistribution and use are licensed by TI for use only with TI Devices. Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.
If software source code is provided to you, modification and redistribution of the source code are permitted provided that the following conditions are met:
Any redistribution and use of the source code, including any resulting derivative works, are licensed by TI for use only with TI Devices. Any redistribution and use of any object code compiled from the source code and any resulting derivative works, are licensed by TI for use only with TI Devices.
Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or promote products derived from this software without specific prior written permission.
DISCLAIMER.
THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.