Results 1 to 2 of 2
  1. #1
    Sanaullah is offline Member
    Join Date
    May 2014
    Posts
    2
    Rep Power
    0

    Default Why i m not receiving correctly the SMS over length of more the a page Using AT Cmand

    i m working on the SMS receiving using AT Commands using JAVA. i m getting the message of one page correctly using AT commands, but as i increase the size of SMS as 2, 3 or bigger pages the alphabets are converted to some thing like this

    +CMGL: 0,"REC UNREAD","+923028910082",,"14/05/10,19:32:40+20"
    4469616C202A3334352A393333232061757220536972662052 732E3230206D65696E20332064696E206B6120696E7465726E 65742028333030204D422920686173696C206B6172656E2120 7777772E776170747269636B2E636F6D2070657220736F6E67 73206175722067616D657320656E6A6F79206B6172656E2120 42616C616E636520636865636B206B206C7965202A39393923 206D69

    whats the problem i m not getting the right text which i have sent through my mobile phone.
    please help me out it very urgent

    my function of receiving SMS is as follows

    public void send(String cmd) {
    try {
    outputStream.write(cmd.getBytes());
    } catch (IOException e) {
    e.printStackTrace();
    }
    }
    public void recieveMessage() throws InterruptedException, IOException{

    send("AT+CMGF=1\r"); //send ok if suport txt msg
    Thread.sleep(100);



    send("AT+CMGL=\"REC UNREAD\"\r"); //return list mesgs received on gsm modem


    byte[] readBuffer = new byte[2048];
    try {

    InputStream inputStrea = null;
    inputStrea=serialPort.getInputStream();
    int numBytes = inputStrea.read(readBuffer);

    //print response message
    String st=new String(readBuffer);
    st=st.trim();


    System.out.println(st);

    setRecieveMsg(st);
    } catch (IOException e) {
    }
    send("AT+CMGD=1,4\r");
    }

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,775
    Blog Entries
    7
    Rep Power
    21

    Default Re: Why i m not receiving correctly the SMS over length of more the a page Using AT C

    You already posted an identical question in the 'New to Java' forum; it's weekend so be a bit patient; the forum is slow during those days; and it might be urgent to you, it isn't to us. I'm closing this thread.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 0
    Last Post: 05-10-2014, 09:18 PM
  2. Length of an Array: length() or just length ?
    By Jack_Tauson_Sr in forum New To Java
    Replies: 8
    Last Post: 03-18-2013, 09:16 PM
  3. Difference between length() and length
    By mitra in forum New To Java
    Replies: 7
    Last Post: 07-28-2011, 01:46 AM
  4. Receiving UDP pockets
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-07-2008, 09:08 PM
  5. How Do I Embed Java Correctly To A Web Page
    By abcd in forum Java Applets
    Replies: 7
    Last Post: 01-28-2008, 08:53 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •