2022-03-03 10:55 AM
I am currently using 2 STM32WB55RG MCUs (one as a server and one as a client) with a Si7021-A20 temperature sensor that is completely functional on the "client" MCU and have no idea how to trigger a signal to be sent to the server from the client to turn on an LED when the temperature sensor exceeds a certain threshold.
I based my project on the ZigbeeOnOff server/client example code and have been having no luck finding any of the actual code for functions like ZbZclOnOffClientToggleReq which the example uses to send a message from client to server that toggles an LED on the server MCU when the 1st push-button is pressed.
Here is the datasheet for the temperature sensor, and attached (mirror) is the main.c file for our client MCU.
Can anyone point me in the right direction? also, does anyone know where I can find the actual code for functions that send Zigbee messages between boards?
2022-03-03 11:12 AM
In the example, have you found where the button press is handled? Can you step in the debugger from there to see where it goes...?
2022-03-03 07:45 PM
The button is handled as an external interrupt in the code below. Then, I believe app_zigbee.c handles the interrupt with APP_ZIGBEE_SW1_Process() task where the client sends the server a packet that turns on the LED on the server.
void EXTI4_IRQHandler(void)
{
HAL_GPIO_EXTI_IRQHandler(BUTTON_SW1_PIN);
}
2022-03-04 01:46 AM
so step into that code and follow what actually happens.