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.

LP-CC2652RB: Zigbee Linux Gateway 3.0 - server APIs

Part Number: LP-CC2652RB
Other Parts Discussed in Thread: CC2652RB, Z-STACK

Hi,

I am using Zigbee Linux Gateway 3.0 application provided by TI for my gateway project. In the gateway host is IMX8 and ZNP is CC2652RB.

I have gone through the Z-Stack Linux Gateway Application Programming Interface document Interface document Version: 1.1 and could not find any API which will do the below functionalities

1. Form network with channel and tx power specified

2.Join to an existing network with specific channel

3.start scanning for network

4.stop scanning for network

5.Get Tx power of the device

6.Get binding table size

7.set binding table entry for a particular bind index - int zigbee_set_binding_entry(int index, zigbee_binding_table_entry *value)

8.Delete binding entry of particular index

9.clear all entries of binding table

10.ZDO node id request

11.ZDO ieee address request

12.ZDO leave request

13.ZDO node descriptor request

14.ZDO power descriptor requset

15.ZDO active endpoint request

16.ZDO match descriptor request

17.zdo end device bind request

18.ZDO LQI table request

19.stop attribute reporting

20.Check if attribute reporting

21.discover attribute

22.read report config

23.basic cluster reset to factory default

24.identify cluster get remaining time

Please let me know how i can achieve the above functionalities.

Thanks,

Vikas

  • Hi Vikas,

    You can refer to the Developer's Guide and Technical API (source/Projects/node/nodejs_zb_gateway/API.html) to understand what is currently available from the default ZIGBEE-LINUX-SENSOR-TO-CLOUD solution, and add your own functions to the gateway as necessary.  You can refer to the Monitor and Test API for allowable commands to interface with the ZNP.

    Regards,
    Ryan

  • Hi Ryan,

    I am not using the nodejs module.

    My requirement is to write a C application which has all the functionalities i mentioned in the case.

    The developers guide explains that gateway application can  talk to HA gateway server, network manager server and OTA server using socket interface. I have referred the API document for all the 3 servers and could not find any API which can achieve my requirement. Attached the API doc for your reference.8877.Z-Stack Linux Gateway - API document v1.1.pdf

    I would like to know how I can achieve my requirement from the gateway application?

    Thanks,

    Vikas

  • For instance, you can reference nwkmgrsrv.c to see how the existing App passes protobuf messages to the NwkManager for command processing in nmHandleAppPbCb and model your application accordingly.  This will apply for most of your above requests.  Asynchronous messages from the Z-Stack server can be received from handleAsyncMsgs.

    Regards,
    Ryan

  • Ryan,

    nmHandleAppPbCb explain about how the network manager server process incoming protobuf request.

    My requirement is from the gateway application how I can frame the request for the mentioned functionalities. For example how can i send a zdo ieee address request from the gateway application.

    Thanks,

    Vikas

  • If you look at user_interface then you can see how certain actions lead to the MT command.  For example, case 'x' (soft reset) sends system_send_reset_request -> nwk_zigbee_system_reset_req__pack -> case NWK_MGR_CMD_ID_T__NWK_ZIGBEE_SYSTEM_RESET_REQ -> processNwkZigbeeSystemResetReq -> sendSysResetReq -> sendAPICExpectDefaultStatus -> case ZSTACK_CMD_IDS__SYS_RESET_REQ -> processSysResetReq -> znpReset -> sendAPICZNP -> apicSendAsynchData -> send.  You would thus implement a similar call stack for the added functionality you require.

    Regards,
    Ryan

  • Ryan,

    Thanks for sharing the call stack. I have covered all the existing functionalities in the gateway example.

    According to your  suggestion in order to achieve the functionalities mentioned in the case  i have to implement the complete call stack as in the example. Most of my required functionalities are standard ZigBee .So the gateway servers does not support all the standard Zigbee functionalities ?

    Thanks,

    Vikas

  • Most of the functionality you are requesting is included in nwkmgrsrv.c (where  case NWK_MGR_CMD_ID_T__NWK_ZIGBEE_SYSTEM_RESET_REQ -> processNwkZigbeeSystemResetReq -> sendSysResetReq from the example are handled), therefore the gateway server does support the standard Zigbee functionalities and you do not have to implement the complete call stack.

    Regards,
    Ryan

  • Ryan,

    NWK_MGR_CMD_ID_T__NWK_ZIGBEE_SYSTEM_RESET_REQ is define in typedef enum _NwkMgrCmdIdT in nwkmgr.pb-c.h .

    In the above required commands lets take active endpoint request as example. Should i add definition for the active endpoint request command id manually and add the case for the same in nwkmgrsrv.c ? 

    Do we have any document defining the command id value?

    Thanks,

    Vikas

  • Vikas,

    Yes, you should add a definition and case manually.  You can choose your own command ID so long as it does not conflict with those which already exist in the NwkMgrCmdIdT struct.

    Regards,
    Ryan

  • Hi Ryan,

    With the existing APIs provided i can achive some of the functionalities. Still some are  pending. Giving the list below. Please let me know if you can help me out with the pending functionalities.

    Form network with channel and tx power specified - No option find to set the transmit power
    Join to an existing network with specific channel - No option find to set the transmit power
    start scanning for network - No API found
    stop scanning for network - No API
    Get Tx power of the device - No API
    Get binding table size - No API
    set binding table entry for a particular bind index - int zigbee_set_binding_entry(int index, zigbee_binding_table_entry *value) - No API found
    Delete binding entry of particular index - No API found
    Clear all entries of binding table - No API found
    ZDO ieee address request - No API found
    ZDO leave request - No API found
    ZDO power descriptor requset - No API found
    zdo end device bind request - No API found

    Thanks,

    Vikas

  • Hi Vikas,

    Some of the functionality you desire are not inherently supported by Z-Stack, like “start/stop scanning for network” as this is the lower-level 15.4 MAC’s responsibility.  Others, like the binding information, are not supported by the Monitor and Test API so you will either have to develop custom MT commands or create local records on your host application.  Otherwise, there are several APIs in nwkmgrsrv which you could find useful for your needs (sendAppCnfStartCommissioningReq, sendSysSetTxPowerReq, sendSysNwkInfoReadReqAndSetTxPower,  sendZdoBindReq, sendZdoIeeeAddrReq, sendNwkRemoveDeviceReq, etc).  If anything is missing in the gateway application then you have the capability to modify and expand as desired.

    Regards,
    Ryan