Microsoft Band SDK on Windows 8,1

2019-01-26 19:41发布

问题:

Maybe I'm crazy, but how do I access a Band on a Windows 8.1 machine?

Any calls to BandClientManager return 0 paired devices, and I'm not sure how to "pair" a Band to a Windows 8.1 machine.

I can obviously get the Microsoft Band Desktop to sync easily on any Desktop, but no Bluetooth on any of my Surface devices ever even register a Band available.

The code samples obviously show connecting on Windows 8.1. What am I missing to have a Band show up?

回答1:

A couple of things than can be tried and may have an effect are:

Disable Power Saving on the PC's BT Adapter

  1. On your PC, launch Device Manager (e.g. by right clicking the Windows 8.1 Start Button and choosing "Device Manager")
  2. In Device Manager, go to Bluetooth -> and right click and select "Properties".
  3. Go to the "Power Management" tab of the Properties dialog, and make sure that "Allow the computer to turn off this device to save power" checkbox is NOT checked.

Re-pair the Band to the PC:

  1. On the Band, go to the Settings tile and tap the Bluetooth icon, then change the Bluetooth state from "On" to "Pairing".
  2. On the PC, go to the Bluetooth "Show Bluetooth Devices" and unpair the Band (if previously paired to the PC) and then start a fresh pairing.


回答2:

The latest SDK does contains Windows 8.1 and Windows Phone 8.1 examples. You can find the SDK here: http://developer.microsoftband.com/



回答3:

Have you already installed the Band Sync app on Windows and paired with the band?

I haven't tried this scenario on a Windows 8.1 machine yet but haven't had any issue with BandClientManager on Windows Phone 8.1 in a Windows Store app.

Windows 8.1 Band Sync App http://www.microsoft.com/en-us/download/details.aspx?id=44579



回答4:

I just did a quick test on my Windows 10 (desktop) machine. I paired my Band to the machine via Bluetooth--as it's an older machine I have a USB-based Bluetooth adapter--and created a new, Blank, Windows 8.1 Store project in Visual Studio 2013. I applied the latest Band SDK NuGet package (v1.3.10417.1). I added a Button to the MainPage and added the following click handler:

private async void Button_Click(object sender, RoutedEventArgs e)
{
    var bands = await BandClientManager.Instance.GetBandsAsync();
    var band = bands.FirstOrDefault();

    if (band != null)
    {
        var client = await BandClientManager.Instance.ConnectAsync(band);

        string name = await client.GetFirmwareVersionAsync();
    }
}

I started the application in debugger on the local machine (not the simulator), and was able to enumerate, connect to, and retrieve the firmware version from my Band.

I only have an old Surface RT machine (which won't run Visual Studio) and am running Windows 10 on all my desktops at the moment so can't replicate your exact scenario. That said, if it works on an old machine with an external Bluetooth adaptor on a pre-release OS, I'd be surprised that it doesn't work on a much newer machine (like a Surface) with an integrated Bluetooth adaptor, on a released and stable OS.

One thing to keep in mind is that the Band will only "remember" (i.e. connect to) the last device it has been Bluetooth-paired with, regardless of whether those devices still show the Band as being paired (and vice-versa). If you're switching between testing the Band with your phone applications and your Store (desktop) applications, then you have to re-pair (not factory reset) the Band to the new device.



回答5:

I've the same issue, I've running an 8.1 dell laptop and it sees the band in the Bluetooth connections etc but when I try to connect in my app it doesn't see the band. I've even tried to connect my band to a windows phone and my app falls over on the connection.

The strange thing I've noticed is when it's paired to my iPhone it connects as though it's 2 devices. There are 2 entries in my Bluetooth settings. When connecting to the laptop and windows phone it shows as 1 but occasionally the other device shows up briefly then disappears and you can't connect to it. This could be a red herring but it's just a little odd...

the code isn't doing anything special : var pairedBands = await Microsoft.Band.BandClientManager.Instance.GetBandsAsync(); if (pairedBands.Length < 1) { // display some error message return; }

pairedBands always comes back with 0.

The windows phone dll is 8.1.0.0....help! It's driving me mad.