Bluetooth application with SMS

I want to create an application that receive SMS, read it and transmit by BLE to a smartphone.
I plan to use g_signal_connect(interface, “handle-read-value”, handle_read_value, sms) where sms will contain the message I want to transmit.
But sms will depend on the reception of a sms and will be generated thanks to le_sms_AddRxMessageHandler. My quesion is do I need to use 2 applications working in paralell or can I write the code in the same file?
The problem is when the SMS handler function is called (when receiving a sms), I do a getText at some point in this function and I want to add directly my function g_signal_connect(interface, “handle-read-value”, handle_read_value, sms) but I don’t know if it is feasible this way. My application is compiling but cannot run and I don’t know why. Maybe it is because of that…

If you suspect this function cannot be called inside the SMS RX handler, can you try to start an one shot timer inside the handler?

If it works, you can put the g_signal_connect() there.


#define TIMER_INTERVAL_uSEC 100000

static void tmrHandler(le_timer_Ref_t timerRef) {
    LE_INFO("Hello, world.");

    le_clk_Time_t clk = { .sec = TIMER_INTERVAL_SEC, .usec = TIMER_INTERVAL_uSEC };
    le_timer_Ref_t adxlPollingTimer = le_timer_Create("ADXL_TIMER");
    le_timer_SetRepeat(adxlPollingTimer, 1);
    le_timer_SetInterval(adxlPollingTimer, clk);
    le_timer_SetHandler(adxlPollingTimer, tmrHandler);

Thanks! I will try and let you know

Or simply way to solve my issue would be to include a pointer or structure in le_sms_AddRxMessageHandler(RxMessageHandler, NULL);
can I put a structure in replacement to NULL which is contextPtr? In which cases contextPtr might be non null?

here also uses NULL for 2nd parameter:

But are there any cases where it is not NULL?

not quite sure, but i think it is ok to use NULL as the sample code also uses NULL