Hi, all!
Im trying to bulid the connection between Pocket PC and a certain Bluetooth device. I've tried to use the Outbound COM port, in my case is COM8, to let the Pocket PC as a server. i've received the build in pair request from the bluetooth device. And seems the data does transmitted. but I encountered the problem that, after i choose the desired device, got error shows COM8 does not exist.
the code i wrote is like,
Imports System.IO
Public Class Form1
Dim ReadData
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If SerialPort1.IsOpen Then
SerialPort1.Close()
End If
SerialPort1.PortName = "COM8" 'Outbound Com port in Pocket PC
SerialPort1.BaudRate = 38400 'Needed for the bluetooth device
SerialPort1.Parity = IO.Ports.Parity.None
SerialPort1.DataBits = 8
SerialPort1.StopBits = IO.Ports.StopBits.One
SerialPort1.RtsEnable = True
SerialPort1.RtsEnable = True
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If SerialPort1.IsOpen Then
Else
SerialPort1.Open()
End If
ReadData = SerialPort1.ReadExisting
TextBox1.Text = ReadData
End Sub
End Class
i heard that the 1st thing need to make sure is the bluetooth device have smth like 'out going serial port'. is that the problem?
Can anyone help me with this?
Thanks in advance!