Welcome to the Windows Bluetooth Core Team blog!


Bluetooth is powering new innovations in wireless connectivity across computers, smart devices, and the Internet-of-Things. Besides being the input of choice for the new Surface accessories such as mice, keyboards, Surface Pen, and Surface Dial, it's become the preferred protocol for wearables and health monitoring systems like Fitbit and Garmin. Because of Bluetooth, a Jabra Sport Pulse headphone can stream music to power your workout, while simultaneously transferring your heart rate data to your smartphone. Bluetooth also makes it easy to track products on a shop floor. Finally, Bluetooth flagship applications, audio and automotive, are two key areas where it continues to innovate: from truly wireless earbuds with great battery life, to using Cortana's voice for map navigation, Bluetooth cannot be beat!

Hi, I'm Aruna, a new PM on the Bluetooth team, helping our dev community enable great Bluetooth experiences on Windows!

Check out our January blog post about our much anticipated release of new Bluetooth features in our Windows 10 Creators Update! Not only did we make improvements to our GATT server, and LE device connectivity, we also improved Bluetooth audio functionality. Now, your Skype audio will sound much better over Bluetooth!

As a part of that, we're excited to present our three-part video series* for Microsoft Build 2017. Our videos dive deep into:

* The BTVS sniffer tool, shown in the videos, is still work in progress. We'll keep you updated on its release timeline.

Other Microsoft Build 2017 sessions are available on Channel 9.

To learn more about our work in Bluetooth BR/EDR and LE, check out these links:

Update on 08/21/2017:

We've open sourced our app! Please check out our new blog post for more details!

If you have any questions, or would like us to discuss more about any of the topics in this post, please let us know in the comments below!


