×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jun 2012
    Location
    Nairobi, Kenya
    Posts
    3

    AT commands appearing in sent message

    Hi guys,

    Am sending SMS messages from a java application.
    The problem is, the messages that are sent and received contain AT commands like AT+CMGS in the message.
    Is there a way I can surpress the AT commands from being sent. Below is my code segment for sending the messages.

    Code:
                    gsm.connect();
                    //gsm.enableExtendedCommands();
                    gsm.checkStatus();
                    //Thread.sleep(5000);
                    Thread.sleep(5000);
                    //gsm.flush();
                    //Put the GSM modem/phone in text mode
                    gsm.send("AT+CMGF=1\r\n");
                    //out.flush();
                    //Enable extended error codes
                    gsm.send("AT+CMEE=1\r\n");
                    //out.flush();
                    //Clear the outputstream of any characters unwanted in SMS to be sent
                    //gsm.flush();
                    //Send SMS
                    gsm.send("AT+CMGS=\"" + phoneNumber + "\"\r\n");
                    //gsm.flush();
                    //Add a whitespace character
                    gsm.send(message + '\032');
                    //gsm.sendSmsMessage(message, phoneNumber);
                    //Thread.sleep(200);
                    Thread.sleep(2000);
                    gsm.hangup();
                    gsm.serialPort.close();
    The send() method is shown below

    Code:
        public void send(String cmd) {
            try {            
                outputStream.write(cmd.getBytes());
                
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }
        }

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: AT commands appearing in sent message

    Hi kchemweno and welcome to Nokia's Discussion Boards,

    Are you trying to send the message from a Nokia device using Java ME and the Wireless Messaging API?

  3. #3
    Registered User
    Join Date
    Jun 2012
    Location
    Nairobi, Kenya
    Posts
    3

    Re: AT commands appearing in sent message

    No, am using a Java application on my desktop to connect to my phone. I use the phone as a GSM modem.
    I issue AT commands to the phone via the serial port that the phone is connected to the computer.

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: AT commands appearing in sent message

    Quote Originally Posted by kchemweno View Post
    No, am using a Java application on my desktop to connect to my phone. I use the phone as a GSM modem.
    I issue AT commands to the phone via the serial port that the phone is connected to the computer.
    Try to looking into this URL - http://sharp-coders.blogspot.in/2011...-via-gms.html#
    It might help.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  5. #5
    Registered User
    Join Date
    Jun 2012
    Location
    Nairobi, Kenya
    Posts
    3

    Re: AT commands appearing in sent message

    Hi Amitabh, the code suggested there looks great although it is much more similar to what am doing.
    My problem is not with sending the message, i can actually send a message successfully, my challenge is that the sent message will contain AT commands that were issued against the mode.
    Can you help me with that?

  6. #6
    Registered User
    Join Date
    Jun 2012
    Posts
    2

    Re: AT commands appearing in sent message

    What if you don't include the AT command in the gsm.send function call ?

    Quote Originally Posted by kchemweno View Post
    Hi Amitabh, the code suggested there looks great although it is much more similar to what am doing.
    My problem is not with sending the message, i can actually send a message successfully, my challenge is that the sent message will contain AT commands that were issued against the mode.
    Can you help me with that?

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: AT commands appearing in sent message

    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. Send SMS message using AT+ commands
    By Pinchas Ziv in forum Bluetooth Technology
    Replies: 6
    Last Post: 2010-02-11, 15:15
  2. Please Help! How to use Alert message with YES|NO commands
    By chatrapati.nokia.santhosh in forum Mobile Java General
    Replies: 2
    Last Post: 2009-10-19, 08:37
  3. AT (or other) Commands for Nokia // reading message
    By jelle_vr in forum PC Suite API and PC Connectivity SDK
    Replies: 3
    Last Post: 2009-09-16, 12:50
  4. setting message id of sms using AT commands
    By know_asim in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-10-24, 16:10
  5. Send Message with AT-Commands
    By Brander in forum General Messaging
    Replies: 1
    Last Post: 2003-02-24, 07:53

Posting Permissions

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