Просмотр исходного кода

Merge branch 'main' of https://github.com/Alex4386/f0-mtp

Alex4386 1 год назад
Родитель
Сommit
c009bb35e9
3 измененных файлов с 10 добавлено и 4 удалено
  1. 4 2
      README.md
  2. 2 2
      src/scenes/mtp/mtp.c
  3. 4 0
      src/scenes/mtp/mtp.h

+ 4 - 2
README.md

@@ -34,9 +34,11 @@ Here are some things you should know before using this application:
 > **DO NOT transfer files over 64K** in one go.  
 > This will:
 > - **Crash the Flipper** if the file is too big.
-> - **Corrupt the SD Card filesystem** due to flipper zero's filesystem handler's limitation.
+> 
+> And _might_ :  
+> - **Corrupt the SD Card filesystem** due to current implementation's limitation.
+>   (If you know how to fix this issue, feel free to give me a PR!, quick `chkdsk` will fix the corruption though)
 >
-> This is applicable to both uploading and downloading files.
 
 > [!WARNING]
 > **DO NOT** use `UNICODE` characters in the file/directory names.  

+ 2 - 2
src/scenes/mtp/mtp.c

@@ -1086,11 +1086,11 @@ int BuildDeviceInfo(uint8_t* buffer) {
     ptr += length;
 
     // Device version
-    WriteMTPString(ptr, "1.0", &length);
+    WriteMTPString(ptr, MTP_DEVICE_VERSION, &length);
     ptr += length;
 
     // Serial number
-    WriteMTPString(ptr, "HakureiReimu", &length);
+    WriteMTPString(ptr, MTP_DEVICE_SERIAL, &length);
     ptr += length;
 
     return ptr - buffer;

+ 4 - 0
src/scenes/mtp/mtp.h

@@ -1,5 +1,9 @@
 #pragma once
 
+// MTP Device Serial
+#define MTP_DEVICE_SERIAL "HakureiReimu"
+#define MTP_DEVICE_VERSION "1.0"
+
 #define MTP_STANDARD_VERSION 100
 #define MTP_VENDOR_EXTENSION_ID 0x6
 #define MTP_VENDOR_EXTENSION_VERSION 100