コード例 #1
0
        public FoxConnector
        (
            IBluetoothCommunicator bluetoothCommunicator,
            IUserNotifier userNotifier
        )
        {
            _bluetoothCommunicator = bluetoothCommunicator;
            _userNotifier          = userNotifier;

            _bluetoothCommunicator.SetupDelegates(OnConnect, OnDisconnect, OnNewByteRead);
        }
コード例 #2
0
        public ConnectToFoxPage(IBluetoothDevicesLister bluetoothDevicesLister,
                                IBluetoothCommunicator bluetoothCommunicator)
        {
            this.bluetoothDevicesLister             = bluetoothDevicesLister;
            connectToFoxModel.BluetoothCommunicator = bluetoothCommunicator;

            InitializeComponent();

            BindingContext = connectToFoxModel;

            UpdateDevicesList();
        }
コード例 #3
0
ファイル: MainPage.xaml.cs プロジェクト: WhiteFossa/yiff-l
        public MainPage(IBluetoothDevicesLister bluetoothDevicesLister,
                        IBluetoothCommunicator bluetoothCommunicator,
                        IPacketsProcessor packetsProcessor)
        {
            InitializeComponent();

            var connectToFoxPage = new ConnectToFoxPage(bluetoothDevicesLister,
                                                        bluetoothCommunicator);

            var foxSettingsPage = new FoxSettingsPage(bluetoothCommunicator,
                                                      packetsProcessor);

            btnConnectToFox.Clicked += (s, e) => Navigation.PushModalAsync(connectToFoxPage);
            btnFoxSettings.Clicked  += (s, e) => Navigation.PushModalAsync(foxSettingsPage);
        }
コード例 #4
0
        public FoxSettingsPage(IBluetoothCommunicator bluetoothCommunicator,
                               IPacketsProcessor packetsProcessor)
        {
            this.bluetoothCommunicator = bluetoothCommunicator;
            this.packetsProcessor      = packetsProcessor;

            App.NewByteReadDelegate = packetsProcessor.NewByteReceived;

            InitializeComponent();

            // Fox codes
            pkCode.Items.Add("Finish");
            pkCode.Items.Add("Fox #1");
            pkCode.Items.Add("Fox #2");
            pkCode.Items.Add("Fox #3");
            pkCode.Items.Add("Fox #4");
            pkCode.Items.Add("Fox #5");
            pkCode.Items.Add("Beacon");

            // Registering events handlers
            packetsProcessor.RegisterOnFoxArmedEventHandler(OnFoxIsArmed);
            packetsProcessor.RegisterOnAntennaMatchingMeasurementEventHandler(OnAntennaMatchingMeasurement);
            packetsProcessor.RegisterOnEnteringSleepmodeEventHandler(OnEnteringSleepmode);
        }
コード例 #5
0
ファイル: PacketsProcessor.cs プロジェクト: WhiteFossa/yiff-l
 public PacketsProcessor(IBluetoothCommunicator bluetoothCommunicator)
 {
     this.bluetoothCommunicator = bluetoothCommunicator;
 }