How to use the Cala alarm | Telit Cinterion IoT Developer Community
August 10, 2018 - 1:08pm, 1918 views
I am trying to use the Cala-alarm function, and the the alarm work's I think, but how the alarm respond with an SMS, when in fact, there is no settings for a phone-number.??? br the response: Notify RINGChanged -> true
ATEvent Begin
Notify RINGChanged -> false
How to??
Hello,
Do I understand you well? You have written midlet and there is some application whitch has setup Listener for ATCommandListener and you can check RINGChanged method? And you want then respond by sending SMS for some specified number?
You can do it like this:
ATCommand atc = new ATCommand(false);
// switch to the text mode
String at_cmd_response = atc.send("AT+CMGF=1\r");
System.out.println(at_cmd_response);
// provide the receiver number
at_cmd_response = atc.send("AT+CMGS=\"+48123456789\"\r");
System.out.println(at_cmd_response);
// provide the message text & confirm (terminate)
at_cmd_response = atc.send("Message \r\n text" + (char) 26);
// show the response on the screen
System.out.println(at_cmd_response);
You should paste it in RINGChanged method
You can check this tutorial: https://iot-developer.thalesgroup.com/tutorial/how-send-text-messages
Hope I helped you
Regards,
Krzysztof
Yes, thanks for reply.
But there must be somewhat more to this,
because this Event is also trigered when receiving SMS.
Notify RINGChanged -> true
ATEvent Begin:
+CMTI: "SM",1
Message arrived!
Notify RINGChanged -> false
New Message read = true
----------------------------
Awaiting messages to arrive!
Notify RINGChanged -> true
ATEvent Begin:
+CALA: Morten
Notify RINGChanged -> false
So what I have to do is to add an event filter
if (Event.indexOf( "+CMTI:") != -1 ) <- my SMS
else if (Event.indexOf( "+CALA:") != -1 ) <- my CALA
etc
Ok, I will give it a try, Thanks
It work just fine...