Hi,
I have a problem i want to connect my PPC (wm5) to a bluetooth and have done it so far so god, but i need to close de connection form 5 min and start it again automatic (beacuse i want to connect other device in the time with the BT) i have wrote this simple code for testing conection and disconection but the PPC freezes !! (on wm5 and 6 ) and a have to switch off the PPC. Can you experts tell me how can i open the serial port and after 5min close it automatic ( with out the need of pressing some bottun) ?
Thanks,
Sub Globals
End Sub
Sub App_Start
Form1.Show
Form1.Show
serial.New1
serial.CommPort = 8
serial.BitRate = 9600
serial.PortOpen = False
serial.EnableOnComm = True
End Sub
Sub Serial_OnCom
TextBox1.Text = TextBox1.Text & serial.InputString
End Sub
Sub Button3_Click
If serial.PortOpen = False Then
serial.CommPort = 8
serial.BitRate = 9600
serial.PortOpen = True
Sleep (1000) ' for BT conection
serial.Output="HI"
Sleep(1000)
serial.PortOpen = False
End If
End Sub
Sub btnReceive_Click
If serial.PortOpen = True Then TextBox1.Text = TextBox1.Text & serial.InputString
End Sub
Sub btnSend_Click
If serial.PortOpen = True Then serial.Output(textBox1.Text)
End Sub
Sub Button5_Click
AppClose
End Sub