Pengaturan

Gambar

Lainnya

Tentang KASKUS

Pusat Bantuan

Hubungi Kami

KASKUS Plus

© 2024 KASKUS, PT Darta Media Indonesia. All rights reserved

AthasamidAvatar border
TS
Athasamid
[Help] Send, Receive sms dengan AT Command
Permisi master, ane mau nanya ane mau coba buat sms gateway. ane pake at command, untuk ngirim udah suksess, tp untuk menerima sms belum bisa -_-
help me master

ini sourcenya :
Code:
Option Explicit
'////
'Credit to Sir Emond Sabiniano.. thanks sir Because of this sourcecode,I completed my SMS /:)/
'/////
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Const SBBOTTOM As Long = 7
Private Const WMVSCROLL As Long = &H115
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef IParam As Any) As Long

Public Sub ScrollToBottom(ByVal hWnd As Long)
SendMessage hWnd, WMVSCROLL, SBBOTTOM, ByVal 0&
End Sub


Private Sub Command2_Click()
RecivedSms
End Sub

Private Sub Form_Load()

'MSComm1.Settings = "460800,n,8,1" 'Change this with the Baud rate of your modem (The one you use with Hyper Terminal)
'MSComm1.CommPort = 10 ' Change this with the port your Modem is attached,(eg bluetooth)
'MSComm1.PortOpen = True

With MSComm1
.CommPort = 15
.Settings = "9600,N,8,1"
.Handshaking = comRTS
.RTSEnable = True
.DTREnable = True
.RThreshold = 1
.SThreshold = 1
.InputMode = comInputModeText
.InputLen = 0
.PortOpen = True 'must be the last
End With

End Sub

Private Sub Command1_Click()
' Send an 'AT' command to the phone
MSComm1.Output = "AT" & vbCrLf
Sleep 500
MSComm1.Output = "AT+CMGF=1" & vbCrLf 'This line can be removed if your modem will always be in Text Mode...
Sleep 500
MSComm1.Output = "AT+CMGS=" & Chr(34) & TxtNumber.Text & Chr(34) & vbCrLf 'Replace this with your mobile Phone's No.
Sleep 1000
MSComm1.Output = TxtMessage.Text & Chr(26)
Sleep 2000

MsgBox "Message Send"


End Sub



Private Sub Form_Resize()
List1.Width = Me.Width

End Sub

Private Sub MSComm1_OnComm()
Me.List1.AddItem ("Send : " & MSComm1.Input)
'Me.List1.AddItem MSComm1.Output
ScrollToBottom List1.hWnd
End Sub

Public Sub RecivedSms()
Dim STR As String
Dim cmd, log_str As String
Dim lines() As String, i As Integer
Dim str1 As String
Dim str2 As String
Dim msgno, mobile, msgrecived As String
Dim j As Integer

cmd = "AT+CMGL=" & Chr(34) & "ALL" & Chr(34)
MSComm1.Output = "AT" & vbCrLf 'errornya di sini master, tulisannya miss match
Sleep 500
'MSComm1.OutBufferCount = cmd
'Sleep 1500


'List1.AddItem STR
'txtweight.Text = STR

End Sub

Private Sub Timer1_Timer()
RecivedSms
End Sub
0
1.4K
8
GuestAvatar border
Guest
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru
Mari bergabung, dapatkan informasi dan teman baru!
Programmer Forum
Programmer ForumKASKUS Official
20.2KThread4.3KAnggota
Terlama
GuestAvatar border
Guest
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru
Ikuti KASKUS di
© 2023 KASKUS, PT Darta Media Indonesia. All rights reserved.