Frage

Im working on a program to send and recieve SMS using a GSM modem and my computer.

I have gotten sending and receiving to work - well sort of.

Once in a while my program is sent into a total chrash due to modem is mixing up information about Radio Signal Strength Indication and alike, while also serving my program with the hex code for the message.

My code can handle the hex code just fine. but I have seen the following line popup while im decoding a byte stream:

^RSSI: 2

So far I've seen it send out values between 1 and 10.

Is there an AT Command that can disable them? I have no need for them.

Or alternative: Is there a general syntax for them, so I can filter them out before decoding?

Im leaning towards a filter solution. But that would be more easy to implement if I knew whenever modem is sending out on the form: "^SOMETHING: xxx", then It would be nice to know if it is always followed up be a delimiter say for instance "\r".

War es hilfreich?

Lösung

You should try turning off periodic messages as using AT^CURC=0.

Information regarding the AT^CURC command:

AT^CURC? Current setting of periodic status messages

AT^CURC=? See what you possible values are

AT^CURC=0 turn off periodic status messages

Andere Tipps

The best way to tackle this scenario would be to replace that part of the response with an empty string because otherwise, it will be difficult to check even if the command sent to disable it is working or not.

This regex will match all those. You can replace them ideally by an empty string.

(\\n|\\r|\\r\\n)\\^.*(\\n|\\r|\\r\\n)
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top