How Java Midlet can know about received sms without gemalto libraries? | Telit Cinterion IoT Developer Community
November 24, 2016 - 1:34pm, 4250 views
How Java Midlet can know about received sms?
In our project we need to use sms information, and our Midlet must know about received sms. But without using SmsListener or without use Gemalto libraries.
So we need to know how SmsListener knows about received sms. How is possible to get this information from module and send this information to our Java application. Or maybe this library only send chekings to a modem's buffer looking for new sms??
So my question is. How is possible for a custom Java app to know about received sms in our module without using SensorLogic Agent ???
probably the simples way is wtih atCommand listener, where you cath URC: https://iot-developer.thalesgroup.com/tutorial/how-receive-sms-message
But you need to import com.cinterion.io.ATCommandListener if this is acceptable for you, or did you mean this with smsListener?
yes I know about this library, but unfortunately we are looking for a way without libraries from gemalto, so com.cinterion.io.ATCommandListener is not a solution for our problem.
Generally to get notified about the incoming SMS you need to implement the AtCommandListener interface, create the ATCommand instance and add the listener to it. Then you will be able to get URC's. To be able to get the SMS URC's you also need to configure it with the AT+CNMI command ( for example AT+CNMI=2,1). But the SMS notifications may only come to one AT commands interpreter. So when you configure this on one ATCommand instance the notification will no longer come to the previous ATCommand instance listener (if there was any already configured).
The SmsListener class was implemented for the SensorLogic libraries just because the libraries need to listen for the incoming wakeup messages, so there is AT+CNMI=2,1 or similar configured for the ATCommand instance used by the libraries. So if you will create another ATCommand instance and AtCommandListener and will configure it to receive SMS URC's the SensorLogic library will no longer be able to receive the wakeup SMS. You will also need to implement reading and deleting of the SMS with AT commands.
With the SmsListener you can register your listener and receive the SMS messages via SensorLogic libraries.
And do you know with which commands is posible to get any kind of answer on console after sending a SMS without JAVA code, just using commands?
I have +CNMI: 1,0,0,0,0
+CMTI: <mem3>, <index>
Indicates that new message has been received
And I'm waiting to see any answer on console after sms received. But after sending sms I dont see any reaction.
After know which command "knows" and inform about incomming message maybe will be posible to create our listener.
Without Java you need to do the same - activate the reporting of incoming messages with AT commands - please try AT+CNMI=2,1.
Then you should see the notification on the interface that was used for sending the command. And you will be able to read the message using the index form notification. You may also want to choose the message format: PDU or text with AT+CMGF command or the preferred storage with AT+CPMS.
and how many sms is posible to save in index? Only 10? I cannot find in the guide the space.
You can configure the SMS storages and also read the capacity and used space with AT+CPMS command (AT+CPMS? to read). The default storage is that on the SIM card (SM).