MTAG11
MTAG11

Reputation: 396

Windows Store Bluetooth

I have been looking through the MSDN docs for Windows Store apps and the only thing I found that was close to Bluetooth was the Windows.Networking.Proximity. This appears to be a class whose use is only for close proximity ie within 3-4 centimeters. The app I am developing is on a HTML5/WinJS platform.

Is there a BluetoothSocket class like there is for android? For those store developers who are not familiar with Bluetooth on android essentially you create a Bluetooth Device member variable and populate that member with the device information, which is a native java call.

That will give you a list of paired devices, and you just open a Bluetooth socket to that device and then its the standard socket operations on a in/outstream for read/write.

Do I need to do the same thing and write a C++/CX version of this and add it as a Windows Component? The key thing here is that the device I'm connecting to treats the Bluetooth as a COM port, so all I need is a stable, reliable way to read/write to this device as if I were connected to a COM port.

Upvotes: 3

Views: 1187

Answers (2)

Dimitry K
Dimitry K

Reputation: 2356

Looks like @JimONeil's answer predates Windows 8.1 and was indeed correct for Windows 8, when the only way to have custom communication with BT device would be to create so called "Device App".

As of Windows 8.1 there is a simplified API which allows for easier (as OP describes "Android style") communication with BT devices.

Here's the quote from MSDN docs for "New Windows 8.1 APIs":

For Windows 8.1, Windows Store apps can use the new RFCOMM and GATT (Generic Attribute Profile) Windows Runtime APIs to access Bluetooth devices. These APIs provide access to the Bluetooth BR/EDR and Bluetooth LE transports.

There're also few good sample projects:

Upvotes: 2

Jim O'Neil
Jim O'Neil

Reputation: 23774

Per this MSDN Forum article, there isn't a generalized Bluetooth stack available for Windows Store applications.

As the thread indicates, there is only a Bluetooth Call Control sample and

If a device manufacturer needs to use Bluetooth as part of their device, they can provide a driver and metadata for a Store app to use it.

Information here:

 http://msdn.microsoft.com/en-us/library/windows/apps/hh464909.aspx

Upvotes: 1

Related Questions