private async void _watcher_Added(GarageDoorWatcher sender, AllJoynServiceInfo args) { GarageDoorJoinSessionResult result = await GarageDoorConsumer.JoinSessionAsync(args, sender); _consumer = result.Consumer; _consumer.Signals.GarageDoorStateChangedReceived += Signals_GarageDoorStateChangedReceived; }
private async void _watcher_Added(GarageDoorWatcher sender, AllJoynServiceInfo args) { GarageDoorJoinSessionResult result = await GarageDoorConsumer.JoinSessionAsync(args, sender); _consumer = result.Consumer; _consumer.Signals.GarageDoorStateChangedReceived += Signals_GarageDoorStateChangedReceived; var result2 = await _consumer.GetDoorStateAsync(); GarageDoorState = Convert.ToInt32(result2.DoorState.Value1); }
public void Start() { AllJoynBusAttachment bus = new AllJoynBusAttachment(); bus.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.SrpAnonymous); _consumer = new GarageDoorConsumer(bus); _watcher = new GarageDoorWatcher(bus); _watcher.Added += _watcher_Added; _watcher.Start(); GarageDoorState = -1; }
private async void _watcher_Added(GarageDoorWatcher sender, AllJoynServiceInfo args) { GarageDoorJoinSessionResult result = await GarageDoorConsumer.JoinSessionAsync(args, sender); _consumer = result.Consumer; _consumer.Signals.GarageDoorStateChangedReceived += Signals_GarageDoorStateChangedReceived; }
private async void _watcher_Added(GarageDoorWatcher sender, AllJoynServiceInfo args) { GarageDoorJoinSessionResult result = await GarageDoorConsumer.JoinSessionAsync(args, sender); _consumer = result.Consumer; _consumer.Signals.GarageDoorStateChangedReceived += Signals_GarageDoorStateChangedReceived; var result2 = await _consumer.GetDoorStateAsync(); GarageDoorState = Convert.ToInt32(result2.DoorState.Value1); }
public void Start() { AllJoynBusAttachment bus = new AllJoynBusAttachment(); bus.AuthenticationMechanisms.Add(AllJoynAuthenticationMechanism.SrpAnonymous); _consumer = new GarageDoorConsumer(bus); _watcher = new GarageDoorWatcher(bus); _watcher.Added += _watcher_Added; _watcher.Start(); GarageDoorState = -1; }