i connected a consumer device sensor to coordinator(EFR32MG12). and i will receive zcl message from the coordinator from the sensor. i have relay connected to GPIO of coordinator.
i want to ON/OFF the relay according to the receiving IAS zone state change notification from the consumer device which in the same network with coordinator.
As you mentioned before i need to use printIncomingZclMessage and i want to set gpio according to that.
should i need to add printIncomingZclMessage in dialog options?
please let me know were(which part of the code) i can do to operation in the project.
thanking you.
Discussion Forums
ZigBee and Thread
Answered
Answered
You don't need to add anything in project file. printIncomingZclMessage is called in emberAfProcessMessage (in util.c) by default.
0
Dear,
How can process and set(on/off) of my Relay which is connected to GPIO of coordinator according to the Receveing ZCL message in static void printIncomingZclMessage(const EmberAfClusterCommand *cmd); USING void GPIO_PinModeSet();
IN THE NETWORK IF I GET MESSAGE AS BELOW FROM THE SENSOR:
T00000000:RX len 9, ep 01, clus 0x0500 (Unknown clus. [0x0500]) FC 09 seq 78 cmd 00 payload[00 00 00 FF 00 00 ] -i need to OFF the Relay which in connection TO GPIO OF Coordinator.
T00000000:RX len 9, ep 01, clus 0x0500 (Unknown clus. [0x0500]) FC 09 seq 77 cmd 00 payload[01 01 00 FF 00 00 ] - i need to ON the Relay which in connection TO GPIO OF coordinator.
please let me know how can i set Gpio according to the message, thanking you
0
If you look into printIncomingZclMessage, you can see emberAfAppPrintBuffer is used for payload print.
I didn't understand, Please let me know, thanking you.
0
Payload is start from "cmd->buffer + cmd->payloadStartIndex" with length "cmd->bufLen - cmd->payloadStartIndex" so you can parse what is inside "cmd->buffer + cmd->payloadStartIndex" to set GPO accordingly.
0
Your code doesn’t make sense. Why do you use for-loop to check cmd->buffer[0] and call GPIO_PinModeSet?
0
Dear YK,
can i call check buffer size like below and call GPIO_PinModeSet to control GPIO Status according to the size buffer to on/off gpo.
if (cmd->buffer <= 0)
{
GPIO_PinModeSet(gpioPortD, 9, gpioModePushPull, 0);
}
else if (cmd->buffer > 0)