Add BLE file transfer support and media UX

This commit is contained in:
jack
2025-10-14 22:20:19 +02:00
parent 3479c7d5df
commit f7859f7b04
19 changed files with 4147 additions and 373 deletions
+15
View File
@@ -0,0 +1,15 @@
import Foundation
/// Centralized thresholds for Bluetooth file transfers to keep payload sizes sane on constrained radios.
enum FileTransferLimits {
/// Absolute ceiling enforced for any file payload (voice, image, other).
static let maxPayloadBytes: Int = 8 * 1024 * 1024 // 8 MiB
/// Voice notes stay small for low-latency relays.
static let maxVoiceNoteBytes: Int = 2 * 1024 * 1024 // 2 MiB
/// Compressed images after downscaling should comfortably fit under this budget.
static let maxImageBytes: Int = 4 * 1024 * 1024 // 4 MiB
static func isValidPayload(_ size: Int) -> Bool {
size <= maxPayloadBytes
}
}