コード例 #1
0
ファイル: BluetoothDevice.cs プロジェクト: Necat0r/Automation
        public BluetoothDevice(DeviceCreationInfo creationInfo)
            : base(new BluetoothState(), creationInfo)
        {
            BluetoothState state = (BluetoothState)mState;
            state.BtName = creationInfo.Configuration.btname;

            mService = (BluetoothService)creationInfo.ServiceManager.GetService(typeof(BluetoothService));
            mService.AddDevice(this);
        }
コード例 #2
0
 public override void ViewWillAppear(bool animated)
 {
     base.ViewWillAppear(animated);
     // Declare new instance of BluetoothService
     this.bluetoothService = new BluetoothService();
     // Define when each method should trigger
     this.bluetoothService.StateChanged     += StateChanged;
     this.bluetoothService.DiscoveredDevice += DiscoveredDevice;
     this.bluetoothService.DeviceConnected  += DeviceConnected;
 }
コード例 #3
0
        public BluetoothDevice(DeviceCreationInfo creationInfo)
            : base(new BluetoothState(), creationInfo)
        {
            BluetoothState state = (BluetoothState)mState;

            state.BtName = creationInfo.Configuration.btname;

            mService = (BluetoothService)creationInfo.ServiceManager.GetService(typeof(BluetoothService));
            if (mService != null)
            {
                mService.AddDevice(this);
            }
        }
コード例 #4
0
 // Get and set variables needed for this view to function properly
 public SpheroViewController(BluetoothService bluetoothService, CBPeripheral peripheral)
 {
     BluetoothDevice = bluetoothService;
     Peripheral      = peripheral;
 }