32feet icon indicating copy to clipboard operation
32feet copied to clipboard

InTheHand.Devices.Bluetooth any complete examples ?

Open pirhano opened this issue 5 years ago • 12 comments

I could find any examples related to the new API

pirhano avatar Jun 26 '19 20:06 pirhano

https://archive.codeplex.com/?p=32feet

Shamalmanoj avatar Aug 08 '19 14:08 Shamalmanoj

@pirhano, I'm also looking at trying to get a working sample up and running, and what I've found in the documentation does not match up with what I'm seeing in the nuget package. It's very confusing.

I'm trying to follow this example on device discovery:

var cli = new BluetoothClient();
BluetoothDeviceInfo[]() peers = cli.DiscoverDevices();
BluetoothDeviceInfo device = null;//= ... select one of peer()...
BluetoothAddress addr = device.DeviceAddress;

But I can't find any of the classes in the nuget package. I can find them in the repository, but it seems to be a completely different API than the one exposed on nuget.

The code looks like exactly what I'm looking for, but I've no idea where the classes are located.

😕

matthewjones555 avatar Aug 15 '19 14:08 matthewjones555

The examples are only matching the old API not the new one (32FEET.NET)

pirhano avatar Aug 27 '19 13:08 pirhano

https://github.com/inthehand/32feet#downloading

pirhano avatar Aug 27 '19 13:08 pirhano

Sorry for the delay on this. I've stopped work on the "new" InTheHand.Devices.Bluetooth API and instead have a new version modelled on the original API but adding .NET Standard support and better support for NuGet, Unity and eventually other platforms. I hope to have the new code merged in soon along with a new v4.0 NuGet package.

peterfoot avatar Nov 14 '19 22:11 peterfoot

Thanks for the update @peterfoot. I'll keep an eye out for any updates.

matthewjones555 avatar Nov 15 '19 10:11 matthewjones555

Hello, thanks for the package. Is there any update on Unity support? Thanks!

tomitrescak avatar Aug 03 '20 04:08 tomitrescak

InTheHand.Net.Bluetooth is out on NuGet. It uses Win32 Socket APIs to get around the issue where Mono Sockets don't allow the Bluetooth namespace/address family. The API is closely modelled on the original 32feet.NET v3.x API with some simplifications.

peterfoot avatar Aug 03 '20 08:08 peterfoot

@peterfoot thanks for your answer! I used the library you recommended, but it does not process LE devices. When I tried to use the LE library in my project it would not compile as it was missing "Windows.Foundation.UniversalApiContract". I really like the BluetoothPicker approach, but unfortunately it only discovers standard BT devices.

This is my code:

var pick = new BluetoothDevicePicker();
pick.PickSingleDeviceAsync().ContinueWith(task =>
{
            var dev = task.Result;
            Debug.Log(dev.DeviceName);
});

tomitrescak avatar Aug 03 '20 23:08 tomitrescak

For Bluetooth LE there is a separate library - InTheHand.BluetoothLE. I need to do a new release and update documentation/samples as it's a completely different API

peterfoot avatar Aug 07 '20 09:08 peterfoot

Awesome! Can’t wait to try it in unity! Will make our life so much easier ;)

tomitrescak avatar Aug 12 '20 09:08 tomitrescak

When i try to connect using IntheHand.net.bluetooth Bluetoothclient. I get an exception. client.BeginConnect(endPoint, new AsyncCallback(ConnectCB), client) I get null reference exception.

What might be causing the exception?

AsfandNadeem avatar Aug 30 '21 11:08 AsfandNadeem