亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

BLE 值_變化

BLE 值_變化

C#
達令說 2021-06-29 05:01:40
private async void Characteristic_ValueChanged(GattCharacteristic sender, GattValueChangedEventArgs args)        {            // BT_Code: An Indicate or Notify reported that the value has changed.            // Display the new value with a timestamp.            var newValue = FormatValueByPresentation(args.CharacteristicValue, presentationFormat);            var message = $"Value at {DateTime.Now:hh:mm:ss}: {newValue}";            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,                () => CharacteristicLatestValue.Text = message);        }這是值更改的設置。^ private async void CharacteristicReadButton_Click()        {             // BT_Code: Read the actual value from the device by using Uncached.            GattReadResult result = await selectedCharacteristic.ReadValueAsync(BluetoothCacheMode.Uncached);            if (result.Status == GattCommunicationStatus.Success)            {                string formattedResult = FormatValueByPresentation(result.Value, presentationFormat);                rootPage.NotifyUser($"Read result: {formattedResult}", NotifyType.StatusMessage);            }            else            {                rootPage.NotifyUser($"Read failed: {result.Status}", NotifyType.ErrorMessage);            }             }這是讀取值的設置。所以當我點擊“閱讀”按鈕時。它捕獲當時的數據。但是我希望在值更改時刷新此數據,因此我訂閱了值更改。現在的問題是,在我點擊訂閱后,它說的是“未知格式”。所以我需要弄清楚如何更改我的格式以讀取我的 rfduino 值。
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 333 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號