Download mobile/modules/bluetooth-sdk/ios/Source/streaming/StreamControllerProbe.swift from Anirudh1950/MentraOS: direct link, hf CLI and curl.
- Browser
- Download file 862 Bytes
-
https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mobile/modules/bluetooth-sdk/ios/Source/streaming/StreamControllerProbe.swift
- Command line
-
hf download hf://Anirudh1950/MentraOS/mobile/modules/bluetooth-sdk/ios/Source/streaming/StreamControllerProbe.swift
-
curl -L -o StreamControllerProbe.swift https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mobile/modules/bluetooth-sdk/ios/Source/streaming/StreamControllerProbe.swift
862 Bytes
| import CoreFoundation | |
| import Foundation | |
| /// Process-scoped native ownership survives BLE reconnects, not app termination. | |
| enum StreamControllerProbe { | |
| static let controllerId = UUID().uuidString | |
| static func response(_ values: [String: Any]) -> [String: Any]? { | |
| guard let version = values["protocolVersion"] as? NSNumber, | |
| CFGetTypeID(version) != CFBooleanGetTypeID(), version.doubleValue == 1, | |
| values["controllerId"] as? String == controllerId, | |
| let streamId = values["streamId"] as? String, !streamId.isEmpty, | |
| let probeId = values["probeId"] as? String, !probeId.isEmpty | |
| else { return nil } | |
| return ["type": "stream_controller_response", "protocolVersion": 1, | |
| "controllerId": controllerId, "streamId": streamId, "probeId": probeId] | |
| } | |
| } | |