2016-02-15 66 views
4

我正在爲Microsoft Band開發一個UWP應用程序,最近從Band SDK ver 1.3.11121升級到Microsoft Band SDK ver 1.3.20115。MS Band:在Altimeter傳感器報告數據後,所有傳感器數據報告停止[可能的錯誤?]

我注意到,如果我訂閱了多個傳感器(包括高度表傳感器)的ReadingChanged事件,那麼一旦高度計傳感器首次報告數據,我就不會收到任何傳感器(包括高度計)的數據。

我的代碼,在那裏我仍然可以看到問題的簡化版本:

IBandClient bandClient; 
    async void SetupBand() 
    { 
     IBandInfo[] pairedBands = await BandClientManager.Instance.GetBandsAsync(); 
     try 
     { 
      bandClient = await BandClientManager.Instance.ConnectAsync(pairedBands[0]); 


      if (bandClient.SensorManager.Gyroscope.GetCurrentUserConsent() != UserConsent.Granted) 
      { 
       await bandClient.SensorManager.Gyroscope.RequestUserConsentAsync(); 
      } 

      if (bandClient.SensorManager.Altimeter.GetCurrentUserConsent() != UserConsent.Granted) 
      { 
       await bandClient.SensorManager.Altimeter.RequestUserConsentAsync(); 
      } 

      IEnumerable<TimeSpan> supportedAltimeterReportingIntervals = bandClient.SensorManager.Altimeter.SupportedReportingIntervals; 
      TimeSpan T1 = supportedAltimeterReportingIntervals.First(); 
      bandClient.SensorManager.Altimeter.ReportingInterval = T1; 


      IEnumerable<TimeSpan> supportedGyroscopeReportingIntervals = bandClient.SensorManager.Gyroscope.SupportedReportingIntervals; 
      TimeSpan T2 = supportedGyroscopeReportingIntervals.First(); 
      bandClient.SensorManager.Gyroscope.ReportingInterval = T2; 

      bandClient.SensorManager.Altimeter.ReadingChanged += (sender, args) => 
      { 
       System.Diagnostics.Debug.WriteLine("Input received for Altimeter"); 
      }; 

      bandClient.SensorManager.Gyroscope.ReadingChanged += (sender, args) => 
      { 
       System.Diagnostics.Debug.WriteLine("Input received for Gyroscope"); 

      }; 

      await bandClient.SensorManager.Gyroscope.StartReadingsAsync(); 
      await bandClient.SensorManager.Altimeter.StartReadingsAsync(); 


     } 
     catch (BandException ex) 
     { 
      // handle a Band connection exception 
     } 

    } 
  1. 與上面的代碼我看到一堆的陀螺儀傳感器的更新,但一旦高度計傳感器報告數據,所有關於陀螺儀和高度計數據的進一步報告停止。
  2. 代碼顯示調試和發佈(使用.Net本機編譯器工具鏈)版本
  3. 如果我使用Microsoft Band SDK 1.3.11121,但不適用於SDK 1.3.20115,此代碼正常工作。

我錯過了什麼或在代碼中做錯了嗎?

回答

1

這被證實是一個問題。此問題已在SDK版本20217中得到解決。