Hi Alan,
Thanks for your replay,i tried that method for first time it will call call back event second time it will will not call the call back event.
if my Bluetooth version of the Pc with windows 7/xp is 3.0 means i need to bypass the paring and i want connect direct from Pc to Remote device.
Please find the sample below
Connect(string sDeviceAddress )
{
Bluetoothclient m_oBTConnector = new Bluetoothclient ();
Guid spguid = BluetoothService.SerialPort;
m_oBTAddress = BluetoothAddress.Parse ( sDeviceAddress );
m_oEndPoint = new BluetoothEndPoint ( m_oBTAddress, spguid );
BluetoothWin32Authentication
oBluetoothWin32Authentication
= new BluetoothWin32Authentication(Win32AuthCallbackHandler);
m_oBTConnector.Connect(m_oEndPoint); //here i will get a exception "A socket operation was attempted to an unreachable network"
}
public void Win32AuthCallbackHandler(object sender, InTheHand.Net.Bluetooth.BluetoothWin32AuthenticationEventArgs e)
{
// Note we assume here that 'Legacy' pairing is being used,
// and thus we only set the Pin property!
string address = e.Device.DeviceAddress.ToString();
Console.WriteLine("Received an authentication request from address " + address);
//
// compare the first 8 hex numbers, this is just a special case because in the
// used scenario the model of the devices can be identified by the first 8 hex
// numbers, the last 4 numbers being the device specific part.
if (address.Substring(0, 8).Equals("098678j") || address.Substring(0, 8).Equals("0099880E"))
{
// send authentication response
e.Pin = "0000";
}
else if ((address.Substring(0, 8).Equals("00997788")))
{
// send authentication response
e.Pin = "0000";
}
}
Regards
Happy new Year in Advance