mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
* Bump version * Message list performance fixes into 2.7.6 (#1475) * Remove extra want config call when adding a contact * App badge and unnecessary notification fixes (#1455) * - Fix for app badge not going to zero if a message arrives while you have that chat open - Fix for push notifications popping up when a message is received while that chat is open * Fix for cancelling notifications, works now. And scroll to bottom of conversation upon new message * Fix: Channels help grammer fix (#1452) * remove outdated TCP not available on Apple devices (#1450) * Update initial onboarding view * remove toggle gating for mac * Update crash reporting opt out in real time * Update onboarding text * Use mDNS text records for node name * TCP IP and port on the connection screen * Hide app icon chooser on mac * Infinite loop hang bugfixes and performance improvements for both `UserMessageList` and `ChannelMessageList` (#1465) * 2.7.5 Working Changes (#1460) * Remove extra want config call when adding a contact * App badge and unnecessary notification fixes (#1455) * - Fix for app badge not going to zero if a message arrives while you have that chat open - Fix for push notifications popping up when a message is received while that chat is open * Fix for cancelling notifications, works now. And scroll to bottom of conversation upon new message * Fix: Channels help grammer fix (#1452) * remove outdated TCP not available on Apple devices (#1450) * Update initial onboarding view * remove toggle gating for mac * Update crash reporting opt out in real time * Update onboarding text --------- Co-authored-by: Gnome Adrift <646322+gnomeadrift@users.noreply.github.com> Co-authored-by: Zain Kergaye <62440012+ZainKergaye@users.noreply.github.com> Co-authored-by: NillRudd <102033730+NillRudd@users.noreply.github.com> * UserEntity: add mostRecentMessage and unreadMessages with early exit when lastMessage is nil, and fetch 1 row (not N) otherwise * UserList: replace 5 slow calls to user.messageList with new fast calls * NodeList: always put the connected node at the top of list (if it matches the node filters) * ChannelEntity: add faster mostRecentPrivateMessage and unreadMessages which fetch 1 row (not N) * ChannelList: replace 5 calls to channel.allPrivateMessage with new fast calls * Fix incorrect appState.unreadDirectMessages calculations * MyInfoEntity: also fix unreadMessages count here to be fast, and use it for appState.unreadChannelMessages * UserMessageList: use @FetchRequest to prevent the N^2 behavior that was happening in calls to allPrivateMessages * Refactor ChannelEntityExtension and MyInfoEntityExtension to be more similar to UserEntityExtension * Remove SwiftUI-infinite-loop-causing `.id(redrawTapbacksTrigger)` in ChannelMessageList and UserMessageList (duplicate row ids) * MyInfoEntityExtension: exclude emoji tapbacks (which never get marked as read anyway) from unread message count * Add SaveChannelLinkData so MessageText and MeshtasticApp can use .sheet(item: ...) and avoid infinite loop hang due to Binding rebuild * ChannelMessageList and UserMessageList: switch to stable messageId for ForEach SwiftUI row identity * ChannelMessageList and UserMessageList: debouncedScrollToBottom; keyboardWillShowNotification/keyboardDidShowNotification * ChannelMessageList and UserMessageList: scroll to bottom onFirstAppear * ChannelMessageList and UserMessageList: block spurious markMessagesAsRead when this View is not active --------- Co-authored-by: Garth Vander Houwen <garth@meshtastic.com> Co-authored-by: Gnome Adrift <646322+gnomeadrift@users.noreply.github.com> Co-authored-by: Zain Kergaye <62440012+ZainKergaye@users.noreply.github.com> Co-authored-by: NillRudd <102033730+NillRudd@users.noreply.github.com> * message-list-performance: revert scrolling changes (#1472) * Reverte0f0b4a0f7(ChannelMessageList and UserMessageList: scroll to bottom onFirstAppear) * Revert "ChannelMessageList and UserMessageList: debouncedScrollToBottom; keyboardWillShowNotification/keyboardDidShowNotification" This reverts commitee1a7c4415. --------- Co-authored-by: Gnome Adrift <646322+gnomeadrift@users.noreply.github.com> Co-authored-by: Zain Kergaye <62440012+ZainKergaye@users.noreply.github.com> Co-authored-by: NillRudd <102033730+NillRudd@users.noreply.github.com> Co-authored-by: Jake-B <jake-b@users.noreply.github.com> Co-authored-by: Mike Robbins <mrobbins@alum.mit.edu> * Explicitly set unmessagable, seems unnessary * Add back missing mesh map features * Fix: "Retrieving nodes" significantly slower after reconnect extracted from #1424 (#1477) * Fix: "Retrieving nodes" significantly slower after reconnect (#1424) The node database retrieval was calling context.save() for every single NodeInfo packet received (250 saves for 250 nodes). This caused severe performance degradation on reconnect when CoreData had accumulated state. Root Cause: - nodeInfoPacket() called context.save() immediately for each node - With 250 nodes, this meant 250 individual CoreData save operations - On first connection, CoreData is fresh and fast - On reconnect, CoreData has accumulated change tracking, undo management, and memory pressure, making each save progressively slower - This resulted in 10+ second retrieval times vs 1-2 seconds initially Solution: - Added deferSave parameter to nodeInfoPacket() function - During database retrieval (.retrievingDatabase state), defer all saves - Perform a single batch save when database retrieval completes (when NONCE_ONLY_DB configCompleteID is received) - This reduces 250 saves to 1 save Performance Impact: - Eliminates N individual saves during node database sync - Reduces database retrieval time back to 1-2 seconds on reconnect - Matches first-connection performance consistently Fixes #1424 * Revert *MessageListUnified files --------- Co-authored-by: Martin Bogomolni <martinbogo@gmail.com> Co-authored-by: Jake-B <jake-b@users.noreply.github.com> * Hide route lines filter from mesh map * Mesh Map: fuzz imprecise locations so they're distinguishable and clickable at the highest zoom levels (#1478) Co-authored-by: Garth Vander Houwen <garth@meshtastic.com> * Fix bad merge * Update Meshtastic/Extensions/CoreData/UserEntityExtension.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Meshtastic/Views/Nodes/Helpers/Map/MapContent/MeshMapContent.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Meshtastic/Extensions/CoreData/ChannelEntityExtension.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Meshtastic/Extensions/CoreData/MyInfoEntityExtension.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Meshtastic/Extensions/CoreData/ChannelEntityExtension.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Keep list of previous manual connections (#1484) * Keep list of previous manual connections * More descriptive manual connection rows * Merge fixes and new way to show IP on Connect view --------- Co-authored-by: Jake-B <jake-b@users.noreply.github.com> * Show who relayed messages (#1486) * Add identification for node that relayed text messages and add count for ammount of relayers of your message * Ack Relays * upsertPositionPacket: don't use future timestamps to set node's lastHeard (#1488) * R1 NEO * Neo * Update Meshtastic/Views/Settings/AppSettings.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove bad if * Git rid of extra environment variable * Update Meshtastic/Accessory/Transports/TCP/TCPTransport.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * MeshMap performance: quick wins (#1490) * MeshMap: change onMapCameraChange frequency to .onEnd so that zooming doesn't cause continuous SwiftUI reevaluation on every frame * MeshMapContent: factor out reducedPrecisionMapCircles into a separate function * MeshMapContent: when multiple reducedPrecisionCircles have the same (lat,lon,radius), just draw one (big perf boost in dense areas) * NodeMap performance improvements for high # positions history (#1480) * NodeMapContent: move Route Lines out of ForEach * NodeMapContent: move Convex Hull out of ForEach * NodeMapContent: Replace `position.nodePosition?` with `node` * NodeMapContent: drop unnecessary LazyVStack in showNodeHistory * NodeMapContent: hoist out nodeColorSwift * Move lineCoords, loraCoords calculations within showRouteLines, showConvexHull respectively * Hoist out repeated node.metadata?.positionFlags lookups / PositionFlags creation * NodeMapContent: remove unused @State * NodeMapSwiftUI: add NodeMapContentEquatableWrapper and NodeMapContentSignature to prevent frequent NodeMapContent recomputation and infinite render loops * NodeMapSwiftUI: disable animation during SwiftUI transactions * NodeMapContent: hoist nodeBorderColor and set allowsHitTesting(false) on history point views * NodeMapContent: prerenderHistoryPointCircle and prerenderHistoryPointArrow to avoid thousands of vector draw operations * NodeMapContent: Shared coordinate list for Route Lines and Convex Hull * NodeMapContent.prerenderHistoryPointArrow: add .frame(width: 16, height: 16) * Fix wantRangeTestPackets to correctly follow rangeTestConfig.enabled (#1489) * Fix interval drop down formatter * Clean up channel qr code functionality. * perferredPeripheralId fix * Set opt in * Retry once 5 second timer. dont throw the error * Queue for peripherals * Fix: hoplimit of dms would always fallback to hops away of the node even when configured hops was higher (#1495) * fix hops setting in dms * Fix hops for exchange position * Final fix * Don't favorite client base * Update device hardware * Prevent nil environment metrics * Bump datadog sdk * fix setting device telemetry enabled (#1515) * Update Muzi R1 Neo to actively supported * fix setting device telemetry enabled --------- Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz> Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * Don't subscribe to mqtt topic if downlink is not on (#1501) * Dont sub if no downlink * moved reload mqtt connect config * Preview enabled in connected devices (#1509) * Update Muzi R1 Neo to actively supported * Preview enabled in connected devices * Fixing indentation * Fixing indentation --------- Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz> Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * UpdateCoreData.updateAnyPacketFrom: mirror firmware's lastHeard/snr/rssi/hopsAway update logic from NodeDB::updateFrom (#1492) * `CLIENT_BASE` add-favorite/role-change confirmation dialog (#1493) * FavoriteNodeButton: refactor task out * AccessoryManager.connectedDeviceRole helper * FavoriteNodeButton: show confirmation dialog when a CLIENT_BASE is trying to add a favorite * addContactFromURL: add comment referencing upcoming change in https://github.com/meshtastic/firmware/pull/8495 * DeviceConfig: role picker: show a warning when selecting CLIENT_BASE, similar to warning shown for ROUTER * Adjust device configuration Client Base warning text * Compass view (#1521) * Added compass view * Added Compass View * Node colors in compass * Update Muzi R1 Neo to actively supported * Update PositionPopover.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update CompassView.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update CompassView.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Meshtastic/Views/Helpers/CompassView.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Meshtastic/Views/Helpers/CompassView.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Benjamin Faershtein <119711889+RCGV1@users.noreply.github.com> Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz> Co-authored-by: Ben Meadors <benmmeadors@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove discovery queue * revert problematic retry functionalliy * format file * Update & improve zh-Hans translation (#1523) * Update Muzi R1 Neo to actively supported * update & improve zh-Hans translation rt --------- Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz> Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * Update protobufs to 2.7.1 * Add long-turbo preset * Disable Range Test module when primary channel is public/unsecured (#1512) * Update Muzi R1 Neo to actively supported * Disable Range Test module when primary channel is public/unsecured Updated RangeTestConfig.swift to determine whether the primary channel (index 0) is operating without encryption or with a 1-byte minimal PSK. Disabled Range Test UI controls when on a public/default channel to prevent user interaction. Added safety enforcement in the save operation: Range Test enabled flag is automatically forced to false before sending updates to the device. Introduced a computed property isPrimaryChannelPublic following existing code patterns and security indicators (e.g., hexDescription PSK length). Matches the behavior implemented in the Android client for consistent policy across platforms. --------- Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz> Co-authored-by: Ben Meadors <benmmeadors@gmail.com> * Add new device images * Remove print statement, get rid of cut and paste error --------- Co-authored-by: Gnome Adrift <646322+gnomeadrift@users.noreply.github.com> Co-authored-by: Zain Kergaye <62440012+ZainKergaye@users.noreply.github.com> Co-authored-by: NillRudd <102033730+NillRudd@users.noreply.github.com> Co-authored-by: Jake-B <jake-b@users.noreply.github.com> Co-authored-by: Mike Robbins <mrobbins@alum.mit.edu> Co-authored-by: Martin Bogomolni <martinbogo@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: jake-b <1012393+jake-b@users.noreply.github.com> Co-authored-by: Benjamin Faershtein <119711889+RCGV1@users.noreply.github.com> Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz> Co-authored-by: Ben Meadors <benmmeadors@gmail.com> Co-authored-by: Charles Pinesky <25388414+Vaidios@users.noreply.github.com> Co-authored-by: Radio <35003866+radiolee@users.noreply.github.com> Co-authored-by: Jason Houk <dubsectordevelopment@gmail.com>
590 lines
20 KiB
Swift
590 lines
20 KiB
Swift
// DO NOT EDIT.
|
|
// swift-format-ignore-file
|
|
// swiftlint:disable all
|
|
//
|
|
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
|
// Source: meshtastic/storeforward.proto
|
|
//
|
|
// For information on using the generated types, please see the documentation:
|
|
// https://github.com/apple/swift-protobuf/
|
|
|
|
import Foundation
|
|
import SwiftProtobuf
|
|
|
|
// If the compiler emits an error on this type, it is because this file
|
|
// was generated by a version of the `protoc` Swift plug-in that is
|
|
// incompatible with the version of SwiftProtobuf to which you are linking.
|
|
// Please ensure that you are building against the same version of the API
|
|
// that was used to generate this file.
|
|
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
|
|
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
|
|
typealias Version = _2
|
|
}
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public struct StoreAndForward: Sendable {
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
// methods supported on all messages.
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public var rr: StoreAndForward.RequestResponse = .unset
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public var variant: StoreAndForward.OneOf_Variant? = nil
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public var stats: StoreAndForward.Statistics {
|
|
get {
|
|
if case .stats(let v)? = variant {return v}
|
|
return StoreAndForward.Statistics()
|
|
}
|
|
set {variant = .stats(newValue)}
|
|
}
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public var history: StoreAndForward.History {
|
|
get {
|
|
if case .history(let v)? = variant {return v}
|
|
return StoreAndForward.History()
|
|
}
|
|
set {variant = .history(newValue)}
|
|
}
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public var heartbeat: StoreAndForward.Heartbeat {
|
|
get {
|
|
if case .heartbeat(let v)? = variant {return v}
|
|
return StoreAndForward.Heartbeat()
|
|
}
|
|
set {variant = .heartbeat(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Text from history message.
|
|
public var text: Data {
|
|
get {
|
|
if case .text(let v)? = variant {return v}
|
|
return Data()
|
|
}
|
|
set {variant = .text(newValue)}
|
|
}
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public enum OneOf_Variant: Equatable, Sendable {
|
|
///
|
|
/// TODO: REPLACE
|
|
case stats(StoreAndForward.Statistics)
|
|
///
|
|
/// TODO: REPLACE
|
|
case history(StoreAndForward.History)
|
|
///
|
|
/// TODO: REPLACE
|
|
case heartbeat(StoreAndForward.Heartbeat)
|
|
///
|
|
/// Text from history message.
|
|
case text(Data)
|
|
|
|
}
|
|
|
|
///
|
|
/// 001 - 063 = From Router
|
|
/// 064 - 127 = From Client
|
|
public enum RequestResponse: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|
public typealias RawValue = Int
|
|
|
|
///
|
|
/// Unset/unused
|
|
case unset // = 0
|
|
|
|
///
|
|
/// Router is an in error state.
|
|
case routerError // = 1
|
|
|
|
///
|
|
/// Router heartbeat
|
|
case routerHeartbeat // = 2
|
|
|
|
///
|
|
/// Router has requested the client respond. This can work as a
|
|
/// "are you there" message.
|
|
case routerPing // = 3
|
|
|
|
///
|
|
/// The response to a "Ping"
|
|
case routerPong // = 4
|
|
|
|
///
|
|
/// Router is currently busy. Please try again later.
|
|
case routerBusy // = 5
|
|
|
|
///
|
|
/// Router is responding to a request for history.
|
|
case routerHistory // = 6
|
|
|
|
///
|
|
/// Router is responding to a request for stats.
|
|
case routerStats // = 7
|
|
|
|
///
|
|
/// Router sends a text message from its history that was a direct message.
|
|
case routerTextDirect // = 8
|
|
|
|
///
|
|
/// Router sends a text message from its history that was a broadcast.
|
|
case routerTextBroadcast // = 9
|
|
|
|
///
|
|
/// Client is an in error state.
|
|
case clientError // = 64
|
|
|
|
///
|
|
/// Client has requested a replay from the router.
|
|
case clientHistory // = 65
|
|
|
|
///
|
|
/// Client has requested stats from the router.
|
|
case clientStats // = 66
|
|
|
|
///
|
|
/// Client has requested the router respond. This can work as a
|
|
/// "are you there" message.
|
|
case clientPing // = 67
|
|
|
|
///
|
|
/// The response to a "Ping"
|
|
case clientPong // = 68
|
|
|
|
///
|
|
/// Client has requested that the router abort processing the client's request
|
|
case clientAbort // = 106
|
|
case UNRECOGNIZED(Int)
|
|
|
|
public init() {
|
|
self = .unset
|
|
}
|
|
|
|
public init?(rawValue: Int) {
|
|
switch rawValue {
|
|
case 0: self = .unset
|
|
case 1: self = .routerError
|
|
case 2: self = .routerHeartbeat
|
|
case 3: self = .routerPing
|
|
case 4: self = .routerPong
|
|
case 5: self = .routerBusy
|
|
case 6: self = .routerHistory
|
|
case 7: self = .routerStats
|
|
case 8: self = .routerTextDirect
|
|
case 9: self = .routerTextBroadcast
|
|
case 64: self = .clientError
|
|
case 65: self = .clientHistory
|
|
case 66: self = .clientStats
|
|
case 67: self = .clientPing
|
|
case 68: self = .clientPong
|
|
case 106: self = .clientAbort
|
|
default: self = .UNRECOGNIZED(rawValue)
|
|
}
|
|
}
|
|
|
|
public var rawValue: Int {
|
|
switch self {
|
|
case .unset: return 0
|
|
case .routerError: return 1
|
|
case .routerHeartbeat: return 2
|
|
case .routerPing: return 3
|
|
case .routerPong: return 4
|
|
case .routerBusy: return 5
|
|
case .routerHistory: return 6
|
|
case .routerStats: return 7
|
|
case .routerTextDirect: return 8
|
|
case .routerTextBroadcast: return 9
|
|
case .clientError: return 64
|
|
case .clientHistory: return 65
|
|
case .clientStats: return 66
|
|
case .clientPing: return 67
|
|
case .clientPong: return 68
|
|
case .clientAbort: return 106
|
|
case .UNRECOGNIZED(let i): return i
|
|
}
|
|
}
|
|
|
|
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
public static let allCases: [StoreAndForward.RequestResponse] = [
|
|
.unset,
|
|
.routerError,
|
|
.routerHeartbeat,
|
|
.routerPing,
|
|
.routerPong,
|
|
.routerBusy,
|
|
.routerHistory,
|
|
.routerStats,
|
|
.routerTextDirect,
|
|
.routerTextBroadcast,
|
|
.clientError,
|
|
.clientHistory,
|
|
.clientStats,
|
|
.clientPing,
|
|
.clientPong,
|
|
.clientAbort,
|
|
]
|
|
|
|
}
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public struct Statistics: Sendable {
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
// methods supported on all messages.
|
|
|
|
///
|
|
/// Number of messages we have ever seen
|
|
public var messagesTotal: UInt32 = 0
|
|
|
|
///
|
|
/// Number of messages we have currently saved our history.
|
|
public var messagesSaved: UInt32 = 0
|
|
|
|
///
|
|
/// Maximum number of messages we will save
|
|
public var messagesMax: UInt32 = 0
|
|
|
|
///
|
|
/// Router uptime in seconds
|
|
public var upTime: UInt32 = 0
|
|
|
|
///
|
|
/// Number of times any client sent a request to the S&F.
|
|
public var requests: UInt32 = 0
|
|
|
|
///
|
|
/// Number of times the history was requested.
|
|
public var requestsHistory: UInt32 = 0
|
|
|
|
///
|
|
/// Is the heartbeat enabled on the server?
|
|
public var heartbeat: Bool = false
|
|
|
|
///
|
|
/// Maximum number of messages the server will return.
|
|
public var returnMax: UInt32 = 0
|
|
|
|
///
|
|
/// Maximum history window in minutes the server will return messages from.
|
|
public var returnWindow: UInt32 = 0
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
}
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public struct History: Sendable {
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
// methods supported on all messages.
|
|
|
|
///
|
|
/// Number of that will be sent to the client
|
|
public var historyMessages: UInt32 = 0
|
|
|
|
///
|
|
/// The window of messages that was used to filter the history client requested
|
|
public var window: UInt32 = 0
|
|
|
|
///
|
|
/// Index in the packet history of the last message sent in a previous request to the server.
|
|
/// Will be sent to the client before sending the history and can be set in a subsequent request to avoid getting packets the server already sent to the client.
|
|
public var lastRequest: UInt32 = 0
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
}
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public struct Heartbeat: Sendable {
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
// methods supported on all messages.
|
|
|
|
///
|
|
/// Period in seconds that the heartbeat is sent out that will be sent to the client
|
|
public var period: UInt32 = 0
|
|
|
|
///
|
|
/// If set, this is not the primary Store & Forward router on the mesh
|
|
public var secondary: UInt32 = 0
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
}
|
|
|
|
public init() {}
|
|
}
|
|
|
|
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
|
|
|
fileprivate let _protobuf_package = "meshtastic"
|
|
|
|
extension StoreAndForward: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = _protobuf_package + ".StoreAndForward"
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}rr\0\u{1}stats\0\u{1}history\0\u{1}heartbeat\0\u{1}text\0")
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every case branch when no optimizations are
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
switch fieldNumber {
|
|
case 1: try { try decoder.decodeSingularEnumField(value: &self.rr) }()
|
|
case 2: try {
|
|
var v: StoreAndForward.Statistics?
|
|
var hadOneofValue = false
|
|
if let current = self.variant {
|
|
hadOneofValue = true
|
|
if case .stats(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.variant = .stats(v)
|
|
}
|
|
}()
|
|
case 3: try {
|
|
var v: StoreAndForward.History?
|
|
var hadOneofValue = false
|
|
if let current = self.variant {
|
|
hadOneofValue = true
|
|
if case .history(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.variant = .history(v)
|
|
}
|
|
}()
|
|
case 4: try {
|
|
var v: StoreAndForward.Heartbeat?
|
|
var hadOneofValue = false
|
|
if let current = self.variant {
|
|
hadOneofValue = true
|
|
if case .heartbeat(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.variant = .heartbeat(v)
|
|
}
|
|
}()
|
|
case 5: try {
|
|
var v: Data?
|
|
try decoder.decodeSingularBytesField(value: &v)
|
|
if let v = v {
|
|
if self.variant != nil {try decoder.handleConflictingOneOf()}
|
|
self.variant = .text(v)
|
|
}
|
|
}()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every if/case branch local when no optimizations
|
|
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
|
// https://github.com/apple/swift-protobuf/issues/1182
|
|
if self.rr != .unset {
|
|
try visitor.visitSingularEnumField(value: self.rr, fieldNumber: 1)
|
|
}
|
|
switch self.variant {
|
|
case .stats?: try {
|
|
guard case .stats(let v)? = self.variant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
|
}()
|
|
case .history?: try {
|
|
guard case .history(let v)? = self.variant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
|
|
}()
|
|
case .heartbeat?: try {
|
|
guard case .heartbeat(let v)? = self.variant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
|
|
}()
|
|
case .text?: try {
|
|
guard case .text(let v)? = self.variant else { preconditionFailure() }
|
|
try visitor.visitSingularBytesField(value: v, fieldNumber: 5)
|
|
}()
|
|
case nil: break
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: StoreAndForward, rhs: StoreAndForward) -> Bool {
|
|
if lhs.rr != rhs.rr {return false}
|
|
if lhs.variant != rhs.variant {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension StoreAndForward.RequestResponse: SwiftProtobuf._ProtoNameProviding {
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNSET\0\u{1}ROUTER_ERROR\0\u{1}ROUTER_HEARTBEAT\0\u{1}ROUTER_PING\0\u{1}ROUTER_PONG\0\u{1}ROUTER_BUSY\0\u{1}ROUTER_HISTORY\0\u{1}ROUTER_STATS\0\u{1}ROUTER_TEXT_DIRECT\0\u{1}ROUTER_TEXT_BROADCAST\0\u{2}7CLIENT_ERROR\0\u{1}CLIENT_HISTORY\0\u{1}CLIENT_STATS\0\u{1}CLIENT_PING\0\u{1}CLIENT_PONG\0\u{2}&CLIENT_ABORT\0")
|
|
}
|
|
|
|
extension StoreAndForward.Statistics: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = StoreAndForward.protoMessageName + ".Statistics"
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}messages_total\0\u{3}messages_saved\0\u{3}messages_max\0\u{3}up_time\0\u{1}requests\0\u{3}requests_history\0\u{1}heartbeat\0\u{3}return_max\0\u{3}return_window\0")
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every case branch when no optimizations are
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
switch fieldNumber {
|
|
case 1: try { try decoder.decodeSingularUInt32Field(value: &self.messagesTotal) }()
|
|
case 2: try { try decoder.decodeSingularUInt32Field(value: &self.messagesSaved) }()
|
|
case 3: try { try decoder.decodeSingularUInt32Field(value: &self.messagesMax) }()
|
|
case 4: try { try decoder.decodeSingularUInt32Field(value: &self.upTime) }()
|
|
case 5: try { try decoder.decodeSingularUInt32Field(value: &self.requests) }()
|
|
case 6: try { try decoder.decodeSingularUInt32Field(value: &self.requestsHistory) }()
|
|
case 7: try { try decoder.decodeSingularBoolField(value: &self.heartbeat) }()
|
|
case 8: try { try decoder.decodeSingularUInt32Field(value: &self.returnMax) }()
|
|
case 9: try { try decoder.decodeSingularUInt32Field(value: &self.returnWindow) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if self.messagesTotal != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.messagesTotal, fieldNumber: 1)
|
|
}
|
|
if self.messagesSaved != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.messagesSaved, fieldNumber: 2)
|
|
}
|
|
if self.messagesMax != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.messagesMax, fieldNumber: 3)
|
|
}
|
|
if self.upTime != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.upTime, fieldNumber: 4)
|
|
}
|
|
if self.requests != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.requests, fieldNumber: 5)
|
|
}
|
|
if self.requestsHistory != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.requestsHistory, fieldNumber: 6)
|
|
}
|
|
if self.heartbeat != false {
|
|
try visitor.visitSingularBoolField(value: self.heartbeat, fieldNumber: 7)
|
|
}
|
|
if self.returnMax != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.returnMax, fieldNumber: 8)
|
|
}
|
|
if self.returnWindow != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.returnWindow, fieldNumber: 9)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: StoreAndForward.Statistics, rhs: StoreAndForward.Statistics) -> Bool {
|
|
if lhs.messagesTotal != rhs.messagesTotal {return false}
|
|
if lhs.messagesSaved != rhs.messagesSaved {return false}
|
|
if lhs.messagesMax != rhs.messagesMax {return false}
|
|
if lhs.upTime != rhs.upTime {return false}
|
|
if lhs.requests != rhs.requests {return false}
|
|
if lhs.requestsHistory != rhs.requestsHistory {return false}
|
|
if lhs.heartbeat != rhs.heartbeat {return false}
|
|
if lhs.returnMax != rhs.returnMax {return false}
|
|
if lhs.returnWindow != rhs.returnWindow {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension StoreAndForward.History: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = StoreAndForward.protoMessageName + ".History"
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}history_messages\0\u{1}window\0\u{3}last_request\0")
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every case branch when no optimizations are
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
switch fieldNumber {
|
|
case 1: try { try decoder.decodeSingularUInt32Field(value: &self.historyMessages) }()
|
|
case 2: try { try decoder.decodeSingularUInt32Field(value: &self.window) }()
|
|
case 3: try { try decoder.decodeSingularUInt32Field(value: &self.lastRequest) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if self.historyMessages != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.historyMessages, fieldNumber: 1)
|
|
}
|
|
if self.window != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.window, fieldNumber: 2)
|
|
}
|
|
if self.lastRequest != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.lastRequest, fieldNumber: 3)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: StoreAndForward.History, rhs: StoreAndForward.History) -> Bool {
|
|
if lhs.historyMessages != rhs.historyMessages {return false}
|
|
if lhs.window != rhs.window {return false}
|
|
if lhs.lastRequest != rhs.lastRequest {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension StoreAndForward.Heartbeat: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = StoreAndForward.protoMessageName + ".Heartbeat"
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}period\0\u{1}secondary\0")
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every case branch when no optimizations are
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
switch fieldNumber {
|
|
case 1: try { try decoder.decodeSingularUInt32Field(value: &self.period) }()
|
|
case 2: try { try decoder.decodeSingularUInt32Field(value: &self.secondary) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if self.period != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.period, fieldNumber: 1)
|
|
}
|
|
if self.secondary != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.secondary, fieldNumber: 2)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: StoreAndForward.Heartbeat, rhs: StoreAndForward.Heartbeat) -> Bool {
|
|
if lhs.period != rhs.period {return false}
|
|
if lhs.secondary != rhs.secondary {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|