feat: 增加媒体格式校验,支持 JPEG、PNG、GIF、MP4、WebM、WebP 格式

This commit is contained in:
km2023
2026-04-20 15:40:22 +08:00
parent 1a7bbdc625
commit f42944bb58
3 changed files with 75 additions and 7 deletions

View File

@@ -35,6 +35,7 @@ public enum DuooomiBleError: LocalizedError {
case transferFailed(String)
case invalidFrame
case permissionDenied
case unsupportedFormat(String)
public var errorDescription: String? {
switch self {
@@ -64,6 +65,8 @@ public enum DuooomiBleError: LocalizedError {
return "Invalid protocol frame"
case .permissionDenied:
return "Bluetooth permission denied"
case .unsupportedFormat(let ext):
return "Unsupported file format: \(ext). Supported: jpeg, png, gif, mp4, webm, webp"
}
}
}