تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
استخدام at command
#2
أصف Serialport  و Textbox لعرض النتائج
صع في خصائص الـــ serialport

Private Sub SerialPort1_DataReceived(sender As Object, e As SerialDataReceivedEventArgs) Handles Serialport1.DataReceived
       ReceivedText(Serialport1.ReadExisting())
   End Sub
   Private Sub ReceivedText(ByVal [text] As String) 'input from ReadExisting
       If Me.TextBox1.InvokeRequired Then
           Dim x As New SetTextCallback(AddressOf ReceivedText)
           Me.Invoke(x, New Object() {(text)})
       Else
           Me.TextBox1.Text &= [text] 'append text
       End If
   End Sub

ثم أضف button وصع الآكشن كالتالي :


On Error Resume Next
       With Serialport1
           .PortName = Comstar.Text
           .BaudRate = 9600
           .Parity = IO.Ports.Parity.None
           .DataBits = 8
           .StopBits = IO.Ports.StopBits.One
           .Handshake = IO.Ports.Handshake.None
           .RtsEnable = True
           .ReceivedBytesThreshold = 100
           .NewLine = vbCr
           .ReadTimeout = 100000
           .Open()
           Console.WriteLine("Open the serial port.")
       End With
       ' Send USSD Command
       Serialport1.Write("ATDT," & Chr(34) & "*100#" & Chr(34) & ",15" + Chr(13))



       Console.WriteLine("Read the OK response data in the serial port.")
       Serialport1.Encoding.GetDecoder()
       If Serialport1.ReadExisting = "OK" Then
           Serialport1.NewLine = "1"




       End If
       ' Response should be OK

       Dim strResponse2 As String
       strResponse2 = Serialport1.ReadExisting.Length
       ' Wait for response

ستعرض الشبكة لك خيارات يمكنك الرد بالتالي :


' Send réponse 2
       Serialport1.newline = "ATDT" & Chr(34) & "*100#" & Chr(34) & ",15" + Chr(13)



       Console.WriteLine("Read the OK response data in the serial port.")
       Serialport1.Encoding.GetDecoder()
       If Serialport1.ReadExisting = "OK" Then
           Serialport1.NewLine = "1"




       End If
       ' Response should be OK

       Dim strResponse2 As String
       strResponse2 = Serialport1.ReadExisting.Length
       ' Wait for response

ملاحظة : Comstar.Text هي Combox ويجب أن تضع كود الخاص بإضافة كل البورت المفتوح لها
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
استخدام at command - بواسطة menams3 - 19-10-13, 12:19 AM
RE: استخدام at command - بواسطة Seif17 - 13-11-14, 01:47 PM
RE: استخدام at command - بواسطة كرار العامري - 03-02-15, 09:57 AM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
Question [سؤال] مشكلة إستقبال رسائل باللغة العربية AT Command ؟ a.amin 4 7,291 09-11-22, 01:42 AM
آخر رد: ADAM12
Video [مشروع] استخدام الموديول ESP8266 كخادم بغرض التحكم بالاجهزة الإلكترونية عبر الجوال والحاسوب. yasir_faur 0 2,934 02-11-16, 12:53 PM
آخر رد: yasir_faur

التنقل السريع :


يقوم بقرائة الموضوع: