Quantcast
Channel: 32feet.NET
Viewing all 469 articles
Browse latest View live

New Post: Pairing bluetooth thermal printer in windows CE and fX2.0

$
0
0
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 it crash!!!

this is all my code for testing:

List<string> deviceNames;
InTheHand.Net.Sockets.BluetoothDeviceInfo[] devices;
  private void btnSearch_Click(object sender, EventArgs e)
    {
        deviceNames = new List<string>();
        //*** start Scandevices
        InTheHand.Net.Sockets.BluetoothClient btClient = new inTheHand.Net.Sockets.BluetoothClient();   ---> here system CRASH!
        devices = btClient.DiscoverDevicesInRange();
        //*** scan complete

        foreach (InTheHand.Net.Sockets.BluetoothDeviceInfo d in devices)
        {
            deviceNames.Add(d.DeviceName);
        }

        lstBox.DataSource = deviceNames;
    }

crash error is:
could not load type 'System.Runtime.ConstrainedExecution.CriticalFinalizerObject' dall'assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC'.

in which way can I solve this error?

TIA Dario

New Post: PAIR FAILS WITH TOSHIBA EP4DL - GH30

$
0
0
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

Created Unassigned: Connection to a device fails after a resume from suspend [43371]

$
0
0
Hey,

I'm running a WPF application on an MS Surface running Win8 x64 (.NET 4.0). After resuming from a full suspend (not just Connected Standby), client.Connect() starts throwing SocketException no matter if the device is available or not. It won't reconnect. Internally, WSAConnect() fails with return code 0xFFFFFFFF and lastError=10022, which reads "invalid argument was provided". If I close my application and restart it, the connection works immediately.

The connection runs in a background thread, where BluetoothClient attemts to be connected to a specific address, if it fails a SocketException is caught, the client is DISPOSED, recreated after a delay and attempts again.

To attempt to workaround, I've ensured that the client is __closed and disposed on suspend entry__ by catching windows power events, and only resuming polling after the system has resumed. That has not had the expected influence.

I've made an API call dump from suspend entry up to resumed polling using WinAPIOverride64, which is included as an attachement. Note, that the first "closesocket" call is the socket being closed due to a suspend event, then lots of stuff is going on until the latest calls to WSAConnect being the reconnect attempt triggered by BluetoothClient.Connect().

New Post: What i need for RFCOMM connection to a Remote device?

$
0
0
Hi Nico,

I have the exact same requirement as yours, stated "Remote device (Motorola RS507). This device is a "Ringscanner. I want to manage these devices using a C# windows forms application (like add a new scanner, remove a scanner ..)".

Were you been able to get hold of an .NET (c#) app?

Thanks
Sam

New Post: Using a notebook as a remote HID for a PC

$
0
0
Bookmarking in case anyone makes progress on this. It doesn't look too possible for the moment.

New Post: Windows 8.1 (64bit) drops RX Netstream

$
0
0
This is a WPF application.

I have a BluetoothClient connected to a device..
I use cli.GetStream() to get access to the NetworkStream.

I use Async BeginRead and BeginWrite to read and write to the BT stream with blocking.
Everything works great on Windows 10, but on the Windows 8.1 laptop the Read stream stops working (or blocks forever) while the send stream works fine. (I confirmed this using a serial head adapter to the BT device to see what is coming across the BT buffer on the device).

What would cause the Read stream to stop receiving data on Windows 8.1?
Any ideas?

Notes:
  • Lenovo laptop
  • Broadcomm internal BT radio
  • drivers updated to latest (2014)
  • Microsoft stack
    private byte[] ReadStream(int len) {
      byte[] buf = new byte[len];
      int bytesRead = 0;
      ManualResetEvent evt = new ManualResetEvent(false);
      AsyncCallback callback = null;
      NetworkStream stream = m_btClient.GetStream();

      callback = ar => {
        int read = 0;
        try {
          read = m_Stream.EndRead(ar);
          Debug.WriteLine("RX read: " + read);
          bytesRead += read;
        } catch {
          bytesRead = -1;
          evt.Set();
          return;
        }
        if (read == 0) { // Con closed
          bytesRead = -1;
          return;
        }
        if (bytesRead == buf.Length) {
          evt.Set();
          return;
        }
        m_Stream.BeginRead(buf, bytesRead, buf.Length - bytesRead, callback, this);
      };

      IAsyncResult ret = m_Stream.BeginRead(buf, bytesRead, buf.Length - bytesRead, callback, this);
      evt.WaitOne();
      Debug.WriteLine("bytesRead: " + bytesRead);
      return (bytesRead == -1) ? null : buf;
    }

New Post: Windows 8.1 (64bit) drops RX Netstream

$
0
0
Solved. Lenovo uses crap radios :\

New Post: Checking bluetooth disconnection

$
0
0
Hi,

I'm trying to find a way to raise an event when the bluetooth local client is disconnected. I thought BluetoothClient.Connected property was work but it seems not change your status when I interrupt the connection turning off my other device.

Is anyone having the same problem?

Regards,

New Post: BLUETOOTH NOT VISIBLE

$
0
0
After pairing and get the data flow link, step to exchange information. By repeating this process + - ten times is returned an exception that the connection / socket has been lost, then remove the pairing and repeat the process of pairing / connection, to try again to pair the Bluetooth target is not found ... I tried to disable and enable the module in device manager -> radio bluetooth -> in my case "Generic bluetooth adapter" but without success ... so I tried to uninstall the driver and install again and again found the target bluetooth.

This happens in both USB ADAPTER BT and BT ADAPTER integrated into the notebook. Working in C # .NET platform and to control bluetooths adapters use the InTheHand.NET.Bluetooth library, stack mswin (I think) and the target would be a RN-42 module.

Also repeat this process in the ANDROID platform and works perfectly, there is no problem.

The issue is not the code but bluetooth not find anyone else, do the pairing directly by Windows: Device and Printer> Add Device. The code only gets the connection link to work flow:

ep = new BluetoothEndPoint(ClientDeviceInfo.DeviceAddres, BluetoothService.SerialPort); bluetoothClient.Connect(ep); mStream = bluetoothClient.GetStream();

The question would be why the bluetooth not find anyone else after using and why windows loses the connection link with time?

Created Unassigned: Samples will not compile with VS 2015 [43409]

$
0
0
I downloaded and installed 32feet.NET and tried to compile the sample solution with VS 2015 and most of the projects failed to convert hence none of the samples seemed to compile.
Ideas?

New Post: Windows 10 Universal Windows Platform

$
0
0
I am developing an application on Windows 10 using Universal Windows Platform using Visual Studio 2015. Can I use 32feet.NET from my App? Does the library support Windows 10 on phones? Thanks

Created Unassigned: Update Nuget package to 3.7 [43462]

$
0
0
Can you update the Nuget package to the latest 3.7 release (it is now at 3.5)

http://32feet.codeplex.com/releases/view/114325

https://www.nuget.org/packages/32feet.NET

Created Unassigned: Upgradtion BT Stack1.2 to 4.1 [43476]

$
0
0
Hi ,
I have upgraded PC windows Bluetooth stack(BT) from 1.2 to 4.1. BT Pairing is working fine when both PC and devices are of 4.1 type.
But when device is 1.2( 4 digit pin), BT pairing is not happening since pairing concept has changed in 4.1( 6 digit). I need the PC side BT 4.1 to accept 4 digit Pin and pair with BT 1.2 devices.

Please guide me how to resolve above issue and any other approach is also appreciated

New Post: Pairing Issue while upgrading the bluetooth stack 1.2 to 4.1?

$
0
0
Hi ,
I have upgraded PC windows Bluetooth stack(BT) from 1.2 to 4.1. BT Pairing is working fine when both PC and devices are of 4.1 type.
But when device is 1.2( 4 digit pin), BT pairing is not happening since pairing concept has changed in 4.1( 6 digit). I need the PC side BT 4.1 to accept 4 digit Pin and pair with BT 1.2 devices.

Please guide me how to resolve above issue and any other approach is also appreciated

Created Unassigned: cannot retrieve Bluetooth Rssi value (always –2147483648 value) [43480]

$
0
0
Hello everybody,

I'm trying to get the RSSI value of several remote devices connected by bluetooth.

I installed the 32feet.NET "PM> Install-Package 32feet.NET" and i used the BluetoothDeviceInfo class to get remote Bluetooth information (DeviceName, Mac Address, Rssi ...), see below:



public class Device
{
public string DeviceName { get; set; }
public bool Authenticated { get; set; }
public bool Connected { get; set; }
public ushort Nap { get; set; }
public uint Sap { get; set; }
public DateTime LastSeen { get; set; }
public DateTime LastUsed { get; set; }
public bool Remembered { get; set; }
public string MacAddrress { get; set; }
public int rssi { get; set; }

public Device(BluetoothDeviceInfo device_info)
{

this.Authenticated = device_info.Authenticated;
this.Connected = device_info.Connected;
this.DeviceName = device_info.DeviceName;
this.LastSeen = device_info.LastSeen;
this.LastUsed = device_info.LastUsed;
this.Nap = device_info.DeviceAddress.Nap;
this.Sap = device_info.DeviceAddress.Sap;
this.Remembered = device_info.Remembered;
this.MacAddrress = device_info.DeviceAddress.ToString();
this.rssi = device_info.Rssi;

}

All information are well retrieved except Rssi value, I get always the min value of int (–2147483648). after investigation i realize that there are some restrictions to use the library. Below the note of Rssi parameter in the library:

//
// Résumé :
// Returns the signal strength for the Bluetooth connection with the peer device.
// Supports only on some platforms.
//
// Notes :
// Thus there are multiple reasons which this property can return the error
// value (i.e. System.Int32.MinValue).
// On an unsupported platform, e.g. MSFT+Win32, or MSFT+CE/WM on an older version.
// See below. The remote device is not turned-on or in range. See below. On
// Widcomm, there is no connection to the remote device. See below.
// Platform support:
// Does not work on Win32 with the Microsoft Bluetooth stack. That platform
// provide no support for RSSI, please contact Microsoft to complain. Works
// on Windows Mobile 5.0, Windows Embedded CE 6.0, or later versions. Works
// on Widcomm, both platforms. We will not try to connect, see below.
// Finally, to get an RSSI value Bluetooth requires an open connection to the
// peer device. On Widcomm we will not attempt to connect, so the caller must
// ensure that there's a connection -- perhaps it could call InTheHand.Net.Sockets.BluetoothDeviceInfo.GetServiceRecords(System.Guid)
// just before accessing this property. On CE/WM if there is no active connection,
// then we will attempt to create one. This of course can be slow, and will
// be slow if the remote device is not in range. (Bluetooth 2.1 supports getting
// the RSSI value at discovery time which might provide the solution for many
// cases. However only the MSFT+Win32 stack specifically supports v2.1, and
// of course it doesn't support RSSI at all!)
// Note that the Bluetooth specification doesn't require that the radio hardware
// provides any great precision in its RSSI readings. The spec says for instance,
// in v2.1 Volume 2 Part E ("HCI") Section 7.5.4: “Note: how accurate the dB
// values will be depends on the Bluetooth hardware. The only requirements
// for the hardware are that the Bluetooth device is able to tell whether the
// RSSI is inside, above or below the Golden Device Power Range.”

I tested the application under windows 7 64 and windows 8 64 with active connection, i have got always (–2147483648) value despite the platforms seems to be supported!!!

New Post: Win CE 7 OS, Microsoft BT stack, Bluetooth 2.1, Authentication Call back to support Automatically accept the pairing.

$
0
0
Hi everyone,

I am intending to connect a Scanner (without display/keypad) to a device with Win CE 7 OS, Microsoft BT stack, Bluetooth 2.1.

Here I need the connection to happen without any user interaction or Automatically accept the pairing. In Windows 7 this can be achieved by handling in BluetoothWin32Authenticationcallback function by "e.Confirm". I need similar to be implemented in Win CE 7 OS.

Will be very grateful for the guidence.

Thank you.

Created Unassigned: How to clear(flush) the data on Stream [43508]

$
0
0
Dear All

I am developing an application, it deals with a hardware.

Connectivity is happening i am able to send and receive commands to the hardware.

Problem is sometimes my hardware gives acknowledgement and sometimes not, but i need to read when its gives acknowledgement.

if i dint read this acknowledgement at previously mentioned instant, it is affecting in me in my next read by appending with new data.

i am using __Stream.Flush()__ not working for me, i want help to read that inconsistent data or i need to clear(Flush) the data before new read.

Regards
Vinod

New Post: How to use CSR Harmony Stack with IntheHand.net.Bluetooth

$
0
0
When I am creating a client or server I am receiving error platform not supported error . Protocol stack related error

New Post: Struggling with pairing/connecting headset on handheld (winCE)

$
0
0
Hello all,

I'm struggling with pairing a Bluetooth headset and setting appropriate services. For an application (where the users are not supposed to have access to the OS) I'm trying to do is:
  • Find Bluetooth devices
  • pair with selected headset
  • call SetServiceState for services HandsFree and AudioSink
So far, enumerating and pairing of device seems to work, but SetServiceState has no effects, even after restart of handheld device.
First thing I've encountered, the method SetServiceState tries to write some registry entries, for that OpenSubKey is called on HKLM. But as the key that is supposed to be opened is not (yet) existing, the value of enabled=1 is not set.
So to fix that I copied the code from SetServiceState and changed the implementation using CreateSubKey instead of OpenSubKey and did some other modifications.
Now the registry entries looks quite good, but the headset is not properly connected, so even after reboot of handheld device and restart of headset, the audio is not directed to the headset.

I tried to use the OS Bluetooth Settings tool. Doing that the headset is paired and connected successfully (although a restart of the headset seems to be required).

I appreciative any sort of help. What I'm trying to do, is it actually possible?? What is the OS tool doing different, do I miss another API call after SetServiceState?

New Post: could i start a project with 6LoWPAN(which need bluetooth 4.2) using 32feet?

$
0
0
the Microsoft said that Win10 can't support bluetooth 4.2 in their website. But recently I have a project which need the 6LoWPAN to get data from a IoT device.

the question is, the win10 cant support bluetooth 4.2. but in my laptop, the LMP version is 8th which can suitable with bluetooth 4.2.

so what about the 32feet. which level of the communication (such as NETWORK, TRANSPORT, SESSION, PRESENTATION, APPLICAITON)are the 32feet are in? and which level can I change, program or modify in Win10 OS?
Viewing all 469 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>