/// <summary> /// Finds a catalogue entry with matching producId. /// </summary> /// <param name="productId">Product to search for.</param> /// <returns>Catalogue entry if found otherwise null.</returns> public DeviceCatalogueInfo FindDevice(DeviceCatalogueInfo.Product productId) { foreach (DeviceCatalogueInfo info in mDeviceCatalogue) { if (info.ProductId == productId) { return(info); } } return(null); }
private static void ResetDeviceCatalogue(CANCommsServer canServer, DeviceCatalogueInfo.Product prodId, byte ver) { try { canServer.DeviceCatalogue.Clear(); DeviceCatalogueInfo dci = new DeviceCatalogueInfo() { BuildNo = ver, ProductId = (DeviceCatalogueInfo.Product)mProductCode }; canServer.DeviceCatalogue.UpdateDeviceCatalogue(dci); canServer.PersistCatalogue(); } catch (Exception e) { CNXLog.ErrorFormat("ResetDeviceCatalogue Error : {0}", e.ToString()); } }