nguyenbahuong / smslib

Automatically exported from code.google.com/p/smslib
0 stars 0 forks source link

ReadMessage error #486

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
using  smslib 3.5.2 I have the following SerialModemGateway 

SerialModemGateway gateway = new SerialModemGateway("modem.com4", "COM8", 
115200, "ZTE", "E1556");

and ReadMessage produces the following error:

24606  2012-04-25 19:53:06,543 [DelayQueueManager] DEBUG 
org.smslib.queues.AbstractQueueManager$DelayQueueManager  - DelayQueueManager 
end...
java.lang.StringIndexOutOfBoundsException: String index out of range: -12
    at java.lang.String.substring(String.java:1937)
    at org.smslib.modem.ModemGateway.readMessagesPDU(ModemGateway.java:549)
    at org.smslib.modem.ModemGateway.readMessages(ModemGateway.java:213)
    at org.smslib.Service.readMessages(Service.java:501)
    at org.smslib.Service.readMessages(Service.java:389)
    at examples.modem.ReadMessages.doIt(ReadMessages.java:102)
    at examples.modem.ReadMessages.main(ReadMessages.java:163)
24806  2012-04-25 19:53:06,743 [WatchDog] DEBUG 
org.smslib.threading.AServiceThread  - Stopped.

please help

log attached.

Original issue reported on code.google.com by j2bu...@gmail.com on 26 Apr 2012 at 1:07

Attachments:

GoogleCodeExporter commented 9 years ago
Duplicate question with the one posted on the discussion group.

Original comment by T.Delenikas on 26 Apr 2012 at 6:15

GoogleCodeExporter commented 9 years ago
exactly which discussion? which number issue?

thanks

Original comment by j2bu...@gmail.com on 26 Apr 2012 at 7:00

GoogleCodeExporter commented 9 years ago

Original comment by T.Delenikas on 28 Apr 2012 at 4:27

GoogleCodeExporter commented 9 years ago
Your modem does not recognize the "SR" storage location.

You could add the following line -in your code- after the gateway creation

gatewayObject.getATHandler().setStorageLocations("SM");

and try again.

Original comment by T.Delenikas on 28 Apr 2012 at 4:29

GoogleCodeExporter commented 9 years ago
ok that worked.

thanks

Original comment by j2bu...@gmail.com on 28 Apr 2012 at 8:39

GoogleCodeExporter commented 9 years ago

Original comment by T.Delenikas on 28 Apr 2012 at 8:56

GoogleCodeExporter commented 9 years ago
I have the same issue and this article saves me for a day. 

Thanks!

Original comment by erieze.l...@gmail.com on 17 Aug 2014 at 2:47

GoogleCodeExporter commented 9 years ago
Hello, I have the same exception  and i have a huawei e3131.

Exception in thread "SMSLib-AsyncMessageProcessor : modem.com4" java.lang.String
IndexOutOfBoundsException: String index out of range: -12
        at java.lang.StringHelper.substring(StringHelper.java:1665)
        at java.lang.String.substring(map.xml:422)
        at org.smslib.modem.ModemGateway.readMessagesPDU(ModemGateway.java:552)
        at org.smslib.modem.ModemGateway.readMessages(ModemGateway.java:213)
        at org.smslib.modem.AModemDriver$AsyncMessageProcessor.run(AModemDriver.
java:880)

Thanks advance!

Original comment by azamatbo...@gmail.com on 29 Mar 2015 at 10:16