32feet
32feet copied to clipboard
InTheHand.Devices.Bluetooth any complete examples ?
I could find any examples related to the new API
https://archive.codeplex.com/?p=32feet
@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.
😕
The examples are only matching the old API not the new one (32FEET.NET)
https://github.com/inthehand/32feet#downloading
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.
Thanks for the update @peterfoot. I'll keep an eye out for any updates.
Hello, thanks for the package. Is there any update on Unity support? Thanks!
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 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);
});
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
Awesome! Can’t wait to try it in unity! Will make our life so much easier ;)
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?