private async void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            AllJoynBusAttachment bus = new AllJoynBusAttachment();
            bus.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.SrpAnonymous);

            _garageDoorProducer = new GarageDoorProducer(bus);
            _garageDoorDriver = new GarageDoorDriver(_garageDoorProducer);
            _garageDoorProducer.Service = new GarageDoorService(_garageDoorDriver);
            _garageDoorProducer.Start();

            AllJoynBusAttachment bus2 = new AllJoynBusAttachment();
            bus2.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.SrpAnonymous);

            _adcDriver = new Mcp3008(0);
            await _adcDriver.Connect();

            _garageTempProducer = new CurrentTemperatureProducer(bus2);
            _garageTempProducer.Service = new CurrentTemperatureService(new TemperatureDriver(_adcDriver, 0,_garageTempProducer));
            _garageTempProducer.Start();

        }
Beispiel #2
0
        private async void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            AllJoynBusAttachment bus = new AllJoynBusAttachment();

            bus.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.SrpAnonymous);

            _garageDoorProducer         = new GarageDoorProducer(bus);
            _garageDoorDriver           = new GarageDoorDriver(_garageDoorProducer);
            _garageDoorProducer.Service = new GarageDoorService(_garageDoorDriver);
            _garageDoorProducer.Start();

            AllJoynBusAttachment bus2 = new AllJoynBusAttachment();

            bus2.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.SrpAnonymous);

            _adcDriver = new Mcp3008(0);
            await _adcDriver.Connect();

            _garageTempProducer         = new CurrentTemperatureProducer(bus2);
            _garageTempProducer.Service = new CurrentTemperatureService(new TemperatureDriver(_adcDriver, 0, _garageTempProducer));
            _garageTempProducer.Start();
        }
 public GarageDoorService(GarageDoorDriver driver)
 {
     _driver = driver;
 }
 public GarageDoorService(GarageDoorDriver driver)
 {
     _driver = driver;
 }