locked
Bluetooth LE Metro App

    Question

  • I'm trying to make a metro style app that talks to Bluetooth LE (4.0) devices. I found the sample app with heart rate, blood pressure and thermometer, and I also tried making my own heart rate app, but neither work.

    In the sample app, I get this output:

    "Getting the device failed with error: 80070057"

    What does this mean?

    In my own app (see code below), I get a type mismatch error in the deviceFactory.getDeviceFromIdAsync() method.

    I'm new to Windows programming, so these errors don't tell me much.

    Note 1: The device is found by Windows in the Devices page, and I am able to read the device name in my app.

    Note 2: I am using a Nordic Semiconductor kit (not TI).

    Windows.Devices.Enumeration.DeviceInformation.findAllAsync("System.Devices.InterfaceClassGuid:=\"{0000180D-0000-1000-8000-00805f9b34fb}\"", null).
                        done(function foundAllAsync(devices) {
                            try{
                                var deviceFactory = new ActiveXObject("PortableDeviceAutomation.Factory");
                                var newDevice = devices[0];
                                var id = newDevice.id;
                                deviceFactory.getDeviceFromIdAsync(id, 
                                    function gotDevice (device) {  },
                                    null
                                );
                            }
                            catch (e) {
                                log(e.toString());
                                for (var prop in e) {
                                    log(prop + ": " + e[prop]);
                                }
                            }
                        }
                    );

    Monday, June 25, 2012 2:17 PM

Answers

All replies

  • Ronningstad,

    I will look into this for you.

    Best Wishes - Eric

    Monday, June 25, 2012 3:28 PM
    Moderator
  • Ronningstad,

    The 80070057 error is most likely caused by the wrong driver being installed.  The HeartRate, Blood Pressure and Thermometer profiles are standard Bluetooth 4.0 profiles ratified by the SIG, any real device or devkit that conforms to the spec on those profiles should work with the BluetoothHealthProfiles Metro sample, the Simple Key service (short service UUID: FFE0) is not a Bluetooth 4.0 standard profile, rather it is TI specific, so it is not guaranteed to work with other devices / implementations. 

    We have sample drivers that support the Heart Rate, Thermometer, Blood Pressure and the TI Simple Key service available here:  http://code.msdn.microsoft.com/windowshardware/Bluetooth-Generic-4f4ea968

    Best Wishes - Eric





    Wednesday, June 27, 2012 4:28 AM
    Moderator
  • Thank you for replying.

    So I downloaded and built the samples, and tested them with the sample app, and now I get another error: 80070005. I get the same error for all the three standard services. A bit of googling tells me that it might have something to do with security and permissions, but I'm not sure.

    In my own app, I still get the same error (type mismatch), regardless of choosing the device or the service (i.e. devices[0] or devices[1]).

    Also: The drivers weren't signed, so I had to turn off mandatory signing.

    Regards,

    Øyvind Rønningstad

    Edit: I unmarked the answer because though the 80070057 error is gone, there is a new one; and the type mismatch error persists.



    • Edited by ronningstad Thursday, June 28, 2012 7:48 AM
    Wednesday, June 27, 2012 7:56 AM
  • Once the correct driver is installed, the error will change to 80070005 (ACCESS_DENIED) which means that the correct device metadata is not installed. Only after the correct driver and metadata are installed will the app be able to function.

    Device Metadata needs to be written using the Device Metadata Authoring Wizard :

    http://msdn.microsoft.com/en-us/library/windows/hardware/hh454826(v=vs.85).aspx

    Thursday, June 28, 2012 3:39 PM
    Moderator
  • I tried to make a device metadata package, but can't seem to get it working (I get the same errors in the apps). I ticked "Copy packages to your system's local metadata store", is this enough to couple it with my device? The device is connected, and drivers are installed. I added the package name of the sample app to the "privileged applications" list, and added these hardware ids in the associations tab:

    BTHLEDevice\{0000180d-0000-1000-8000-00805f9b34fb}_LOCALMFG&000f
    BTHLE\Dev_fe65d3a17796
    BTHLEDevice\{0000180d-0000-1000-8000-00805f9b34fb}

    They are: The service, the device, and a 'compatible id' to the service, respectively.

    What am I missing? It's hard to understand exactly what is needed.

    EDIT: I tried with the system in test mode, but it's still ACCESS_DENIED.
    Monday, July 2, 2012 12:46 PM
  • Eric, can you please add the device metadata file to the sample code.

    Thanks,

    Rik.

    Tuesday, November 20, 2012 8:24 PM
  • Hi,

    Were you ever able to get this to work?  Many of the pages refrenced here are no longer available.

    Thank you.

    Thursday, April 3, 2014 12:55 PM
  • I was never able to get it to work. I have since moved on to other projects. It is a long time ago, so much of this is probably irrelevant, and I would guess the API changed a bit since then.
    Friday, April 4, 2014 10:03 PM
  • Hello,

    I don't know anything about Win 8.1 Bluetooth Smart (Low Energy) APIs but I would like to take advantage of them. It sounds like it is the way to go if I want to write portable Windows Apps.

    We have been developing BLE for the past year now. Our solutions are working properly with Android apps.

    On Windows 8.1 I'm seeing the same issue. Pretty much trying to do the same thing the original author here was doing. I took the Nordic sample code for Health profiles and made it run on my embedded platform. It works with Android app for Thermometer but having issues with Win 8.1

    My device does not have a windows driver because it is using generic bluetooth profiles to work with BluetoothHealthProfiles.

    What is this metadata? Am I supposed to create one for every BLE device that I want to connect to Win 8.1?

    Is anyone from MS able to provide guidance please?

    Gil


    • Edited by gilmotta Friday, August 15, 2014 9:18 PM
    Friday, August 15, 2014 2:16 PM