PAIR FAILS WITH TOSHIBA EP4DL - GH30

Topics: Bluetooth - Widcomm/Broadcom
Mar 11, 2016 at 5:07 PM
Hi all,
I'm newbie with Bluetooth and I'm going to discover info all over the web.
I've found 32feet (version 3.4) and in the tutorial (youtube) it seems to be what I need.
I've written the code like the video... but when I try to pair it always fails.

printer : TOSHIBA EP4DL - BLUETOOTH

this is all my code for testing:


BluetoothDeviceInfo deviceInfo;
List<string> deviceNames;
InTheHand.Net.Sockets.BluetoothDeviceInfo[] devices; 

private void btnSearch_Click(object sender, EventArgs e)
{
    lblStatus.Text = "Scanning devices...";
    lblStatus.Refresh();
    deviceNames = new List<string>();
    //*** start Scandevices
    InTheHand.Net.Sockets.BluetoothClient btClient = new InTheHand.Net.Sockets.BluetoothClient();
    devices = btClient.DiscoverDevicesInRange();
    //*** scan complete
    lblStatus.Text = "Scan complete";
    lblStatus.Refresh();

    foreach (InTheHand.Net.Sockets.BluetoothDeviceInfo d in devices)
    {
        if (d.ClassOfDevice.ToString() == "680")
        {
            deviceInfo = d;
            deviceNames.Add(d.DeviceName.ToString());
        }
    }

    lstBox.DataSource = deviceNames;
    lstBox.Refresh();

    lblStatus.Text = "";
    lblStatus.Refresh();

    if (lstBox.Items.Count == 1)
    { 
      // forzo il pair 
        if (pairDevice())
        {
            lblStatus.Text = "Pair complete";
        }
        else
        {
            lblStatus.Text = "Pair error";
        }
        lblStatus.Refresh();
    }

}


private bool pairDevice()
{
    if (!deviceInfo.Authenticated)
    {
        if (!BluetoothSecurity.PairRequest(deviceInfo.DeviceAddress, ""))
        {
            return false;
        }
    }
    return true;
}
with my laptop I connect to the printer without PIN ... (empty)

in which way can I solve this trouble to make the software works?

TIA Dario