What srvProfileId will Http Connector open in Java? | Telit Cinterion IoT Developer Community
January 27, 2016 - 12:13pm, 2273 views
On a EHS6T I am trying to find out what amount of bytes my Java code will send/receive over the GSM network while uploading data packets to a server. That should be doable with AT^SISI command, but in a separate terminal window I only get ERROR while trying to read the service information.
How can I execute an AT^SISI read command on a connection that has been opened in Java? What srvProfileId does the java code activate? The profile is defined with AT^SJNET
HttpConnection conn = null;
InputStream is = null;OutputStream os = null;
try {
conn = (HttpConnection) Connector.open(url);
conn.setRequestMethod(HttpConnection.POST);
conn.setRequestProperty("Content-Type", "application/x-data");
os = conn.openOutputStream();
os.write(data);
inputStreamReadToEnd(conn.openInputStream());
return conn.getResponseCode();
}
Hi,
Have you tried the "ATCommandResponseListener" ?
See also these Java/AT cases and examples:
https://iot-developer.thalesgroup.com/faq/encapsulate-command-method
https://iot-developer.thalesgroup.com/threads/non-blocking-command-handling
https://iot-developer.thalesgroup.com/threads/how-listen-event-when-rece...
https://iot-developer.thalesgroup.com/threads/ehs6-multiple-midlets-and-...
BR 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,
The AT^SISI command can only monitor the internet services created with AT^SISS command.
Anyway it can only show you the amount of data sent and received by your application and not all data transferred by the GSM network with all the retransmissions and any other add-ons.
In Java you could get the same by just ******** your data that the application is sending and receiving.
Regards,
Bartłomiej