Async SMS Send no callback is triggered (le_sms_SendAsync)

Hi

I had 3 days of Legato under my belt and am stuck. Has anyone used the Async SMS Sending successfully, w.r.t. to the callback function?

result = le_sms_SendAsync(msgRef, smsCallback, NULL);

The SMS does get sent to a mobile successfully but the call back function is never called. The callback is defined as follows

void smsCallback(le_sms_MsgRef_t msgRef, le_sms_Status_t status,void *contextPtr)
{

}

The documentation also talks about le_sms_setTimeout, but this function does not exist.
le_sms_Send was as expected, blocking, can anyone help with async operation with callback, has anyone got this working?

Thanks in advance.

Hi Flav,

Just tried and seems working for me.

Jun 12 01:42:39 swi-mdm9x28 user.debug Legato: DBUG | helloWorld[2802]/framework T=main | le_sms_client.c le_sms_Create() 1035 | Sending message to server and waiting for response : 0 bytes sent
Jun 12 01:42:39 swi-mdm9x28 user.debug Legato: DBUG | helloWorld[2802]/framework T=main | le_sms_client.c le_sms_SetDestination() 1214 | Sending message to server and waiting for response : 16 bytes sent
Jun 12 01:42:39 swi-mdm9x28 user.debug Legato: DBUG | helloWorld[2802]/framework T=main | le_sms_client.c le_sms_SetText() 1308 | Sending message to server and waiting for response : 13 bytes sent
Jun 12 01:42:39 swi-mdm9x28 user.debug Legato: DBUG | helloWorld[2802]/framework T=main | le_sms_client.c le_sms_SendAsync() 1877 | Sending message to server and waiting for response : 8 bytes sent
Jun 12 01:42:44 swi-mdm9x28 user.info Legato: INFO | helloWorld[2802]/helloComponent T=main | helloWorld.c CallbackTestHandler() 19 | Message 0x10000001, status 4, ctx (nil)

Below my test code:

static void CallbackTestHandler
(
le_sms_MsgRef_t msgRef,
le_sms_Status_t status,
void* contextPtr
)
{
LE_INFO(“Message %p, status %d, ctx %p”, msgRef, status, contextPtr);
le_sms_Delete(msgRef);
}

COMPONENT_INIT
{
le_sms_MsgRef_t myMsg;
myMsg = le_sms_Create();
le_sms_SetDestination(myMsg, “91234567”);
le_sms_SetText(myMsg, “hello”);
le_sms_SendAsync(myMsg, CallbackTestHandler, NULL);
}

Not sure the problem, maybe we can find something from debug legato log?

cm info
cm radio
log level debug
logread -f
(run you app)

Hope it helps.
Thx

Hi lotam

Thank you for the confirmation. So I had two problems. First I was calling le_sms_Delete(msgRef) after the le_sms_SendAsync and second somehow the le_sms_SendAsync is running on different thread that I created, I think from my own linux timer (non-legato timer).

If I use your code as is, then all works well. I’m struggling to get to grips with a component that has no main loop so created a thread to counteract that, but guess I’m going down wrong path… need to play a bit more, thanks again for confirming. I’ll ask about polling for( ; ; ) on a different post if I don’t come right.

Thanks again!

Hi,

Did you manage to resolve your issue? I too am finding that the async SMS callback is not triggered, even though the SMS is successfully sent.

I don’t see problem with WP76 R13, I can see the callback message

Oct 26 01:11:46 | modemDaemon[1138]/modemDaemon T=main | le_sms.c SendAsyncSMS() 2057 | Send Send command for message (0x10000003)
Oct 26 01:11:46 | modemDaemon[1138]/modemDaemon T=SmsSendingThread | le_sms.c ProcessSmsSendingCommandHandler() 2098 | LE_SMS_CMD_TYPE_SEND message (0x10000003) 
Oct 26 01:11:46 | avcDaemon[1118]/avcDaemon T=main | avcAppUpdate.c NotifyObj9List() 691 | Found 1 object 9 instances
Oct 26 01:11:46 | avcDaemon[1118]/avcDaemon T=main | avcAppUpdate.c NotifyObj9List() 692 | obj9ListLen; 12 obj9List: </lwm2m/9/0>
Oct 26 01:11:46 | modemDaemon[1138]/modemDaemon T=SmsSendingThread | le_sms.c ProcessSmsSendingCommandHandler() 2115 | Async send command status: 4
Oct 26 01:11:46 | hello7[2325]/hello7Component T=main | hello7Component.c CallbackTestHandler() 11 | Message 0x10000003, status 4, ctx (nil)
Oct 26 01:11:47 | avcDaemon[1118]/avcDaemon T=main | assetData.c RegUpdateTimerHandler() 3262 | RegUpdate timer expired; reporting REG_UPDATE
Oct 26 01:11:47 | avcDaemon[1118]/avcDaemon T=main | assetData.c assetData_RegistrationUpdate() 1946 | unsupported function called.
Oct 26 01:12:56 | posDaemon[1144]/le_pa_gnss T=unknown | pa_gnss_qmi.c PositionHandler() 1481 | Bad position indication

You can try my code:

le_sms_SendAsync.zip (17.9 KB)