#include "interfaces.h"
#include "smsSample.h"
#define MESSAGE_FEEDBACK "Message from %s received"
static void RxMessageHandler
(
void* contextPtr
)
{
LE_INFO(
"A New SMS message is received with ref.%p", msgRef);
{
{
LE_ERROR(
"le_sms_GetSenderTel has failed (res.%d)!", res);
}
else
{
LE_INFO(
"Message is received from %s.", tel);
}
{
LE_ERROR(
"le_sms_GetTimeStamp has failed (res.%d)!", res);
}
else
{
LE_INFO(
"Message timestamp is %s.", timestamp);
}
{
LE_ERROR(
"le_sms_GetText has failed (res.%d)!", res);
}
else
{
LE_INFO(
"Message content: \"%s\"", text);
}
snprintf(textReturn, sizeof(textReturn), MESSAGE_FEEDBACK, tel);
res = smsmo_SendMessage(tel, textReturn);
{
LE_ERROR(
"SmsMoMessage has failed (res.%d)!", res);
}
else
{
LE_INFO(
"the message has been successfully sent.");
}
{
LE_ERROR(
"le_sms_DeleteFromStorage has failed (res.%d)!", res);
}
else
{
LE_INFO(
"the message has been successfully deleted from storage.");
}
}
else
{
LE_WARN(
"Warning! I read only Text messages!");
}
}
(
void
)
{
if (!HdlrRef)
{
LE_ERROR(
"le_sms_AddRxMessageHandler has failed!");
}
else
{
}
}
void smsmt_HandlerRemover
(
void
)
{
}