PDA

View Full Version : need help?? on receiving sms



kikojam
25-09-2003, 09:31 AM
does anyone have code in receiving an sms.
for now I know how to send code using FBUS to send sms
but my problem is that how can i detect if i have a incoming sms message without accessing the inbox--- thus it possible?????
by the way im using VB6

please if you can help kindly post it here or mail me at [email protected]

thanks in advance

natnat
25-09-2003, 10:15 AM
same problem here.

i saw projects involving mini elevators in which you just send an sms which floor you like then whalla! the elevator automatically goes there. it was conneted to a computer.

how do these people extract the sms from the handset anyways?

jc_armor
26-09-2003, 12:36 PM
everytime the phone receives an incoming message, you can read the data packet by polling. Here's a sample data packet:

1E C 0 2 0 31 1 8 0 10 2 F 0 7 91 36 19 8 0 10 72 85 7B 0 0 4 0 0 5 C 91 36 19 29 24 82 83 0 0 30 90 30 90 22 71 22 30 23 E8 32 9B FD 6 1 42 0 C0 FC

I used 3310 as my phone, through FBUS. By the way, the problem here is that the inbox is getting full, and i couldn't receive any more messages through polling. What i just did is to read my inbox and delete the message. Hope this helps.

natnat
26-09-2003, 07:47 PM
tsk! tsk! tsk!

i dont understand a bit of what your saying jc. thanks anyways. hope it helped you kikojam.

kikojam
27-09-2003, 06:40 AM
thanks Jc for the reply, but how can you get that data by polling I tried
the Comevent. by receiving data but it doest work kindly check this code.

Private Sub Form_Load()
With MSComm1
.CommPort = 2
.Settings = "115200,n,8,1"
.InBufferSize = 4096
.OutBufferSize = 2048
.RThreshold = 1
.SThreshold = 1
.DTREnable = True
.RTSEnable = False
.PortOpen = True
End With

Private Sub MSComm1_OnComm()
Dim j As String
Select Case MSComm1.CommEvent
' Event messages
Case comEvReceive
j = MSComm1.Input
Text2.Text = get_buf(j)

End Select

do this code might work to get the incoming sms msg or do i have to send something...????

kikojam
27-09-2003, 06:44 AM
everytime the phone receives an incoming message, you can read the data packet by polling. Here's a sample data packet:

1E C 0 2 0 31 1 8 0 10 2 F 0 7 91 36 19 8 0 10 72 85 7B 0 0 4 0 0 5 C 91 36 19 29 24 82 83 0 0 30 90 30 90 22 71 22 30 23 E8 32 9B FD 6 1 42 0 C0 FC

I used 3310 as my phone, through FBUS. By the way, the problem here is that the inbox is getting full, and i couldn't receive any more messages through polling. What i just did is to read my inbox and delete the message. Hope this helps.

pls check my code posted here ??? is this same thing you done in receiving the sms messages you have if not please post it here or email me at jherreria @ubaguio.edu..

jc_armor
29-09-2003, 11:51 AM
ComEvent doesn't trigger using FBUS...Try this code

Private Sub Timer1_Timer()
If CommSMS.PortOpen Then
tmptext = CommSMS.Input
txtResult = txtResult & tmptext
myInput = convertText(tmptext)
Text1 = Text1 & myInput
End If
End Sub
Private Function convertText(ByVal myIn As Variant)
Dim i
For i = 1 To Len(myIn)
convertText = convertText & (Right("00" & Hex(Asc(Mid(myIn, i, 1))), 2) & " ")
Next i

End Function

You need to have a timer object, set the interval to 1, a MSComm object with Rthreshold and Sthreshold set as 0, and settings set as "115200,n,8,1", and a textbox to view the result.

kikojam
29-09-2003, 12:16 PM
ok ill just try this code of yours... thanks alot and more power to you...

kikojam
30-09-2003, 04:14 AM
Hi jc_armor I tried your code but eventually it doest work coz' when i try to run the code you posted, the undetermined hex codes always occupies my inputbuffer so i cannt even check if my message receive if it arrives. can you include the trap procedures for this ... thanks again in advance

jc_armor
30-09-2003, 10:45 AM
you can check if a message arrives if you found the correct sms frame. You should look for this data packet:

1E 0C 00 02 00 3A 01 08 00 10 02 0A 00

where:
1E 0C 00 02 -> sms
00 3A -> length of message
01 08 00 10 02 0A 00 -> sample receive sms header

the only important hex value here is "10" which is the basic frame header of receive sms.

By the way, i forgot to tell you that you need to declare myinput globally.

kikojam
05-11-2003, 08:13 AM
thanks alot Jc_armor for the codes it's been a while since i did'nt reply co'z Im too busy to explore the codes for this and finally got it.. thanks again and more power!!

aussiet68i
05-11-2003, 04:15 PM
If the mbus line is active, any incoming SMS will be put onto the mbus line... Ive attached some captured data. it's pretty straight forward, but ask any qs if u want... We also delete every incoming message after it has been processed so the inbox doesn't overflow.

kikojam
06-11-2003, 04:52 AM
If the mbus line is active, any incoming SMS will be put onto the mbus line... Ive attached some captured data. it's pretty straight forward, but ask any qs if u want... We also delete every incoming message after it has been processed so the inbox doesn't overflow.


do you have any codes for this one... if so.. please kindly post it so we can evaluate what is best on either FBUS or MBUS in acquiring SMS messages from CP.

Bungle
06-11-2003, 09:27 PM
Hi,
Does the message get put on the mbus line without any kind of request from the computer?

And what happens then if the phone recieves a lot of messages at once, including pictures?
Surely the fact that mbus is relatively slow would cause messages to back up on the phone and eventually it would stop sending them?

Sorry bout all the questions, but if it's reliable even when a lot of messages arrive at once it would make writing my app a lot easier!

Bungle

jc_armor
12-11-2003, 10:16 AM
Both MBUS and FBUS lines receives frames when a new message arrives. It's just a matter of fetching it. The advantage of using MBUS (VB), is that once frames are received, the ComEvent is triggered, and not in FBUS. Hope this helps.


Hi,
Does the message get put on the mbus line without any kind of request from the computer?

And what happens then if the phone recieves a lot of messages at once, including pictures?
Surely the fact that mbus is relatively slow would cause messages to back up on the phone and eventually it would stop sending them?

Sorry bout all the questions, but if it's reliable even when a lot of messages arrive at once it would make writing my app a lot easier!

Bungle

Bungle
17-11-2003, 09:20 PM
Both MBUS and FBUS lines receives frames when a new message arrives. It's just a matter of fetching it. The advantage of using MBUS (VB), is that once frames are received, the ComEvent is triggered, and not in FBUS. Hope this helps.

Hi,
Had a play with this for a while and have decided that this doesnt work for a 6310(i), well at least in FBUS mode. Nothing happens on the input of the com port when a message arrived, tried it with both a timer and oncomm. Might work over MBUS, though I cant really use MBUS since its a bit slow esp when dealing with picture messages.

Il just stick to reading the number of unread messages on a timer.

Thanks anyway!