Parsing +CMGR | Telit Cinterion IoT Developer Community
October 31, 2015 - 11:36am, 2821 views
Hello everyone,
When running +ATCMGR command in a MIDlet it returns this type of info which I have captured in a string:
+CMGR: "REC READ","3367400000",,"2015/10/17 22:52:44+22"
SWITCH ON O2
OK
I now wish to exploit the content of the text only ie 'SWITCH ON O2' to send instructions to the GPIOs
Could you please let me know how to eliminate all the other info from the string so I can use the text content to activate a port.
Have tried a split instruction via Eclipse but it generates:
error: "The method split(String) is undefined for the type String"
Thanks for your help.
UK Student team
To *********: apologies this was initially posted under training when it should have been under general discussion. Thanks for removing it from the training thread. All the best
Hello,
This method is unavailable in the IMP-NG Java. If you have installed the environment software you should be able to find the API in 'Start/All Programs/Cinterion' for Windows system. You can extract the SMS text with 'indexOf', 'substring' and 'trim' methods.
You will also find there the Java User's Guide document with i.e. the description how to connect the documentation to Eclipse project.
Regards,
Bartłomiej
Thank you for your help.
Would you mind clarifying which API you mean? what name does it have and what does it do? We have indeed a directory resulting from the Cinterion install.
We do have the Java user guide and have been able the use it many *****.
Will look at the methods you suggested.
Thanks again
Hello,
The Java API available for the module is very limited in comparison to Java SE. That's why I suggest to look at Java Documentation IMP-NG and JSR'a to check what is available and what not. You will find everything in Start menu.
Regards,
Bartłomiej