private async void GetDeviceDescribtionAsync(string usn, string location) { string url = location.Trim(); var httpResponseMessage = await _httpClient.GetAsync(url); // check the response if (httpResponseMessage.StatusCode != HttpStatusCode.OK) { return; } var response = await httpResponseMessage.Content.ReadAsStreamAsync(); XDocument rxDocument = XDocument.Load(response); var describtion = AVRDeviceDescribtion.ReadFromXDocument(rxDocument); if (describtion == null) { return; } AVRDevice avrDevice = null; lock (mutex_AVRservice) { if (_avrServices.ContainsKey(usn)) { return; } avrDevice = new AVRDevice(usn, describtion); _avrServices.Add(usn, avrDevice); } OnAVRServiceAdded(avrDevice); }
public AVRDeviceDescribtion(AVRDeviceDescribtion other) { _friendlyName = other.FriendlyName; _manufacturer = other.Manufacturer; _manufacturerUrl = other.ManufacturerUrl; _modelDescribtion = other.ModelDescribtion; _modelName = other.ModelName; _modelNumber = other.ModelNumber; _modelUrl = other.ModelUrl; _serialNumber = other.SerialNumber; _udn = other.Udn; _upc = other.Upc; _presentationURL = PresentationUrl; }
public AVRDevice(string usn, AVRDeviceDescribtion deviceDescribtion) { _usn = usn; _avrDeviceDescribtion = deviceDescribtion; _deviceData = new AVRDeviceData(); }