We have an application written in Vb.net running on a Psion WorkaboutPro handheld running under Windows CE4.2. The application issues tourist tickets using a Zebra cameo 2 bluetooth printer. We have just found the InTheHand library and I have set up a small test application based on the code in one of the samples. This finds available devices using the DiscoverDevices method and that works fine. However when we try to call the Connect method we get a socket exception 10061. There are no inner exceptions found. Having had a look on the forums this seems to be caused in some cases by firewalls blocking ports but these devices are not running firewalls.
Our main application currently uses OpenNetCf's serial port driver to talk to the printer which is paired with the Psion. This makes contact and sends data to the printer. That connection is working OK. When the initial test system failed I wondered if the existing pairing was the problem so I disconnected the pairing on the Psion and rebooted the printer software to clear the pairing from that end. But this made no difference. The InTheHand connection still failed with error 10061.
Here is the code being run It is adapted from the sample code so the service name is
Private ServiceName As New Guid("{E075D486-E23D-4887-8AF5-DAA1F6A5B172}")
...
Do
Try
If client Is Nothing Then
client = New BluetoothClient
End If
client.Connect(New BluetoothEndPoint(CType(cboDevices.SelectedItem, BluetoothDeviceInfo).DeviceAddress, ServiceName))
Catch se As SocketException
Me.txtMessages.Text &= ControlChars.CrLf & "Fail " & se.Message
If (CurrentTries >= NumRetries) Then
Throw se
End If
Dim xx As IO.StreamWriter = IO.File.AppendText("BTConnectionErrors.txt")
xx.WriteLine("**" & Now.ToString)
xx.WriteLine(se.Message)
xx.WriteLine("Native error " & se.NativeErrorCode.ToString)
xx.WriteLine("Error code " & se.ErrorCode.ToString)
If Not se.InnerException Is Nothing Then
Dim yy As Exception = se.InnerException
While Not yy Is Nothing
xx.WriteLine("From: " & yy.ToString)
yy = yy.InnerException
End While
Else
xx.WriteLine("No inner exceptions")
End If
xx.Close()
End Try
CurrentTries = CurrentTries + 1
Loop While CurrentTries < NumRetries
Can anyone tell me what else I should be looking at or doing please.
In case anyone is wondering, we are looking for alternative drivers for the printer because the Psion has a Bluetooth 1.1 implementation which cannot be upgraded and in our operating environment in Central London we have a very crowded and hostile telecomms environment and the OpenNetCf implementation keeps losing connection and having to retry several times before it re-connects. So we are interested to see if using the IntheHand library had the same problem.
Thanks