Topic

FAQ
Login Register
Zigbee - broadcst message
Jul 27, 2023 14:10

/

A

/A

I have a device that sends the status message which is configured as below:

epInfo_t dstEpInfo;
memset((u8 *)&dstEpInfo, 0, sizeof(epInfo_t));
dstEpInfo.dstAddrMode = APS_SHORT_DSTADDR_WITHEP;
dstEpInfo.dstEp = 1;
dstEpInfo.dstAddr.shortAddr = NWK_BROADCAST_ROUTER_COORDINATOR; //0xFFFC;
dstEpInfo.profileId = HA_PROFILE_ID;
zoneStatusChangeNoti_t statusChangeNotification;
statusChangeNotification.zoneStatus |= ZONE_STATUS_BIT_ALARM1;
statusChangeNotification.extStatus = 0;
statusChangeNotification.zoneId = g_zcl_iasZoneAttrs.zoneId;
statusChangeNotification.delay = g_zcl_iasZoneAttrs.zoneDelay;
zcl_iasZone_statusChangeNotificationCmd(1, &dstEpInfo, TRUE, &statusChangeNotification);


Destination address is set dstAddr.shortAddr = NWK_BROADCAST_ROUTER_COORDINATOR., I understand that the message was supposed to be send to all routers and coordinator.

The gateway receives the message but not the router device! Both devices have the same EP.

What am I missing?

Is there any code that I should put in the router device to receive this message?





4 replies
TL_Soyo Jul 27, 2023 16:27
0
/A

Hi,

  have you ever added the IAS Cluster in Router's sampleLight_inClusterList[] table,our default table has not this Cluster ,you can reference gatway to implement it.

wes58 [Author] Jul 27, 2023 16:58
0
/A

Hi,

Yes, I have it:

const zcl_specClusterInfo_t g_AppClusterList[] = {

#ifdef ZCL_IAS_ZONE

   {ZCL_CLUSTER_SS_IAS_ZONE, MANUFACTURER_CODE_NONE, ZCL_IASZONE_ATTR_NUM, iasZone_attrTbl, zcl_iasZone_register, App_iasZoneCb},

#endif

...

}


And in zcl_appCB.c I have a function:

status_t App_iasZoneCb (zclIncomingAddrInfo_t *pAddrInfo, u8 cmdId, void *cmdPayload) {

   led_toggle(LED7);

  .....

}


I added a led to see if there is any message coming but there is nothing.

TL_Soyo Jul 27, 2023 17:26
0
/A

try toggle LED in void zcl_cmdHandler(void *pCmd),if zcl pack recived ,this function will be called,and then find why the application not process it.normolly ,should run in status = pCluster->cmdHandlerFunc(&inMsg);



wes58 [Author] Jul 28, 2023 06:51
0
/A

Issue solved.

The problem was with the code to toggle the led.

I had:

if(0 == drv_gpio_read(GPIO_PD2) ){

  drv_gpio_write(GPIO_PD2, 1);

}

else{

  drv_gpio_write(GPIO_PD2, 0);

}


drv_gpio_read(GPIO_PD2) always returned 0. It looks like, drv_gpio_read(GPIO_PD2) only works on inputs?


Since there is no gpio toggle function in drv_gpio.c, I had to go back to gpio.h, and use function gpio_toggle(GPIO_PD2)