protected async Task Initialize() { await _device.WaitForPropertyValueAsync("Connected", value : true, TIMEOUT); _properties = await _device.GetAllAsync(); Log.Debug("Waiting for services to resolve..."); await _device.WaitForPropertyValueAsync("ServicesResolved", value : true, TIMEOUT); foreach (var s in await _device.GetUUIDsAsync()) { var g = Guid.Parse(s); var svc = await _device.GetServiceAsync(s); _services[Guid.Parse(s)] = svc; if (g == DEVICE_INFORMATION_SERVICE) { Log.Debug("Found DeviceInformationService."); DeviceInformationService = new DeviceInformationService(svc); } else if (g == BATTERY_SERVICE) { Log.Debug("Found BatteryService."); BatteryService = new BatteryService(svc); } } Log.Debug("Services resolved."); await BleDeviceConnected(); Log.Information($"Connected to {this}."); }
protected override IMvxApplication CreateApp() { var storage = new LocalStorageContainer(); var keyStorage = new LocalKeyStorageContainer(storage); var deviceInformationService = new DeviceInformationService(); return(new App(keyStorage, storage, null, deviceInformationService)); }
protected override IMvxApplication CreateApp() { Mvx.ConstructAndRegisterSingleton <IMvxJsonConverter, JsonSerializer>(); var preferencesManager = new PreferencesManager(); var storageContainer = new LocalStorageContainer(); var keyStorage = new LocalKeyStorageContainer(storageContainer); var deviceInformationService = new DeviceInformationService(); return(new Client.Shared.App(keyStorage, storageContainer, preferencesManager, deviceInformationService)); }
public DeviceInformationPage(DeviceInformationService service) { InitializeComponent(); _service = service; BindingContext = _service; }