diff --git a/README.md b/README.md index c127af2..3846201 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ Supernote Desktop Client (SDC) is a desktop client for Supernote paper-like tabl > SDC is a windows application build with .NET 6. ### Key Features -- Automatically detects Supernote device connected with an USB cable +- Automatically detects Supernote device connected with an USB cable (A5X/A6X/Nomad) - Shows basic information for connected Supernote device - Automatic sync: USB-C / Manual sync: USB-C / Manual sync: WIFI - Supernote storage backup to a local folder - Automatically archives last backup, supports archives retention policy - Supports multiple Supernote devices, each device have an unique local backup folder - Build-in offline mode, which allows most of the application features to be used without having Supernote device connected -- Build-in explorer allows to view and open all Supernote files in the local backup folder (A5X/A6X: support provided by [SupernoteSharp](https://github.com/nelinory/SupernoteSharp) library) +- Build-in explorer allows to view and open all Supernote files in the local backup folder (A5X/A6X/Nomad: support provided by [SupernoteSharp](https://github.com/nelinory/SupernoteSharp) library) - *.note files are converted to vectorized PDF (internal/web links supported) - *.mark files are converted to vectorized PDF (internal/web links supported) - Automatic/Manual check for new application version @@ -30,7 +30,7 @@ Get the latest portable version from [Releases page](https://github.com/nelinory Extract the zip file to a desired location. Run `SupernoteDesktopClient.exe` from inside sdc folder. > If you get a [SmartScreen](https://user-images.githubusercontent.com/25006819/115977864-555d4300-a5ae-11eb-948b-c0139f606a2d.png) popup, click on "More info" and then "Run anyway". -> The reason this popup appears is because the application is portable and it is not signed for distribution through Microsoft store.. +> The reason this popup appears is because the application is portable and it is not signed for distribution through Microsoft store. ### Wiki - [Frequently asked questions](https://github.com/nelinory/SupernoteDesktopClient/wiki/FAQ) @@ -41,7 +41,7 @@ For release milestones, please check the project board: https://github.com/users ### How to build - Clone SDC repository -- Open SupernoteDesktopClient solution in Visual Studio 2022 and build it +- Open SupernoteDesktopClient solution in [Visual Studio Community 2022](https://visualstudio.microsoft.com/vs/community) and build it ### Screenshots ##### Dashboard diff --git a/Services/MediaDeviceService.cs b/Services/MediaDeviceService.cs index 863130b..d44c055 100644 --- a/Services/MediaDeviceService.cs +++ b/Services/MediaDeviceService.cs @@ -4,6 +4,7 @@ using SupernoteDesktopClient.Models; using SupernoteDesktopClient.Services.Contracts; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; namespace SupernoteDesktopClient.Services @@ -11,6 +12,9 @@ namespace SupernoteDesktopClient.Services public class MediaDeviceService : IMediaDeviceService { private const string SUPERNOTE_DEVICE_ID = "VID_2207&PID_0011"; + private const string NOMAD_DEVICE_ID = "VID_2207&PID_0007"; + private const string SUPERNOTE_DESCRIPTION = "supernote"; + private const string NOMAD_DESCRIPTION = "nomad"; private MediaDriveInfo _driveInfo; @@ -39,7 +43,15 @@ public MediaDeviceService() public void RefreshMediaDeviceInfo() { - MediaDevice tmpDevice = MediaDevice.GetDevices().Where(p => p.DeviceId.Contains(SUPERNOTE_DEVICE_ID, System.StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault(); + MediaDevice tmpDevice = MediaDevice.GetDevices().Where(p => p.DeviceId.Contains(SUPERNOTE_DEVICE_ID, System.StringComparison.InvariantCultureIgnoreCase) + || p.DeviceId.Contains(NOMAD_DEVICE_ID, System.StringComparison.InvariantCultureIgnoreCase) + || p.Description.Contains(SUPERNOTE_DESCRIPTION, System.StringComparison.InvariantCultureIgnoreCase) + || p.Description.Contains(NOMAD_DESCRIPTION, System.StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault(); + +#if DEBUG + if (tmpDevice != null) + Debug.WriteLine($"Usb Device: {tmpDevice?.DeviceId ?? "N/A"}, Description: {tmpDevice?.Description ?? "N/A"}"); +#endif if (_supernoteManager == null) _supernoteManager = tmpDevice; @@ -106,7 +118,10 @@ public void RefreshMediaDeviceInfo() } } - DiagnosticLogger.Log($"Device: {(_supernoteManager == null ? "N/A" : _supernoteManager)}, DriveInfo: {(_driveInfo == null ? "N/A" : _driveInfo)}"); + DiagnosticLogger.Log($"Usb Device: {_supernoteManager?.DeviceId ?? "N/A"}, " + + $"Description: {_supernoteManager?.Description ?? "N/A"}, " + + $"Model: {_supernoteManager?.Model ?? "N/A"}, " + + $"DriveInfo: {_driveInfo?.TotalSize.GetDataSizeAsString() ?? "N/A"}"); } } }