11 using System.Collections.Generic;
12 using System.Windows.Forms;
13 using Windows.Devices.Enumeration;
35 devices =
new Dictionary<string, string>();
56 Invoke(c,
new object[] { w, d });
83 Invoke(c,
new object[] { w, d });
118 string selectedDeviceId =
deviceList.SelectedValue.ToString();
133 Invoke(c,
new object[] { con });
146 MessageBox.Show(
"Connection to the device failed !",
"Connection error", MessageBoxButtons.OK, MessageBoxIcon.Error);
void OnDeviceConnected(BLEManager con)
Authenticate on device connection
BLEManager BluetoothManager
void OnDeviceAdded(DeviceWatcher w, DeviceInformation d)
Adds the selected device
System.Windows.Forms.ComboBox deviceList
delegate void OnDeviceRemovedHandler(DeviceWatcher w, DeviceInformationUpdate d)
void ConnectionFrame_FormClosing(object sender, FormClosingEventArgs e)
bool HasDeviceConnected()
DeviceWatcher CreateWatcher()
Manages fitness tracker
async void Connect(string deviceId, OnDeviceConnected callback=null)
static DeviceControl Instance
Dictionary< string, string > devices
delegate void OnDeviceAddedHandler(DeviceWatcher w, DeviceInformation d)
DeviceWatcher BLEWatcher
bool IsWatchingForDevice()
void ConnectionFrame_Load(object sender, EventArgs e)
Loads the list of devices
delegate void OnDeviceConnectedHandler(BLEManager con)
System.Windows.Forms.Button connectButton
void connectButton_Click(object sender, EventArgs e)
Connects the selected device
void InitializeComponent()
Méthode requise pour la prise en charge du concepteur - ne modifiez pas le contenu de cette méthode a...
ControlFrame controlFrame
void OnDeviceRemoved(DeviceWatcher w, DeviceInformationUpdate d)
Removed the selected device