nikalligiannis
Posts: 24
Joined: Fri Aug 25, 2006 3:15 pm
Location: Greece

Reconnect Problem on second run ???

Wed Aug 30, 2006 9:17 pm

Working on the FindandConnect Example for .net cf 2, I came across an annoying problem.

When the app is terminated and restarted there is no data received even though the external device(serialBT) is discovered and its service connected.

The only way to make the serial connection work again is to either
a) reset the ppc machine or
b) turn off and on the bluetooth device from the Ipaq BTconnection Manager.

I suspect this is due to something I am doing wrong in the way I terminate the BlueTools Manager instance.

CLOSE CONNECTION LIKE THIS

Code: Select all

private void closeConnection_Click(object sender, System.EventArgs e)
{
        if(currentService != null)
	{
	  currentStream.Close();
          currentService = null;
	  currentStream = null;
	}
        //data parsing event handler off
        this.BTprotocol.send_BTDataReceived -= new BlueToothSensorProtocol.BTDataReceived(BTprotocol_send_BTDataReceived);
	closeConnection.Enabled = false;
	serviceList.Enabled = true;
	lStatus.Text = "OK";

CLOSE APP LIKE THIS		}
private void MainForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
            this.manager.Dispose();
            Dispose();
}
Is there a standard set of steps that should be followed when ternimating the BlueTools manager instance so that it can be restarted normally.

Can I achieve step b through bluetools SDK functionality.
Thanks.

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Reconnect Problem on second run ???

Wed Aug 30, 2006 9:35 pm

Could you possibly try this on another device?
Cause manager.Dispose() should be enough to clean up the stack. You could also try to close the connection on MainForm_Closing if you are not already doing that.

You cannot turn off the Bluetooth device with BlueTools.

Regards,
Jonas
Franson Support

natgs18
Posts: 3
Joined: Thu Mar 04, 2010 5:30 am

RE: Reconnect Problem on second run ???

Sat Mar 06, 2010 9:23 pm

Hello nikalligiannis,

how did you solve that?

Regards,
n.

Return to “BlueTools”