|
@@ -14,6 +14,7 @@ using Windows.Security.Cryptography;
|
|
|
using Windows.Storage.Streams;
|
|
|
using MSerialization;
|
|
|
using BLEComm;
|
|
|
+using System.Runtime.InteropServices.WindowsRuntime;
|
|
|
|
|
|
namespace BLETool
|
|
|
{
|
|
@@ -55,7 +56,6 @@ namespace BLETool
|
|
|
lvwColumnSorter = new ListViewColumnSorter();
|
|
|
this.lv_device.ListViewItemSorter = lvwColumnSorter;
|
|
|
this.ss_bottom.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
|
|
|
- this.toolStripStatusLabel1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
|
|
|
|
|
|
}
|
|
|
//发现新设备
|
|
@@ -370,7 +370,7 @@ namespace BLETool
|
|
|
ble_Services = services;
|
|
|
foreach (var service in services)
|
|
|
{
|
|
|
- string servicename = BLE_Info.GetServiceName(service);
|
|
|
+ string servicename = BLEInfo.GetServiceName(service);
|
|
|
cmb_service.Items.Add(servicename);
|
|
|
}
|
|
|
if (services.Count > 0)
|
|
@@ -410,7 +410,7 @@ namespace BLETool
|
|
|
ble_Characteristics = characteristics;
|
|
|
foreach (var characteristic in characteristics)
|
|
|
{
|
|
|
- string characteristicname = BLE_Info.GetCharacteristicName(characteristic);
|
|
|
+ string characteristicname = BLEInfo.GetCharacteristicName(characteristic);
|
|
|
cmb_characteristic.Items.Add(characteristicname);
|
|
|
}
|
|
|
if (ble_Characteristics.Count > 0)
|
|
@@ -490,7 +490,7 @@ namespace BLETool
|
|
|
txt_UTF8Result.Text = "";
|
|
|
var result = args.CharacteristicValue;
|
|
|
string type = "";
|
|
|
- string formattedResult = BLE_Info.FormatValueByPresentation(result, presentationFormat, out type);
|
|
|
+ string formattedResult = BLEInfo.FormatValueByPresentation(result, presentationFormat, out type);
|
|
|
txt_UTF8Result.Text = formattedResult;
|
|
|
if (type == "HEX") { rad_hex.Checked = true; rad_dec.Checked = false; rad_utf8.Checked = false; }
|
|
|
if (type == "Decimal") { rad_hex.Checked = false; rad_dec.Checked = true; rad_utf8.Checked = false; }
|
|
@@ -711,7 +711,7 @@ namespace BLETool
|
|
|
{
|
|
|
ble_result = result.Value;
|
|
|
string type = "";
|
|
|
- string formattedResult = BLE_Info.FormatValueByPresentation(result.Value, presentationFormat, out type);
|
|
|
+ string formattedResult = BLEInfo.FormatValueByPresentation(result.Value, presentationFormat, out type);
|
|
|
txt_UTF8Result.Text = formattedResult;
|
|
|
if (type == "HEX") { rad_hex.Checked = true; rad_dec.Checked = false; rad_utf8.Checked = false; }
|
|
|
if (type == "Decimal") { rad_hex.Checked = false; rad_dec.Checked = true; rad_utf8.Checked = false; }
|