Exemplo n.º 1
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);
        }