Hi...
I'm having some problem with wclClient...
It keeps disconnecting from the phone .. I would like it to stay connected as long as the phone is nearby
I'm new on this, both Visual Basic and wcl .NET
My code looks like this
Private Sub StartMonitorClient()
If clbCallerID.CheckedIndices.Count Then
WclClient.ClientTransport = WCLX.wclClientTransportx.ctBluetooth
WclClient.BluetoothParams.Radio = Radio
WclClient.BluetoothParams.Address = clbCallerID.SelectedItem.ToString
WclClient.Open()
TClient.Enabled = True
Else
MsgBox("Choose a device to connect to")
End If
Private Sub TClient_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TClient.Tick
If WclClient.Connected Then
TClient.Enabled = False
WriteToLog("Connected wclClient")
Dim Coder As Encoding = Encoding.ASCII
Dim Buf() As Byte = Coder.GetBytes("AT+CLIP=1" + vbCrLf)
WclClient.Write(Buf)
Buf = Nothing
Coder = Nothing
WriteToLog("Sent AT+CLIP=1 to wclClient")
ClientConnect = True
End If
Private Sub wclClient_Disconnect(ByVal sender As Object, ByVal e As System.EventArgs) Handles WclClient.Disconnect
laClientSignal.Text = "Signal Level: Not Connected"
If ClientConnect = False Then WriteToLog("Connection to wclClient terminated by user")
If ClientConnect = True Then
TClientReConnect.Enabled = True
WriteToLog("Connection lost to wclClient")
End If
Private Sub TClientReConnect_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TClientReConnect.Tick
If Not WclClient.Connected And ClientConnect = True Then
Try
WclClient.Open()
Catch ex As Exception
End Try
End If
If WclClient.Connected And ClientConnect = True Then
TClientReConnect.Enabled = False
WriteToLog("Reconnected to wclClient")
Dim Coder As Encoding = Encoding.ASCII
Dim Buf() As Byte = Coder.GetBytes("AT+CLIP=1" + vbCrLf)
WclClient.Write(Buf)
Buf = Nothing
Coder = Nothing
WriteToLog("Sent AT+CLIP=1 to wclClient after Reconnecting")
ClientConnect = True
End If
End Sub
I made a log of the actions ...
1 Connected wclClient 2008-5-24 09:12:35
2 Sent AT+CLIP=1 to wclClient 2008-5-24 09:12:35
3 Connection lost to wclClient 2008-5-24 09:46:36
4 Reconnected to wclClient 2008-5-24 09:46:38
5 Sent AT+CLIP=1 to wclClient after Reconnecting 2008-5-24 09:46:39
6 Connection lost to wclClient 2008-5-24 10:22:39
7 Reconnected to wclClient 2008-5-24 10:22:44
8 Sent AT+CLIP=1 to wclClient after Reconnecting 2008-5-24 10:22:44
9 Connection lost to wclClient 2008-5-24 10:43:43
10 Reconnected to wclClient 2008-5-24 10:43:49
11 Sent AT+CLIP=1 to wclClient after Reconnecting 2008-5-24 10:43:50
12 Connection lost to wclClient 2008-5-24 11:12:54
2008-05-24 11:12:54
An unhandled win32 exception accurred in BTstackServer.exe[3292]
Unhandled exception at 0x0046baa1 in BTStackServer.exe: 0xC0000005: Access violation reading location 0x20705539.
13 Connected wclClient 2008-5-24 11:39:28
14 Sent AT+CLIP=1 to wclClient 2008-5-24 11:39:28
15 Connection lost to wclClient 2008-5-24 12:00:28
16 Reconnected to wclClient 2008-5-24 12:00:33
17 Sent AT+CLIP=1 to wclClient after Reconnecting 2008-5-24 12:00:33
18 Connection lost to wclClient 2008-5-24 12:21:32
19 Reconnected to wclClient 2008-5-24 12:21:38
20 Sent AT+CLIP=1 to wclClient after Reconnecting 2008-5-24 12:21:38
21 Connection lost to wclClient 2008-5-24 12:42:37
22 Reconnected to wclClient 2008-5-24 12:42:42
23 Sent AT+CLIP=1 to wclClient after Reconnecting 2008-5-24 12:42:42
24 Connection lost to wclClient 2008-5-24 13:03:41
25 Reconnected to wclClient 2008-5-24 13:03:47
26 Sent AT+CLIP=1 to wclClient after Reconnecting 2008-5-24 13:03:47
27 Connection lost to wclClient 2008-5-24 13:24:48
28 Reconnected to wclClient 2008-5-24 13:24:53
29 Sent AT+CLIP=1 to wclClient after Reconnecting 2008-5-24 13:24:53
30 Connection lost to wclClient 2008-5-24 13:45:52
31 Reconnected to wclClient 2008-5-24 13:45:58
32 Sent AT+CLIP=1 to wclClient after Reconnecting 2008-5-24 13:45:58
33 Connection lost to wclClient 2008-5-24 14:07:59
And so on ....
It's strange because it's always about 20min apart...
And the thing at 11:12:54, maybe something else, but it happened when i did the log...
I hope we can solve this ...
And one other thing....
How do I use the ClassOfDevice code???
Like I said I'm a newbee
Thanx!