Files
openclaw/apps/shared/OpenClawKit/Sources/OpenClawKit/LocationCommands.swift

58 lines
1.6 KiB
Swift
Raw Normal View History

2026-01-04 00:54:44 +01:00
import Foundation
2026-01-30 03:15:10 +01:00
public enum OpenClawLocationCommand: String, Codable, Sendable {
2026-01-04 00:54:44 +01:00
case get = "location.get"
}
2026-01-30 03:15:10 +01:00
public enum OpenClawLocationAccuracy: String, Codable, Sendable {
2026-01-04 00:54:44 +01:00
case coarse
case balanced
case precise
}
2026-01-30 03:15:10 +01:00
public struct OpenClawLocationGetParams: Codable, Sendable, Equatable {
2026-01-04 00:54:44 +01:00
public var timeoutMs: Int?
public var maxAgeMs: Int?
2026-01-30 03:15:10 +01:00
public var desiredAccuracy: OpenClawLocationAccuracy?
2026-01-04 00:54:44 +01:00
2026-01-30 03:15:10 +01:00
public init(timeoutMs: Int? = nil, maxAgeMs: Int? = nil, desiredAccuracy: OpenClawLocationAccuracy? = nil) {
2026-01-04 00:54:44 +01:00
self.timeoutMs = timeoutMs
self.maxAgeMs = maxAgeMs
self.desiredAccuracy = desiredAccuracy
}
}
2026-01-30 03:15:10 +01:00
public struct OpenClawLocationPayload: Codable, Sendable, Equatable {
2026-01-04 00:54:44 +01:00
public var lat: Double
public var lon: Double
public var accuracyMeters: Double
public var altitudeMeters: Double?
public var speedMps: Double?
public var headingDeg: Double?
public var timestamp: String
public var isPrecise: Bool
public var source: String?
public init(
lat: Double,
lon: Double,
accuracyMeters: Double,
altitudeMeters: Double? = nil,
speedMps: Double? = nil,
headingDeg: Double? = nil,
timestamp: String,
isPrecise: Bool,
source: String? = nil)
{
self.lat = lat
self.lon = lon
self.accuracyMeters = accuracyMeters
self.altitudeMeters = altitudeMeters
self.speedMps = speedMps
self.headingDeg = headingDeg
self.timestamp = timestamp
self.isPrecise = isPrecise
self.source = source
}
}