Space between parameters in Java | Telit Cinterion IoT Developer Community
August 24, 2017 - 2:06pm, 2017 views
Hi,
I have tried the ATCmdDemo in NetBeans for an EHS6 B20 Kit.
All is working, expect m_Cmd.send("at^smgl=\"REC ALL\"\r".
The response is always:
Received synchronous response:
at^smgl="RECALL"
ERROR
What is the right syntax to include parameters with spaces?
Best Regards
Antero
Antero Markkula
Communication and Mechatronics
Enkom Active Oy – www.enkom-active.fi
Upseerinkatu 3 A, 02600 Espoo, Finland
Mobile: +358 400 411368
Office: +358 10 204 0000
Fax: +358 10 204 0010
E-mail: antero.markkula@enkom-active.fi
Hello,
Isn't it the problem with character encoding? Please check what is configured on the module. You may try to use the methds provided in API to convert the string for the send() method.
Regards,
Bartłomiej
Hi,
We have tested various options - without success. Tests include converting the string using methods like Java2GSM and Java2UCS2Hex. We have also changed the character encoding between "GSM" and "UCS2".
All other AT commands can be sent fine, expect the at^smgl="REC ALL", which still will output at^smgl="RECALL".
Any suggestions :)
Best regards,
Antero
Antero Markkula
Communication and Mechatronics
Enkom Active Oy – www.enkom-active.fi
Upseerinkatu 3 A, 02600 Espoo, Finland
Mobile: +358 400 411368
Office: +358 10 204 0000
Fax: +358 10 204 0010
E-mail: antero.markkula@enkom-active.fi
Hello,
I have tested this and got the same answer. Space character is encoded in the same way for GSM and ASCII so any excape character should be needed here. It looks for now like the space may be removed by send() method. If you put spaces into any command, for example if you type send("A T I 1 \r"), they will be removed. Generally there are no spaces used in the commands syntax and this parameter may be one of the exceptions..
I've verified in the AT Commands Specification document that the allowed parameters for text mode are: "REC UNREAD", "REC READ", "STO UNSENT", "STO SENT" and "ALL".
So if you would like to read all meassages you can use "ALL" parameter and that will work for sure.
Regards,
Bartłomiej
Hi,
Thank you for the testing. It seems that the best way is to read all messages with "ALL" parameter and parse the messages of interest using the status field and time stamp.
Best Regards,
Antero
Antero Markkula
Communication and Mechatronics
Enkom Active Oy – www.enkom-active.fi
Upseerinkatu 3 A, 02600 Espoo, Finland
Mobile: +358 400 411368
Office: +358 10 204 0000
Fax: +358 10 204 0010
E-mail: antero.markkula@enkom-active.fi