/// <summary> /// Get <see cref="INanoFrameworkDeviceInfo"/> from device. /// If the device information has been retrieved before this method returns the cached data, unless the force argument is true. /// </summary> /// <param name="force">Force retrieving the information from the device.</param> /// <returns>Return the <see cref="INanoFrameworkDeviceInfo"/> for this device.</returns> public INanoFrameworkDeviceInfo GetDeviceInfo(bool force = true) { // start by checking if we already have this available if (!DeviceInfo.Valid || force) { // seems to be invalid so get it from device var mfDeviceInfo = new NanoFrameworkDeviceInfo(this); mfDeviceInfo.GetDeviceInfo(); DeviceInfo = mfDeviceInfo; } return(DeviceInfo); }
public async Task <INanoFrameworkDeviceInfo> GetDeviceInfoAsync() { // start by checking if we already have this available if (!DeviceInfo.Valid) { // seems to be invalid so get it from device var mfDeviceInfo = new NanoFrameworkDeviceInfo(this); await mfDeviceInfo.GetDeviceInfo(); DeviceInfo = mfDeviceInfo; } return(DeviceInfo); }