I've found scatterings around the web but no concise answer. Everyone talks about developing BLE for Android and iOS, but how does one develop for Windows in C# (.NET)?
I've found this
http://social.msdn.microsoft.com/Forums/windowsapps/en-US/2f236b71-a6ac-4c42-aef3-723c3691cbf8/how-to-discover-connectdisconnect-and-reconnect-to-bluetooth-low-energy-device-from-windows-81?forum=wdk
I've tried the C# example, but I don't have any devices with health profiles (and I don't know how to set searching for a generic device). I did try modifying the code but it didn't help
I have a sensor tag and also a generic BLE HM-10 module useful for arduino projects. My iPhone can find both of these devices using the SensorTag application or LightBlue.
I also found this
http://orcs.sebsoft.com/openvision/index.php/8-vision/37-how-to-acquire-data-by-c-from-bluetooth-4-bluetooth-low-energy-ti-ble-keyfob-ti-sensor-tag
I tried starting it up and scanning, but it didn't find any BLE devices. I don't even know if what I'm doing it right.
I have a BT 4.0 USB dongle.
How on earth do I detect a bluetooth device?
Thanks
Here is a two-part blog post about enumerating and configuring BLE devices in Windows 8.1.
BLE for developers in Windows 8.1 Part I
BLE for developers in Windows 8.1 Part II
After reading this, the documentation on MSDN seemed to make a lot more sense.
This is just a guess, but if you're using a generic HM-10 BT module, you might need to program it first to be discoverable and pairable.
You do that using AT commands which you can find in the HM-10 datasheet. The way to send those commands to the module is up to you, you can either use a microcontroller, Arduino for example, or via a serial console.
Related
I need some kind of code sample to make a bluetooth "radar" in Visual Studio Community 2015 with Visual C#. I just need to detect the nearby Bluetooth devices and the transmission signal.
I only get here:
https://msdn.microsoft.com/es-es/library/ff536587(v=vs.85).aspx
Found some old library (32FEET) but outdated.
But not even a single C# example. I need Bluetooth LE but i don't mind just test bluetooth 2.0.
In Java i found bluecode and in Linux bluez libraries.
Edit: for Windows 7
You're question is too broad but I'll answer it anyway.
Since your target is Windows 7, you won't get BLE support out of the box (as it is first introduced in Windows 8.1). You could work around this by talking to the dongle directly (like I do in the open source WinBeacon library) or by using a VM/Raspberry PI that runs Linux with bluez-stack that exposes some kind of Web API you can use.
For detecting BT 2.0 devices, I would recommend the 32feet library as I've used it in the past for detecting and pairing and it just works. When using the Microsoft BT stack, the 32feet library uses the Windows Bluetooth Socket API, which is well documented on MSDN. So if you only want to scan for devices, you might as well directly use the Socket API and use the 32feet source code as inspiration.
Good luck.
First of all, yes, i have read all other similar questions.
Secondly, i am developing app (WP 8.1 WinRT), which must use Beacons. I read a lot about it, and i know, that generally connection with BLE device is not possible without pairing it first. But hope dies last, so i want to ask about any possibilities I have. It is possible to pair devices in code (according to articles I have read - its not, but maybe someone know the way)? Or just obtain nearby Beacons Id or Name, or ANY information about them? All posts i have found are outdated (from last year, maybe MS or somebody released some update/api?) I search for any kind of solution, api or just idea how to avoid pairing problem. Pairing it manually won't work - 1. not sure if it is possible to pair beacons, 2. its too many of them (beacons I need)
I look for anyway to communicate or even obtain beacons.
I would be grateful for any option or idea
While I have not tried it yet, there a developer has built an HCI layer to talk directly to bluetooth dongles on pre-Windows 10 machines. It is available here: WinBeacon
This will only work on desktop machines, and not with mobile phones. If you are interested in mobile phones with Windows 8.x, I do not believe there is any solution. I have spoken with Microsoft engineers who have confirmed this to me.
The fundamental problem with Windows 8.x on mobile devices is that any Bluetooth LE scan operation (which is what must be done to search for beacons) must be initiated by the operating system. There is no public API and no known private API that can be used to initiate a Bluetooth LE scan. Pairing with the device will not help -- it is the scan that is important and iBeacon and similar BLE beacon types do not use pairing at all for their primary proximity detection purpose.
Microsoft engineers have told me there are no plans to add this feature to 8.x, as they want to push folks to Windows 10.
While I know this does not help for Windows 8.x, I will note for the record that for the upcoming Windows 10 release, we are working on a port of the Android Beacon Library to Windows here.
(Note: the following question is about a Intel based full Windows 8 tablet for which the drivers work perfectly for regular Windows Desktop (i. e. non-Metro) applications.)
For Metro applications, there's the generic WinUSB support, but I'm unsure what is needed to use the widely used FTDI driver and f2dx.dll user space handler. Due to the fact that the FTDI chips don't support direct endpoint based communication, but instead impose some additional custom protocol, I cannot simply use the endpoint based WinUSB driver. Would switching to the CDC mode of FTDI work with Metro (essentially, this causes the device to appear as a serial port) ?
This question under electronics seems to say that switching to CDC mode with your FTDI device is not an option, as the CDC mode is not true CDC, but rather a CDC-like implementation.
Unfortunately, I don't have a suggestion yet on what should work - looking into the exact same thing myself.
It seems that there's now an official guide from FTDI regarding this topic: WinRT Guide
Is there a C# library somewhere to read the gyroscope and/or accelerometer from an iPhone or iPad connected to a Windows7 PC via bluetooth? I mean, is this sort of thing even possible?
I've looked at things like MobileDevice.dll, Manzana, and SharePodLib, but at the least those seem to get file data only. Can the orientation data be read somehow (other than with ObjectiveC, Unity, etc.)?
although you should not ask those questions here i do happen to know a great library for cross platform development. Though i do not think it is possible to read accelerometer data from an iPhone trough Bluetooth unless you would write an app that should send this information trough Bluetooth.
The library is called Xamarin and you can actually create an app for android windows phone and ios in C# .net you might want to check it out ;)
I am looking for a Bluetooth stack for C# that will allow me to route audio from my phone to my computer, as well as use my microphone on my computer(Windows 7) as an input device for phone calls on my phone. I've looked at 32Feet.NET, but it does not seem to support audio channels. If I am wrong on this, someone please correct me. Otherwise, if there an alternate library for C# that I can use for Bluetooth support?
I'm afraid this probably doesn't really answer your question, but maybe adds some alternative perspective: The issues you're trying to solve seem to be supported by standard Bluetooth audio profiles. As such, there are chances they're provided by the OS's (or other vendor's) Bluetooth stack in a transparent manner, i.e. as audio device like the system's sound card.
If there is no urgent reason for a custom implementation of these Bluetooth profiles, you might be better off looking for .NET methods that configure the audio devices your code uses for audio input/output. You would then use Bluetooth audio in the same way you access other audio devices, basically reducing your code to proxy audio from one audio device (sound card) to another (Bluetooth audio).