×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Nov 2003
    Location
    Philippines
    Posts
    25

    HELP! problem w/ sending and reading sms..

    gud day..

    currently, im developing a sms application using VB6 (mscomm) and AT commands, w/ my 6210..

    i have found a code (below) in this forum, and pasted to my form; changed a few (TEXT BOXES, for the mesg and the recipients number); however why it seems, it dosen't work, when i run (F5) the program; but when i try to debug it (F8) it do works, and i was able to send mesgs.. is there a problem with the code?

    second, is there a way i can see in VB the values "error", "ok", "+cmgs:321"; the reponses of the modem after an command is executed.. i would like to do some error trapping with that, and eventually put a alerts like "message failed" or "message sent".. bcoz when i run this code, i have to look at my phone, and all it says is "terminal connection interrupted", i couldnt tell if the mesg was sent or it has an error..

    third, im also programming the recieve module of this program.. what i did was to modify some of the codes of sending sms..
    (see below).. i have tested the AT commands, and it works with hypertermnial.. but, my 3rd problem is, i dont know what to do next.. i have reading some threads of placing an code in commEventRecv.. i hav tried dat, but still it dosent seem to work..

    can anyone help me with these.. pls.. i really need it for my project.. please..

    im really sorry, im new with mobile programming...

    thank u to all.. will appreciate all the help u culd give..

    thanks..

    -mauve928



    ---------------
    SENDING SMS (i dont know where is th problem)


    Private Sub cmdSendMesg_Click()
    ' Set up the communications port
    MSComm1.CommPort = 1 ' Com Port 1

    ' Set for 9600 baud, no parity, 8 data, and 1 stop bit.
    MSComm1.Settings = "9600,N,8,1"

    ' Tell the control to read entire buffer when Input is used
    MSComm1.InputLen = 0

    ' Open the port
    MSComm1.PortOpen = True

    ' Send an 'AT' command to the phone
    MSComm1.Output = "AT" & Chr$(13) & Chr(10)
    ' The phone will respond with an 'OK'

    ' Set up the phone for a text message
    MSComm1.Output = "AT+CMGF=1" & Chr$(13) & Chr(10)
    ' The phone will respond with an 'OK'

    ' Prep for SMS, give destination type and destination address.
    ' Enter the destination type and destination address to prep for SMS

    MSComm1.Output = "AT+CMGS= " & Chr(34) & txtRecpMobileNo.Text & Chr(34) & Chr$(13) & Chr(10)


    MSComm1.Output = txtMesg.Text & Chr$(26)


    ' Close the port
    MSComm1.PortOpen = False

    End Sub

    -----------------
    RECEIVEING SMS

    Private Sub cmdSendMesg_Click()
    ' Set up the communications port
    MSComm1.CommPort = 1 ' Com Port 1

    ' Set for 9600 baud, no parity, 8 data, and 1 stop bit.
    MSComm1.Settings = "9600,N,8,1"

    ' Tell the control to read entire buffer when Input is used
    MSComm1.InputLen = 0

    ' Open the port
    MSComm1.PortOpen = True

    ' Send an 'AT' command to the phone
    MSComm1.Output = "AT" & Chr$(13) & Chr(10)
    ' The phone will respond with an 'OK'

    ' Set up the phone for a text message
    MSComm1.Output = "AT+CMGF=1" & Chr$(13) & Chr(10)
    ' The phone will respond with an 'OK'

    'new mesg indication
    MSComm1.Output = "AT+CNMI=1,2,0,0,0 " & Chr$(13) & Chr(10)

    (THIS IS WHERE I AM STUCK; dont know what to write next..)



    ' Close the port
    MSComm1.PortOpen = False

    End Sub
    Last edited by mauve928; 2003-12-14 at 19:13.

Posting Permissions

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