Lorawan class C device example for ESP32 v2 or Wireless stick

Hi

I wonder how to get a downlink message from the gateway.
I found the following function void attribute((weak)) downLinkDataHandle(McpsIndication_t *mcpsIndication) in ESP32_LoraWAN.cpp
but I do not understand how to use it ?

Thanks

Any suggestion ? Does not sound trivial for me

#define LEDPin 25 //LED light
void app(uint8_t data)
{

lora_printf("data:%d\r\n",data);

switch(data)
{
case 49:
{
pinMode(LEDPin,OUTPUT);
digitalWrite(LEDPin, HIGH);
break;
}
case 50:
{
pinMode(LEDPin,OUTPUT);
digitalWrite(LEDPin, LOW);
break;
}
case 51:
{
break;
}
default:
{
break;
}
}

}

void downLinkDataHandle(McpsIndication_t *mcpsIndication)
{
lora_printf("+REV DATA:%s,RXSIZE %d,PORT %d\r\n",mcpsIndication->RxSlot?“RXWIN2”:“RXWIN1”,mcpsIndication->BufferSize,mcpsIndication->Port);
lora_printf("+REV DATA:");
app(mcpsIndication->Buffer[0]);

for(uint8_t i=0;iBufferSize;i++)
{
lora_printf("%02X",mcpsIndication->Buffer[i]);
}
lora_printf("\r\n");
}