public BackgroundWindow()
        {
            instance        = this;
            bluetoothServer = new BluetoothServer();
            bluetoothServer.Start();

            MainWindow mw = new MainWindow();

            mw.Show();

            MMDeviceEnumerator DevEnum = new MMDeviceEnumerator();

            /*MMDevice defind = DevEnum.GetDefaultAudioEndpoint(EDataFlow.eCapture, ERole.eCommunications);
             *
             * PropertyStore ps = defind.Properties;
             *
             * for (int i = 0; i < ps.Count; i++ )
             * {
             *  PropertyKey pk = ps[i].Key;
             *
             *  //Console.WriteLine(pk.fmtid + " (" + pk.pid + "): " + ps[i].Value);
             *
             *  if (ps[i].Value.GetType() == typeof(Byte[]))
             *  {
             *      Byte[] b = (Byte[])ps[i].Value;
             *
             *
             *  }
             * }*/

            //MMDevice devic = DevEnum.GetDevice(data.data);


            //Console.WriteLine(output3);
        }
Exemple #2
0
        public BluetoothServer()
        {
            DevEnum.RegisterEndpointNotificationCallback(NOCL);
            AudioSessionTimer.Interval = 1000;
            AudioSessionTimer.Tick    += AudioSessionTimer_Tick;
            AudioSessionTimer.Start();
            GCColTimer.Interval = 60000;
            GCColTimer.Tick    += GCColTimer_Tick;
            GCColTimer.Start();

            lastChangedVol  = new ProcessVolumeInt(-99999, -99999, false);
            lastSentVol     = new ProcessVolumeInt(-99999, -99999, false);
            lastChangedVolD = new DeviceVolumeInt("", -99999, false);
            lastSentVolD    = new DeviceVolumeInt("", -99999, false);
            instance        = this;
            if (BluetoothRadio.IsSupported)
            {
                Console.WriteLine("Bluetooth Supported");
                Console.WriteLine("-------------------");
                Console.WriteLine("Primary Bluetooth Radio Name: " + BluetoothRadio.PrimaryRadio.Name);
                Console.WriteLine("Primary Bluetooth Radio Address: " + BluetoothRadio.PrimaryRadio.LocalAddress);
                Console.WriteLine("Primary Bluetooth Radio Manufacturer: " + BluetoothRadio.PrimaryRadio.Manufacturer);
                Console.WriteLine("Primary Bluetooth Radio Mode: " + BluetoothRadio.PrimaryRadio.Mode);
                Console.WriteLine("Primary Bluetooth Radio Software Manufacturer: " + BluetoothRadio.PrimaryRadio.SoftwareManufacturer);
                Console.WriteLine("Primary Bluetooth Radio Version: " + BluetoothRadio.PrimaryRadio.HciVersion);
                Console.WriteLine("-------------------");
            }
            else
            {
                BackgroundWindow.instance.notificationManager.SendNotification(Constants.Notifications.BluetoothNotSupported);
            }
        }