Comments (37)

  1. Andre Marschalek says:

    i miss the link to source code of Bluetooth LE Explorer ?

    1. Aruna [MSFT] says:

      Hi Andre,
      We’re making some improvements to the LE Explorer app. We’ll keep you posted on its release timeline.

      1. Cory Kroll says:

        Any new updates on this? I can connect successfully to my device with the app, and the app source would be extremely useful. I’d even take a code drop of whatever you’ve got right now, even if it isn’t the final source you intend to publish. Thank you!

        1. Aruna [MSFT] says:

          Hi Cory,
          We are still on our way to open sourcing the LE Explorer app. In the meanwhile, please take a look at the BluetoothLEHelper module which is a part of the newly released open-sourced UWP toolkit version 1.5. This module is made from the core engine of the Bluetooth LE Explorer app. Here is more information: https://blogs.msdn.microsoft.com/btblog/2017/07/07/introducing-bluetoothlehelper/
          Thanks,
          Aruna.

  2. Joben says:

    I’m having problems with responding to read requests with an UWP application that acts as Bluetooth LE peripheral.
    http://stackoverflow.com/questions/43776554/how-to-respond-to-bluetooth-le-characteristic-read-request-in-uwp-application

    I couldn’t see in the videos how you did to respond to the read request.

    A working sample source code, like the Bluetooth LE Explorer app would have been nice as there isn’t much documentation for the new features.

      1. Looking at the Stack Overflow question, it looks like your code snippet is based on an outdated, incorrect snippet that was online. We’ve since updated it — sorry for the confusion.

        You need to make sure you take the deferral for the request. This is due to the Async operation that happens in the callback.


        var deferral = args.GetDeferral();
        var request = args.GetRequestAsync(); // In a foreground app, this should be called on the UX thread if the request is from a paired device and it's the first time it's been used.
        ...
        request.ResponWithValue();
        deferral.Complete();

        1. Joben says:

          Thanks a lot for the reply, now I got it working!

          But the documentation where I got the snippet from still has the old code.
          https://docs.microsoft.com/en-us/windows/uwp/devices-sensors/gatt-server

        2. Greg says:

          I have created a sample UWP to run on a pi3. I followed Aruna’s document link and examples shown in the channel 9 part 3 video, but I cannot get the read handler to return anything to the LE Exporer except Exception! A sample server code app would be awesome if someone could publish one.

          1. Greg says:

            Nevermind, I have been staring at it too long, just need to return a writer.WriteBytes() rather that a writer.WriteInt16().

  3. Jack says:

    I didn’t hear an explanation from the Built videos that what enables the “Virtual Peripheral” feature in the LE explorer app? specific bluetooth devices in the host?

    1. Aruna [MSFT] says:

      Hi Jack,
      The virtual peripheral option would be automatically enabled in the app if the Bluetooth chipset in the device supports BLE peripheral role.
      Developers can discover which device radio can support this feature through the BluetoothAdapter.IsPeripheralRoleSupported API at runtime.

  4. Amanda says:

    i miss the link to source code of connect to an unpaired Bluetooth peripheral ?

    1. Aruna [MSFT] says:

      Hi Amanda,
      We shall be open-sourcing our LE Explorer app code soon. In the meanwhile, please take a look at the BluetoothLEHelper module, which is a part of the newly released open-sourced UWP toolkit version 1.5. This module uses the core engine from the LEExplorer app. Here is more information: https://blogs.msdn.microsoft.com/btblog/2017/07/07/introducing-bluetoothlehelper/
      Thanks,
      Aruna.

  5. Cory Kroll says:

    Aruma,

    I’ve downloaded and run the UWP Toolkit. It worked well, but my issue is something not covered in the module. Maybe you could help me?

    I’m trying to listen for changed values in a characteristic that has a Notify Property.
    I can successfully get the characteristic (_rcCharacteristic) and I’m trying to receive events:

    // Set up an event listener
    _rxCharacteristic.ValueChanged += _rxCharacteristic_ValueChanged;

    // Subscribe to notifications of data changes from the GATT characteristic
    Task gattCommunicationStatusTask = _rxCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue.Notify).AsTask();
    if (gattCommunicationStatusTask.Wait(CONNECT_READSYNC_TIMEOUT) == false) return;
    GattCommunicationStatus gattCommunicationStatus = gattCommunicationStatusTask.Result;
    if (gattCommunicationStatus != GattCommunicationStatus.Success) return;

    This all works, and gattCommunicationStatus == GattCommunicationStatus.Success, yet the event never fires.
    In the BluetoothLE Explorer, I can switch on the Notify switch and data flows through just fine.
    Additionally, if I loop the following code, I do get different data coming, so I know it is changing:

    // Read latest value
    Task gattReadResultTask = _rxCharacteristic.ReadValueAsync(BluetoothCacheMode.Uncached).AsTask();
    if (gattReadResultTask.Wait(READSYNC_TIMEOUT) == false) return;
    GattReadResult gattReadResult = gattReadResultTask.Result;

    Any help you could give me would be greatly appreciated. Thank you!

    1. drache42 says:

      Hi,
      What are you using for your server and are you sure it’s sending out notifications?

      1. Cory Kroll says:

        I’m pretty sure it is sending out notifications, based on what I am seeing with the Bluetooth LE Explorer app. Here is what I am doing:
        – Open Bluetooth LE Explorer app
        – Click the Start button
        – Click the hardware device that is found (it’s in a blue tile)
        – Service Names and Characteristics for the device are shown. I click the characteristic I’d like from the list.
        – I am presented with a Characteristics page. Read Value has a value in it. It has a gray background. It is not changing. A Notify On/Off toggle is shown with an Off setting
        – I toggle the Notify property to On
        – The Read Value begins to change, and keeps changing

        I am assuming that this Read Value is being updated by a ValueChanged trigger based on this characteristic.
        But I can’t get the same behavior to occur based on the code I’ve supplied, so I’m assuming what I’m doing is different than the source code behind how this app is working. I’m trying to understand the difference.

        Thanks so much for your replies and help so far. I’m hoping this is just some really simple adjustment to make this all work.

        1. drache42 says:

          That should work. Without debugging the code further I don’t see what’s wrong by just looking at some code snippets. Sorry.

          You could try looking at our UWP samples (https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLEClient) and see if that works. If it does, then you can debug your code to see what’s missing.

          I hope that helps.

  6. Hello I have been working on the application, works very well, but I have some questions:
    1.- How do I disconnect from a BLE device? I’ve tried bluetoothLeDevice?.Dispose(); then bluetoothLeDevice = null; but it doesn’t disconnect. i have to close the program to disconnect.
    2.- How do I clear the cache from the Discovered devices? if i enumerate and there was a device, then i enumerate again but the device is off it still shows the device, this happens even when closing the application, the only way to clear it is by removing the USB dongle.
    3.- Is it possible to connect to more than one BLE device? if so how?

    Thanks and Best regards.

    1. drache42 says:

      1. There is no way to disconnect. The OS will handle that for you. The reason for this is that application doesn’t know who else is using the device so it may inadvertently disconnect while another application is using it. The OS will handle the disconnect when no more activity is happening.

      2. We had an issue with this in earlier version of Windows. Bluetooth LE Explorer on the latest insider build should not show stale devices.

      3. Yes. There is nothing that stops anyone from connecting to more than 1 device. You connect to the 2nd device just like the first. There is no difference.

      1. Thanks for the clarifications!

      2. bobwhitten says:

        You mention that there is no way to disconnect, that the OS will handle that. Are there any details available on when it will release the connection? In my application, the module I am connecting to does not show available to other devices after my app is done with it until the app closes. This is the same behavior as the Bluetooth LE Explorer. But I expect my users will find this problematic. I noticed that when I force a suspend it does release it. Is there any other way? Any way to temporarily suspend an app from the code?

        1. Aruna [MSFT] says:

          As it stands today, if an app is “using” the device (has a resource open to it like GattDeviceService or BluetoothLEDevice), we will stay connected unless the remote device disconnects from us – having the resources open is considered in use. In general, an app must call Dispose on all GattDeviceServices and BluetoothLEDevices it has acquired. In addition, if they are using the GattSession it must also be destroyed. The Dispose/IClosable pattern is seen commonly across the UWP world.

  7. etrbet says:

    Hi I develop windows forms app with C# and I wanna get Bluetooth LE devices and connect and write and read data. What can I do for that? Any sample code or Api?

    1. Aruna [MSFT] says:

      We are very close to open sourcing the LE Explorer app. In the meanwhile, please take a look at the BluetoothLEHelper module which is a part of the newly released open-sourced UWP toolkit version 1.5. This module is made from the core engine of the Bluetooth LE Explorer app. Here is more information: https://blogs.msdn.microsoft.com/btblog/2017/07/07/introducing-bluetoothlehelper/
      Thanks,
      Aruna.

  8. Thierry says:

    Since a recent installation of an insider build, 16278, I am no more able to get fresh data from my BLE device.
    This line make systematically an exception :
    GattReadResult result = await Characteristic.ReadValueAsync(BluetoothCacheMode.Uncached);
    The Cached value do not an exception.
    the PC does not connect to the device.

    1. drache42 says:

      What exception is being thrown?

      1. Thierry says:

        Exception levée : ‘System.NullReferenceException’ dans App2.exe

        1. Aruna [MSFT] says:

          Hi Thierry,
          To help us investigate this issue, could you please gather Bluetooth traces and send them to us through Feedback hub?
          Here are the instructions to submit a Feedback Hub report to reproduce the issue and collect Bluetooth logs:

          1. Search for “Feedback Hub” in Cortana search, then launch the app.
          2. Navigate to Feedback in the left menu, then press + “Add new feedback”.
          3. Select the Problem button, share any details you think are relevant, and choose an appropriate category and subcategory. (For proper Bluetooth logs to be captured it must be one of the Bluetooth context paths, e.g. Hardware, Devices, and Drivers -> Bluetooth – Discovery, Pairing, and Connectivity)
          4. Fill out the summary and the details with relevant information, including basic scenario and what’s failing, host and device make and model.
          5. Select “Start capture” link or “Begin montoring” near the end of the form.
          6. Toggle the Bluetooth radio OFF-then-ON via the quick action menu or force a power cycle of the remote device (we want the connection information).
          7. Reproduce the Bluetooth issues you’re facing.
          8. Select the “Stop capture” or “Stop monitoring” link when done.
          9. Click Continue using Feedback Hub.
          10. Click My feedback at the top, then find the item you submitted (it may take a while to appear).
          11. Open the item you submitted, then click Share.
          12. Click Copy link, then paste the link here in your response. (It will look like https://aka.ms/.)

          Thanks,
          Aruna.

          1. Thierry says:

            In fact I suspect that the old way to get data when the device is already added as a Bluetooth device to the PC does not work anymore and that I have to switch to your new way without declaring the Bluetooth device , but it is more complex .
            With the previous version of windows I used this to get a list of devices :
            var str = BluetoothLEDevice.GetDeviceSelector();
            devices = await DeviceInformation.FindAllAsync(str);
            Then I search which device has the good name to get its id.
            foreach (var d in devices)
            {
            if ((d.Name == NAME)) { device = d; break; }
            }
            Then I access to the device to get the service I want (I know its id)
            var ble = await BluetoothLEDevice.FromIdAsync(device.Id);
            var service = ble.GetGattService(new Guid(“0000180f-0000-1000-8000-00805f9b34fb”));
            Then I get the characteristics (I know its id)
            GattCharacteristic battery = service.GetCharacteristics(new Guid(“00002A19-0000-1000-8000-00805f9b34fb”))[0];
            Then the last step create the exception :
            gattRead = await battery.ReadValueAsync(BluetoothCacheMode.Uncached);

            I can change my way, and do not add the device to the list of the bluetooh devices.
            I have tried to understand your Bluetooth LE sample code
            But when I open it in visual studio I have a lot of errors like this one
            Gravité Code Description Projet Fichier Ligne État de la suppression
            Erreur CS0246 Le nom de type ou d’espace de noms ‘System’ est introuvable (vous manque-t-il une directive using ou une référence d’assembly ?) GattHelper C:\Users\Thierry\Downloads\BluetoothLEExplorer-master\BluetoothLEExplorer-master\BluetoothLEExplorer\GattHelper\Converters\GattConvert.cs 1 Actif

            Can you help me either by understanding what I have to change in my code to make it running again,
            or really explain but a simple way like mine how to use get data from device not declared.

            I will try to activate the Bluetooth trace, and will tell you.
            Fortunately, I have another PC with the standard (non insider) windows and my software continues to work.
            It is important because I need my device (based on CC2650 Sensortag) and my software to participate and win (like last year) the next e-rally of montecarlo (http://acm.mc/en/edition/erallye-2017-edition/)

          2. Aruna [MSFT] says:

            Hi Thierry,
            We have fix for this bug in our Windows Insider program (WIP) Fast Skip Ahead. Please upgrade to the latest build and let us know if you still see issues.
            Thanks,
            Aruna.

  9. Nice, since the open source it’s been great!

    1. Aruna [MSFT] says:

      Awesome! That’s great to hear.

      Regards,
      Aruna.

  10. Dean Taylor says:

    Hi, My Galaxy Note 8 (apparently) has the Bluetooth 5 standard built in, which should provide significant improvements to range etc. I haven’t seen it anywhere else thoguh in terms of peripherals or other core devices like Windows 10 PCs. Can you say if there is an intention to build BT5 into future software updates and if so when? Until more core devices use the new stanrdard peripherals are unlikely to follow it.

    1. Aruna [MSFT] says:

      Hi Dean,
      This is something we are definitely looking into. We’ll update this blog with more details at a later time.
      Thanks,
      Aruna.

Skip to main content