Does anyone know if it's possible to use Bluetooth to connect to multiple phones using C# Monotouch/Xamarin iOS?
Update
I'd preferably like to connect multiple phones to one main phone
host, all via Bluetooth (1 host and 3 or 4 clients).
I don't know a
great deal about bluetooth and the various profiles, so I'd be
looking for guidance on this aspect also.
Yes, you can.
iOS 7.0 introduced the Multipeer Connectivity framework. It can work with both bluetooth and/or wifi (and can even bridge between them, pretty neat).
You can find sample code (e.g. chat, mixed with iBeacons) by googling around for Multipeer Connectivity, iOS and monotouch.
Related
I wonder if it is possible to discover unpaired Bluetooth devices programmatically within a Windows 10 tablet application.
I really don't want to pair by Settings -> Devices -> Bluetooth.
Unfortunately I couldn't find any documentation/example that would have helped.
I tried to search for Bluetooth devices by using the BluetoothLEAdvertisementWatcher but I wasn't able to find any. Probably because these devices were no BluetoothLE devices. Thought these were compatible.
Also I thought it would be possible to create a CLI/C++ wrapper that I could reuse in my UWP application but I feel very uncertain about that as not the whole (especially the interfacing part of the) Win32 API is re-usable in UWP environment.
At a last option I thought there must be a way to just get the list of devices that Windows generates when entering Settings -> Devices -> Bluetooth and I tried to achieve that by using a DeviceWachter but without success.
Now I am very desperate. For my application it would be horrible to manually pair each and every device before using it. I cannot understand why Microsoft cuts the developers so enormous.
Thanks in advance for your help.
Grace's answer is correct. I tried this sample before but stopped working on it as it expected a Windows Phone instead of a Windows 10 tablet.
Now I extracted the DeviceWatcher part but created the DeviceWatcher with the selector BluetoothDevice.GetDeviceSelectorFromPairingState(false). Only with this selecter the watcher was able to finde unpaired Bluetooth devices.
It also works with:
DeviceInformation.FindAllAsync(BluetoothDevice.GetDeviceSelectorFromPairingState(false))
I wonder if it is possible to discover unpaired Bluetooth devices programmatically within a Windows 10 tablet application.
Yes, it's possible.
I tried to search for Bluetooth devices by using the BluetoothLEAdvertisementWatcher but I wasn't able to find any. Probably because these devices were no BluetoothLE devices.
You used a wrong watcher. What you need is DeviceWatcher, not BluetoothLEAdvertisementWatcher. The difference between them is that the DeviceWatcher is for enumerating devices dynamically, while the BluetoothLEAdvertisementWatcher is for receiving Bluetooth Low Energy (LE) advertisements.
There is an official Device enumeration and pairing sample, you can refer to scenario 8 of this sample, this sample is absolutely what you need.
I think this question has been asked in different forms but there is no clear answer.
I want to be able to discover all available BLE device and connect to any of them. My peripheral device advertises a certain service. I read about 32feet.NET library and tried to use it but apparently it does not support BLE, and the only way I can scan my device through this library is to connect to windows first and then do the discovery.
I also went through this article: Acuire data by C# from BLE but it didn't work for my device and I couldn't do any scanning. I even bought TI BLE dongle and tried their sample app: TI sample app but it didn't work with my peripheral device.
Then I tried to use Windows 8 sample code for BLE Heart-rate app it worked fine with a heart rate BLE sensor, but still I couldn't get it to work with my peripheral device.
I thought there is a problem with my device but there is an app in iPhone called LightBlue which discovers BLE devices and can act as a peripheral device too, I even used that app but couldn't get it to work with Windows.
So my question is, is there any way or library or anything for C# that I can use to scan BLE devices and connect to them and send/received date?
Thanks
I wasn't able to find a library for Windows Form styled programs, however, Universal Windows Apps have the Windows.Devices.Bluetooth namespace which will allow you to do everything you described (it's a little rough around the edges, though).
I am trying to find a sample that connect a Win RT app with other Bluetooth devices for example a PC. It is a basic thing but seems like it is not supported in WinRT.
In one thread a Microsoft employee says
.... Other than the call control sample, there is no Bluetooth stack
available for Store apps...
After reading other similar threads it seems to me that this is not possible at the moment. Am I right or is there any way to connect a Win RT app with some other device like a desktop app on PC via Bluetooth?
After reading many questions and articles (some links are below) on different forums I have reached to conclusion that communication between a Metro Style App and a PC is not possible via Bluetooth. One option is to go with is WiFi.
Some useful links which supports this conclusion are below
http://social.msdn.microsoft.com/Forums/en-US/tailoringappsfordevices/thread/6634240b-c042-4e76-a3b0-1f1103ea0ddf
http://social.msdn.microsoft.com/Forums/en-US/tailoringappsfordevices/thread/0cb2a6c1-d1f1-4872-aa32-709acd90b94d
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/9db327e1-afe4-443b-8856-343492645083/
http://social.msdn.microsoft.com/Forums/en-US/tailoringappsfordevices/thread/172061f4-56ff-4fd2-987d-687d4703506d
The WinRT 8.1 Bluetooth stack provides the requisite services for ad hoc Bluetooth communications with similarly capable devices. More specifically, peer discovery and peer to peer communications is supported.
I want to develop an app, which will be running on tablets with Windows 8 (RT). One tablet with this app should be a "master" tablet and this tablet will communicate with other tablets "slave" (running same app). Master tablet should send data to slaves tablets (slave tablet display this received data) and slaves tablets will send data to master. Master collect this data and create some graph etc... I hope you understand. (resume: several same W8 RT app communication with each other)
Can tablets with W8 RT (running same app) communication WI-FI Direct? What´s possibilities are in C#?
Thx for every answer.
Windows 8 includes a capability to help you establish connections between copies of your app running on different devices. That capability is called PeerFinder.
Currently PeerFinder can find other devices using NFC (tap the two devices together) or using WiFi if both devices support Wifi Direct. After the initial handshake, both devices communicate using sockets.
The Proximity Sample shows basic use of PeerFinder:
http://code.msdn.microsoft.com/windowsapps/Proximity-Sample-88129731
PixPresenter is a sample app that uses PeerFinder and exchanges images between devices:
http://code.msdn.microsoft.com/windowsapps/PixPresenter-Code-sharing-39ed631f
PeerFinder.SupportedDiscoveryTypes tells you what methods are currently available for discovering other devices:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.proximity.peerfinder.supporteddiscoverytypes
Hope that helps.
Dev support, design support and more awesome goodness on the way: http://bit.ly/winappsupport
If it's local network, you can use raw TCP communications and use UDP discovery to identify the master.
If it's a more distributed setup like the internet or separated network areas, I'd recommend you have a look at Microsoft Azure Queue Storage services explained here. This will allow a distributed and redundant master-slave model.
As a complement, if anytime you need to emulate NFC you can use a specific sample driver :
Windows 8.1 : How to use Near-Field Proximity API without NFC hardware
Hope it helps.
Stéphanie
Also, here you will find a WinRT lib that you can use to help you tranfer data/files between Windows 8 peers running the same application, using Wifi-Direct :
http://blogs.msdn.com/b/stephe/archive/2013/12/11/win8-1-transfering-a-file-between-2-peers-using-wifi-direct-and-proximity-api.aspx
Best regards
I need to write a Windows application that accepts connections over Bluetooth SPP - i.e. other devices can see the SPP service and connect there. Tried googling but not much information available - any examples/meaningful docs/pointers out there?
The OS is Windows 7, using native Bluetooth drivers.
The preferred language is C#, but other ideas are welcome as well.
32feet.NET seems the obvious choice? http://32feet.codeplex.com/wikipage?title=Bluetooth%20Server-side
Speaking as its maintainer... :-,)