parsing string from hserin


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2009
    Posts
    48

    Default parsing string from hserin

    hello

    i want to parse string from gsmbuffer variable like this
    Code:
    ip:
    HSEROUT["AT+CMGL",13,10]'get the msg from phone
    
    LCDOUT $FE,1,"query" 'show query on lcd 
    
    HSERIN 3000,IP,[WAIT("REC UNREAD"),skip 41,STR GSMBUFFER\16\13] 'wait for rec unread, and get the string gsmbuffer 
    LCDOUT $FE,1,str poruka\16 'show it on lcd
    the idea is to send sms "XYZ" which simulates 3 output's, and that means there are all switched ON, and if i send sms "Xyz" then first output is ON and others are OFF...

    help me with some guidelines!!!!

    thx in advance

  2. #2
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    any conscructive help is welcome ....

    the idea is to compare gsmbuffer string with XYZ letter combination !!!
    just give me idea how to work this out!!!!

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The example here parses a string...

    http://www.picbasic.co.uk/forum/showthread.php?t=573

  4. #4
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    The example here parses a string...

    http://www.picbasic.co.uk/forum/showthread.php?t=573
    yes but i want to make it as simple as posible......like sms command ONN will turn on portb.6, and smsm comand OFF will shut it down ...any sugestion melanie?
    Last edited by xxxxxx; - 16th March 2009 at 14:34.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Yes. Do what the example does when you take away all the frills...

    Feed your SMS message into an array buffer.

    Then simply scan your buffer for the occurance of your keyword.

    It doesn't get any simpler than that.

  6. #6
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    frills .....okay i'am gonna try it!!! thx for encouragement

  7. #7
    Join Date
    Mar 2009
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Send directly

    at+cmgl="rec unread"

  8. #8
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    i solve this in a easy way

  9. #9
    Join Date
    Feb 2009
    Location
    Southern California
    Posts
    86


    Did you find this post helpful? Yes | No

    Default

    Good job

    Why don't you post your easy solution for anyone else who has similar problems or just to help encourage anyone else who reads this thread and sees how you were able to solve your own problem?

    David

  10. #10
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Luckyborg View Post
    Good job

    Why don't you post your easy solution for anyone else who has similar problems or just to help encourage anyone else who reads this thread and sees how you were able to solve your own problem?

    David
    ws:
    HSEROUT["AT+CMGL",13,10]' filter za query
    LCDOUT $FE,1,"wait sms."

    HSERIN 5000,ws,[WAIT("REC UNREAD"),skip 27,str TIME\6,skip 8,STR PORUKA\5\13]

    pause 2000
    I=0

    gr[1]="U"
    gr[2]="G"

    istaporuka=1
    FOR I=0 to 1
    if gr[i+1]<>poruka[i+1] then istaporuka=0

    next i

    if istaporuka=1 then gosub s1

    J=0

    gr[1]="I"
    gr[2]="G"

    istaporuka1=1
    FOR J=0 to 1
    if poruka[J+1]<>gr[J+1] then istaporuka1=0
    next J

    if istaporuka1=1 then gosub s2


    --
    www.mtskola.com
    Last edited by xxxxxx; - 2nd April 2009 at 19:17.

Similar Threads

  1. Hserin parsing string...again?
    By kevlar129bp in forum Serial
    Replies: 21
    Last Post: - 9th July 2012, 16:35
  2. HSERIN for variable length string
    By Pic2008 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 19th February 2010, 05:58
  3. Visual Basic 6 & Access 2000
    By Demon in forum Off Topic
    Replies: 33
    Last Post: - 7th September 2006, 04:39
  4. String Parsing
    By eoasap in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th February 2006, 17:20
  5. serial string parsing
    By billybobbins in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 8th September 2004, 21:34

Members who have read this thread : 1

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