Problem with actuating a led with stm32WLJC!! in lora_app.c,line 507.
i modified the code for downlink turning on red led 3.
" case LORAWAN_USER_APP_PORT:"
for my case port 99:
to turn on led defined at PB1 which i defined.
as this was the default code for digital output given by cayenne port 99.
when i am gpio writing whenever channel 4 is comming its turning on. but if i read 3 byte its not turning on , i am confused the code is as follow.
case 99:
if (appData->BufferSize == 4)
{
AppLedStateOn = appData->Buffer[1] & 0x64;
if (AppLedStateOn == RESET)
{
APP_LOG(TS_OFF, VLEVEL_H, "LED OFF\r\n");
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET); // LED_RED
// HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_RESET); // LIGHT OFF
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_RESET); // LIGHT OFF
}
else
{
APP_LOG(TS_OFF, VLEVEL_H, "LED ON\r\n");
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET); // LED_RED
// HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_SET); // LIGHT ON
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_SET); // LIGHT ON
}
}
break;
from cayenne the downlink communication in port 99 is
for on- 04 00 64 FF
and off -04 00 00 FF
