Xinyuan-LilyGO / T-ZigBee

Zigbee Ultra Low Power IOT Development Board
GNU Affero General Public License v3.0
72 stars 18 forks source link

Issue with ZBHCI_CMD_NODES_JOINED_GET_RSP #15

Closed wes58 closed 1 year ago

wes58 commented 1 year ago

Here is the response using Telink ZGC Tool recv<-- : 55 80 40 00 1a 6e 00 02 00 00 02 00 a4 c1 38 04 50 19 49 e5 c7 19 a4 c1 38 18 45 4e a8 5e b7 d9 aa total_cnt:0x2 start_idx:0x0 list_count:0x2 status:0x0(ZBHCI_MSG_STATUS_SUCCESS) ieee_addr:0xa4c13804501949e5 short_addr:0xc719
ieee_addr:0xa4c13818454ea85e short_addr:0xb7d9

And here is in the Gateway: hci_uart: 55 80 40 00 1a 6e 00 02 00 00 02 00 a4 c1 38 04 50 19 49 e5 c7 19 a4 c1 38 18 45 4e a8 5e b7 d9 aa Type: 0x8040 (Nodes Joined Get Rsp) Status: 00 Total: 0x2 Start Idx: 00 List Count: 00

The messages are exactly the same, but as you can see, List Count is different and mac addresses are not displayed. When I tried to replace List Count (u8ListCount) with Total (u8TotalCnt) I get mac addresses but they are not correct - see below: Mac Addr List: Node 0: 0x200a4c138045019 Node 1: 0x49e5c719a4c13818 Telink definition:

typedef struct{
    u16 totalCnt;               /*! the total count of the joined nodes */
    u16 startIndex;             /*! the start index */
    u8  listCnt;                /*! the count of the mac address list */
    u8  status;                 /*! the status */
}zbhci_mgmt_nodesJoined_rsp_hdr_t;

typedef struct{
    addrExt_t macAddr;      // /*!  the mac address list */
    u16 nwkAddr;
}zbhci_mgmt_nodesJoined_info_t;

typedef struct{
    zbhci_mgmt_nodesJoined_rsp_hdr_t hdr;
    zbhci_mgmt_nodesJoined_info_t addrList[5];      //[5];  /*! the mac address list */
}zbhci_mgmt_nodesJoined_rsp_t;

I think getting mac addresses and short addresses is pretty important.

lbuque commented 1 year ago

You are right, we will schedule a time to fix it.

wes58 commented 1 year ago

I am trying to use some other commands and noticed - so far - that the following are not correct (did Telink changed them?)

  1. ZBHCI_CMD_ZCL_ATTR_READ_RSP
  2. ZBHCI_CMD_DISCOVERY_NWK_ADDR_RSP and ZBHCI_CMD_DISCOVERY_IEEE_ADDR_RSP

And probably others that I haven't tried yet

By the way, I have noticed that there is a new version of the SDK now - v3.6.8.1 (or v2.2 zigbee concurrent - which I am using for gateway) To use concurrent I had to change the TLSR8258 to 1M flash.