Sending sms interruption

Hello everyone. Need some help in using Sim800l. Is there a way to send sms without interrupting the process of arduino? everytime that the sim800l is sending sms. the adding of x is pausing, then continue when the sms is sended.

HELP.ino (616 Bytes)

I've posted previously on this topic.
The individual calls are quite fast to return with OK, or their error codes...
You need to stay on top of these responses immediately they come in to create a reponsive non-blocking SMS_send() function.

Develop a state-machine to step between the various phases of sendintg a text - without waiting for it to reply each time...

enum modem_states { MODEM_IDLE,
char modem_state = MODEM_IDLE;  // initial state

Send the first command, increment the state and continue in loop() until the next reply comes in...
Send the next command, increment the state and continue in loop() until the the next reply comes back...
... etc...
After the final OK is received - you're good to return to MODEM_IDLE and move on. Keep in mind there could be other states you're looking for CSQ, CCLK etc. and you must accommodate them in yout state handler.
If any ERRORs occur before you get back to idle - you know where to start looking.

Note: this has to be implmented in two parts - first when you send the commsnf, and second when the unsolicited replies come back - so you're not 'waiting' for them.