예제 #1
0
        public async void ShowDevices()
        {
            List <Entity> listDevices           = new List <Entity>();
            DeviceInformationCollection devices = await bluetoothLE.GetSensors();

            foreach (var deviceInformation in devices)
            {
                listDevices.Add(new Entity(deviceInformation.Name, typeof(DeviceInformation), deviceInformation));
            }
            enuminator = new Enuminator("Bluetooth LE Devices", listDevices, OnDeviceSelected);
            enuminator.ShowDialog();
        }
예제 #2
0
        public override void Connect()
        {
            List <Entity> listDevices = new List <Entity>();

            foreach (var potentialSensor in KinectSensor.KinectSensors)
            {
                listDevices.Add(new Entity(potentialSensor.UniqueKinectId, typeof(KinectSensor), potentialSensor));
            }

            enuminator = new Enuminator("Kinect Devices", listDevices, DeviceSelected);
            enuminator.ShowDialog();
        }
예제 #3
0
 private void OnCharacteristicSelected(object sender, SelectionChangedEventArgs e)
 {
     if (e.AddedItems.Count > 0)
     {
         selectedCharacteristic = (GattCharacteristic)((Entity)e.AddedItems[0]).Item;
         if (selectedCharacteristic != null)
         {
             enuminator.Hide();
             enuminator = null;
             Status     = "Connected";
             OnConnect(this, new ConnectEventArgs("Success"));
         }
     }
 }