6
Fala galera!
I’m trying to show a SMS received in a text box in a Form that I have, but instead of showing me the message that I get in my SIM, it shows something like +CMTI: "ME",33. I’ll leave the code I have down:
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO.Ports
Imports System.Text
Public Class Form1
Dim inputData As String = ""
Public Event DataReceived As IO.Ports.SerialDataReceivedEventHandler
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
SerialPort1.PortName = "COM5"
SerialPort1.BaudRate = 9600
SerialPort1.Parity = Parity.None
SerialPort1.DataBits = 0
SerialPort1.StopBits = StopBits.One
SerialPort1.Handshake = Handshake.None
SerialPort1.RtsEnable = True
SerialPort1.Open()
End Sub
Private Sub SerialPort1_DataReceived(sender As Object, e As SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
inputData = SerialPort1.ReadExisting()
Me.Invoke(New EventHandler(AddressOf DoUpdate))
End Sub
Public Sub DoUpdate()
TextBox1.Text = TextBox1.Text & inputData
End Sub
End Class
Can someone give me a help how to show the message in the call Plain text and not as it is showing?
NOTE: Both Portname and the rest are correct
What have you got in
inputData
on the lineinputData = SerialPort1.ReadExisting()
?– Thiago Lunardi
Readexisting receives the last message that arrived, in my case, when I send an SMS Readexisting will store that message
– FábioArsénio
Yes, and what it returns and stores in
inputData
?– Thiago Lunardi
What API are you using to forward/receive these messages ?
– CypherPotato