How to decode an SMS which looks like this ...


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1

    Exclamation How to decode an SMS which looks like this ...

    Hi
    I am trying to decode an sms like this:
    serout2 tx,baud,["AT^SMGR=1",13]
    Serin2 rx,baud,5000,main,[WAIT("REC UNREAD"),SKIP 3, STR num\12, skip 28, STR sms\8]

    To send an sms I use:
    serout2 tx,baud,["AT+CMGS=",34,"+44xxxxxxxxxx",34,13] ' It works fine when I put an predefined number
    Serin2 rx,baud,5000,check,[WAIT(">")] ' then sms and enter

    Problem:
    I want to send an text to the number from which an sms came, So I tried the above command in the following ways:
    serout2 tx,baud,["AT+CMGS=",34,STR num\12,34,13]
    serout2 tx,baud,["AT+CMGS=",34,STR num,34,13]

    It is not working. Can anyone correct me if I am wrong or advise me an alternative Please.
    Thanks
    Last edited by financecatalyst; - 7th October 2009 at 02:24.

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    It is not working. Can anyone correct me if I am wrong or advise me an alternative Please.
    Use this code:

    Code:
    serout2 tx,baud,["AT+CMGS=",STR num\12,13]
    Where:


    num[0]="+"
    num[1]="4"
    num[2]="4"
    ....................

    Al.
    Last edited by aratti; - 7th October 2009 at 07:12.
    All progress began with an idea

  3. #3


    Did you find this post helpful? Yes | No

    Exclamation

    Quote Originally Posted by aratti View Post
    Use this code:

    Code:
    serout2 tx,baud,["AT+CMGS=",STR num\12,13]
    Where:


    num[0]="+"
    num[1]="4"
    num[2]="4"
    ....................

    Al.
    I tried the above way but sorry its not working like this.

  4. #4
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    I tried the above way but sorry its not working like this.
    You can tray with SEROUT which seems working better.


    Code:
    Num     var Byte [21]
    A0        var Byte
    
    Num[0] = "A"
    Num[1] = "T"
    Num[2] = "+"
    Num[3] = "C"
    Num[4] = "M"
    Num[5] = "G"
    Num[6] = "S"
    Num[7] = "="
    Num[8] = "+"
    Num[20]= 13 ' Last array variable MUST be 13
    
    ' The above are the constant value
    
    'From Num[9] to Num[19] load your number
    Num[9[] = "4"
    Num[10] = "4"
    Num[11] = ?? ' etc. etc.
    
    
    ' dial and send the sms using the for next loop
    For A0 = 0 to 20                         
    serout Tx,T9600,[Num[A0]]   ' Change baud rate as per your need.
    Next A0
    Al.
    Last edited by aratti; - 7th October 2009 at 11:24.
    All progress began with an idea

  5. #5


    Did you find this post helpful? Yes | No

    Exclamation

    Thanks for the input, but to try this can you advise me how to load my number from num[9] to num[19] as I am only aware of loading the number using the following command which starts loading it from num[0] to num[12]:

    Serin2 rx,baud,5000,main,[WAIT("REC UNREAD"),SKIP 3, STR num\12, skip 28, STR sms\8]

    How can I modify the above syntax to start loading from 9 to 19 & NOT 0 to 12?

    Thanks

  6. #6
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    How can I modify the above syntax to start loading from 9 to 19 & NOT 0 to 12?
    Use two arrays, one for serin2 and one for serout

    For A0=0 to 11
    SecondArray[A0+9]=FirstArray[A0]
    next A0

    Al.
    All progress began with an idea

Similar Threads

  1. Replies: 11
    Last Post: - 19th August 2009, 15:23
  2. Replies: 0
    Last Post: - 21st May 2009, 00:58
  3. Replies: 13
    Last Post: - 12th May 2009, 17:26
  4. Siemens c55 sms control help please
    By camolas in forum mel PIC BASIC Pro
    Replies: 85
    Last Post: - 20th August 2008, 01:13
  5. Reading a SMS to an array
    By KA5MAL in forum GSM
    Replies: 3
    Last Post: - 17th June 2008, 17:24

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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