After processing a received SMS, I want to delete it from the SIM with the means of adl_atCmdSend(“AT+CMGD=1\r\n” , NULL, NULL);
However, the message was not deleted.
Not being sure, if the command needet to be subscribed before use, I did so in advance with adl_atCmdSubscribe(“AT+CMGD” ,NULL, ADL_CMD_TYPE_PARA |ADL_CMD_TYPE_ACT);
but without any effect.
What prefents the deletion of SMS #1 on the SIM?
at
You hint with the termination of the AT command was good.
The line “adl_atCmdSend(“AT+CMGD=1\r” , NULL, NULL);” works
(however, I am a bit surprised that terminating with “\r\n” refuses the correct procession)
The SMS index 1 was just an exemple.
For further analysis I defined a response-handler to obtain the error code.
However, I get only the ascii"OK" or “ERROR” (content of “StrData[]” of structure adl_atResponse_t).
Is this, what you meant by ‘error code’?
I think this code may help you.
On SmsHandler event , we receive the SmsText, and SMS sender Number.
Here in the code i am validating the sender number
If return is true it will be saving in the SIM or else will not.