Hmm, I wish the world could be simple but unfortunately its not…
The thing is that the OpenAT application must filter an incoming +CMGS and to forward it slightly changed.
So, to get this working I need to parse a
"AT+CMGS="number"CR
text message CTRL-Z"
…to another message and to send it out.
I think there are some misunderstandings so I’ll be as clear as I can to describe my problem:
External application sends on serial UART1:
AT+CMGS="+31123456789"CR
this is the textmessage CTRL-Z
I want my OpenAT application to catch this in some way.
The best way should be to susbcribe on the +CMGS command and to get an Event when its received, but that does not seem to work since the CR terminates the command and the part after CR (“textmessage”) is not received as a parameter (It would work if the CTRL-Z was the terminator of the command.)
I want the complete command-string received in my Application (from +CMGS to CTRL-Z) for further handling.
Basically thats what my problem is all about.
Then after having the external applications +CMGS command I can do whatever I want with it, eg: modify it and send it to network or do anything b else but thats not relevant…
Now It’s solved. None of the proposed solutions above were useful so I tried a different one:
Subscribed to FCM.
Change to data mode.
Capture all characters and write a command parser to get the commands you want to get hold of. All other commands are piped through to the internal command API and the response handlers are also forwarding the results to the physical serial channel.
…some negative aspect are that none of the standard command API can be used and that the DCD is always ON since the serial UART is in “Data mode”.