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>
2250 lines
80 KiB
Swift
2250 lines
80 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/admin.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
|
|
}
|
|
|
|
///
|
|
/// This message is handled by the Admin module and is responsible for all settings/channel read/write operations.
|
|
/// This message is used to do settings operations to both remote AND local nodes.
|
|
/// (Prior to 1.2 these operations were done via special ToRadio operations)
|
|
public struct AdminMessage: 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.
|
|
|
|
///
|
|
/// The node generates this key and sends it with any get_x_response packets.
|
|
/// The client MUST include the same key with any set_x commands. Key expires after 300 seconds.
|
|
/// Prevents replay attacks for admin messages.
|
|
public var sessionPasskey: Data = Data()
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public var payloadVariant: AdminMessage.OneOf_PayloadVariant? = nil
|
|
|
|
///
|
|
/// Send the specified channel in the response to this message
|
|
/// NOTE: This field is sent with the channel index + 1 (to ensure we never try to send 'zero' - which protobufs treats as not present)
|
|
public var getChannelRequest: UInt32 {
|
|
get {
|
|
if case .getChannelRequest(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .getChannelRequest(newValue)}
|
|
}
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public var getChannelResponse: Channel {
|
|
get {
|
|
if case .getChannelResponse(let v)? = payloadVariant {return v}
|
|
return Channel()
|
|
}
|
|
set {payloadVariant = .getChannelResponse(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Send the current owner data in the response to this message.
|
|
public var getOwnerRequest: Bool {
|
|
get {
|
|
if case .getOwnerRequest(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .getOwnerRequest(newValue)}
|
|
}
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public var getOwnerResponse: User {
|
|
get {
|
|
if case .getOwnerResponse(let v)? = payloadVariant {return v}
|
|
return User()
|
|
}
|
|
set {payloadVariant = .getOwnerResponse(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Ask for the following config data to be sent
|
|
public var getConfigRequest: AdminMessage.ConfigType {
|
|
get {
|
|
if case .getConfigRequest(let v)? = payloadVariant {return v}
|
|
return .deviceConfig
|
|
}
|
|
set {payloadVariant = .getConfigRequest(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Send the current Config in the response to this message.
|
|
public var getConfigResponse: Config {
|
|
get {
|
|
if case .getConfigResponse(let v)? = payloadVariant {return v}
|
|
return Config()
|
|
}
|
|
set {payloadVariant = .getConfigResponse(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Ask for the following config data to be sent
|
|
public var getModuleConfigRequest: AdminMessage.ModuleConfigType {
|
|
get {
|
|
if case .getModuleConfigRequest(let v)? = payloadVariant {return v}
|
|
return .mqttConfig
|
|
}
|
|
set {payloadVariant = .getModuleConfigRequest(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Send the current Config in the response to this message.
|
|
public var getModuleConfigResponse: ModuleConfig {
|
|
get {
|
|
if case .getModuleConfigResponse(let v)? = payloadVariant {return v}
|
|
return ModuleConfig()
|
|
}
|
|
set {payloadVariant = .getModuleConfigResponse(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Get the Canned Message Module messages in the response to this message.
|
|
public var getCannedMessageModuleMessagesRequest: Bool {
|
|
get {
|
|
if case .getCannedMessageModuleMessagesRequest(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .getCannedMessageModuleMessagesRequest(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Get the Canned Message Module messages in the response to this message.
|
|
public var getCannedMessageModuleMessagesResponse: String {
|
|
get {
|
|
if case .getCannedMessageModuleMessagesResponse(let v)? = payloadVariant {return v}
|
|
return String()
|
|
}
|
|
set {payloadVariant = .getCannedMessageModuleMessagesResponse(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Request the node to send device metadata (firmware, protobuf version, etc)
|
|
public var getDeviceMetadataRequest: Bool {
|
|
get {
|
|
if case .getDeviceMetadataRequest(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .getDeviceMetadataRequest(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Device metadata response
|
|
public var getDeviceMetadataResponse: DeviceMetadata {
|
|
get {
|
|
if case .getDeviceMetadataResponse(let v)? = payloadVariant {return v}
|
|
return DeviceMetadata()
|
|
}
|
|
set {payloadVariant = .getDeviceMetadataResponse(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Get the Ringtone in the response to this message.
|
|
public var getRingtoneRequest: Bool {
|
|
get {
|
|
if case .getRingtoneRequest(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .getRingtoneRequest(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Get the Ringtone in the response to this message.
|
|
public var getRingtoneResponse: String {
|
|
get {
|
|
if case .getRingtoneResponse(let v)? = payloadVariant {return v}
|
|
return String()
|
|
}
|
|
set {payloadVariant = .getRingtoneResponse(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Request the node to send it's connection status
|
|
public var getDeviceConnectionStatusRequest: Bool {
|
|
get {
|
|
if case .getDeviceConnectionStatusRequest(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .getDeviceConnectionStatusRequest(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Device connection status response
|
|
public var getDeviceConnectionStatusResponse: DeviceConnectionStatus {
|
|
get {
|
|
if case .getDeviceConnectionStatusResponse(let v)? = payloadVariant {return v}
|
|
return DeviceConnectionStatus()
|
|
}
|
|
set {payloadVariant = .getDeviceConnectionStatusResponse(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Setup a node for licensed amateur (ham) radio operation
|
|
public var setHamMode: HamParameters {
|
|
get {
|
|
if case .setHamMode(let v)? = payloadVariant {return v}
|
|
return HamParameters()
|
|
}
|
|
set {payloadVariant = .setHamMode(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Get the mesh's nodes with their available gpio pins for RemoteHardware module use
|
|
public var getNodeRemoteHardwarePinsRequest: Bool {
|
|
get {
|
|
if case .getNodeRemoteHardwarePinsRequest(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .getNodeRemoteHardwarePinsRequest(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Respond with the mesh's nodes with their available gpio pins for RemoteHardware module use
|
|
public var getNodeRemoteHardwarePinsResponse: NodeRemoteHardwarePinsResponse {
|
|
get {
|
|
if case .getNodeRemoteHardwarePinsResponse(let v)? = payloadVariant {return v}
|
|
return NodeRemoteHardwarePinsResponse()
|
|
}
|
|
set {payloadVariant = .getNodeRemoteHardwarePinsResponse(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Enter (UF2) DFU mode
|
|
/// Only implemented on NRF52 currently
|
|
public var enterDfuModeRequest: Bool {
|
|
get {
|
|
if case .enterDfuModeRequest(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .enterDfuModeRequest(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Delete the file by the specified path from the device
|
|
public var deleteFileRequest: String {
|
|
get {
|
|
if case .deleteFileRequest(let v)? = payloadVariant {return v}
|
|
return String()
|
|
}
|
|
set {payloadVariant = .deleteFileRequest(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set zero and offset for scale chips
|
|
public var setScale: UInt32 {
|
|
get {
|
|
if case .setScale(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .setScale(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Backup the node's preferences
|
|
public var backupPreferences: AdminMessage.BackupLocation {
|
|
get {
|
|
if case .backupPreferences(let v)? = payloadVariant {return v}
|
|
return .flash
|
|
}
|
|
set {payloadVariant = .backupPreferences(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Restore the node's preferences
|
|
public var restorePreferences: AdminMessage.BackupLocation {
|
|
get {
|
|
if case .restorePreferences(let v)? = payloadVariant {return v}
|
|
return .flash
|
|
}
|
|
set {payloadVariant = .restorePreferences(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Remove backups of the node's preferences
|
|
public var removeBackupPreferences: AdminMessage.BackupLocation {
|
|
get {
|
|
if case .removeBackupPreferences(let v)? = payloadVariant {return v}
|
|
return .flash
|
|
}
|
|
set {payloadVariant = .removeBackupPreferences(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Send an input event to the node.
|
|
/// This is used to trigger physical input events like button presses, touch events, etc.
|
|
public var sendInputEvent: AdminMessage.InputEvent {
|
|
get {
|
|
if case .sendInputEvent(let v)? = payloadVariant {return v}
|
|
return AdminMessage.InputEvent()
|
|
}
|
|
set {payloadVariant = .sendInputEvent(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set the owner for this node
|
|
public var setOwner: User {
|
|
get {
|
|
if case .setOwner(let v)? = payloadVariant {return v}
|
|
return User()
|
|
}
|
|
set {payloadVariant = .setOwner(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set channels (using the new API).
|
|
/// A special channel is the "primary channel".
|
|
/// The other records are secondary channels.
|
|
/// Note: only one channel can be marked as primary.
|
|
/// If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically.
|
|
public var setChannel: Channel {
|
|
get {
|
|
if case .setChannel(let v)? = payloadVariant {return v}
|
|
return Channel()
|
|
}
|
|
set {payloadVariant = .setChannel(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set the current Config
|
|
public var setConfig: Config {
|
|
get {
|
|
if case .setConfig(let v)? = payloadVariant {return v}
|
|
return Config()
|
|
}
|
|
set {payloadVariant = .setConfig(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set the current Config
|
|
public var setModuleConfig: ModuleConfig {
|
|
get {
|
|
if case .setModuleConfig(let v)? = payloadVariant {return v}
|
|
return ModuleConfig()
|
|
}
|
|
set {payloadVariant = .setModuleConfig(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set the Canned Message Module messages text.
|
|
public var setCannedMessageModuleMessages: String {
|
|
get {
|
|
if case .setCannedMessageModuleMessages(let v)? = payloadVariant {return v}
|
|
return String()
|
|
}
|
|
set {payloadVariant = .setCannedMessageModuleMessages(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set the ringtone for ExternalNotification.
|
|
public var setRingtoneMessage: String {
|
|
get {
|
|
if case .setRingtoneMessage(let v)? = payloadVariant {return v}
|
|
return String()
|
|
}
|
|
set {payloadVariant = .setRingtoneMessage(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Remove the node by the specified node-num from the NodeDB on the device
|
|
public var removeByNodenum: UInt32 {
|
|
get {
|
|
if case .removeByNodenum(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .removeByNodenum(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set specified node-num to be favorited on the NodeDB on the device
|
|
public var setFavoriteNode: UInt32 {
|
|
get {
|
|
if case .setFavoriteNode(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .setFavoriteNode(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set specified node-num to be un-favorited on the NodeDB on the device
|
|
public var removeFavoriteNode: UInt32 {
|
|
get {
|
|
if case .removeFavoriteNode(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .removeFavoriteNode(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set fixed position data on the node and then set the position.fixed_position = true
|
|
public var setFixedPosition: Position {
|
|
get {
|
|
if case .setFixedPosition(let v)? = payloadVariant {return v}
|
|
return Position()
|
|
}
|
|
set {payloadVariant = .setFixedPosition(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Clear fixed position coordinates and then set position.fixed_position = false
|
|
public var removeFixedPosition: Bool {
|
|
get {
|
|
if case .removeFixedPosition(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .removeFixedPosition(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set time only on the node
|
|
/// Convenience method to set the time on the node (as Net quality) without any other position data
|
|
public var setTimeOnly: UInt32 {
|
|
get {
|
|
if case .setTimeOnly(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .setTimeOnly(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Tell the node to send the stored ui data.
|
|
public var getUiConfigRequest: Bool {
|
|
get {
|
|
if case .getUiConfigRequest(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .getUiConfigRequest(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Reply stored device ui data.
|
|
public var getUiConfigResponse: DeviceUIConfig {
|
|
get {
|
|
if case .getUiConfigResponse(let v)? = payloadVariant {return v}
|
|
return DeviceUIConfig()
|
|
}
|
|
set {payloadVariant = .getUiConfigResponse(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Tell the node to store UI data persistently.
|
|
public var storeUiConfig: DeviceUIConfig {
|
|
get {
|
|
if case .storeUiConfig(let v)? = payloadVariant {return v}
|
|
return DeviceUIConfig()
|
|
}
|
|
set {payloadVariant = .storeUiConfig(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set specified node-num to be ignored on the NodeDB on the device
|
|
public var setIgnoredNode: UInt32 {
|
|
get {
|
|
if case .setIgnoredNode(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .setIgnoredNode(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Set specified node-num to be un-ignored on the NodeDB on the device
|
|
public var removeIgnoredNode: UInt32 {
|
|
get {
|
|
if case .removeIgnoredNode(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .removeIgnoredNode(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Begins an edit transaction for config, module config, owner, and channel settings changes
|
|
/// This will delay the standard *implicit* save to the file system and subsequent reboot behavior until committed (commit_edit_settings)
|
|
public var beginEditSettings: Bool {
|
|
get {
|
|
if case .beginEditSettings(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .beginEditSettings(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Commits an open transaction for any edits made to config, module config, owner, and channel settings
|
|
public var commitEditSettings: Bool {
|
|
get {
|
|
if case .commitEditSettings(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .commitEditSettings(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Add a contact (User) to the nodedb
|
|
public var addContact: SharedContact {
|
|
get {
|
|
if case .addContact(let v)? = payloadVariant {return v}
|
|
return SharedContact()
|
|
}
|
|
set {payloadVariant = .addContact(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Initiate or respond to a key verification request
|
|
public var keyVerification: KeyVerificationAdmin {
|
|
get {
|
|
if case .keyVerification(let v)? = payloadVariant {return v}
|
|
return KeyVerificationAdmin()
|
|
}
|
|
set {payloadVariant = .keyVerification(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Tell the node to factory reset config everything; all device state and configuration will be returned to factory defaults and BLE bonds will be cleared.
|
|
public var factoryResetDevice: Int32 {
|
|
get {
|
|
if case .factoryResetDevice(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .factoryResetDevice(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot)
|
|
/// Only Implemented for ESP32 Devices. This needs to be issued to send a new main firmware via bluetooth.
|
|
public var rebootOtaSeconds: Int32 {
|
|
get {
|
|
if case .rebootOtaSeconds(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .rebootOtaSeconds(newValue)}
|
|
}
|
|
|
|
///
|
|
/// This message is only supported for the simulator Portduino build.
|
|
/// If received the simulator will exit successfully.
|
|
public var exitSimulator: Bool {
|
|
get {
|
|
if case .exitSimulator(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .exitSimulator(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Tell the node to reboot in this many seconds (or <0 to cancel reboot)
|
|
public var rebootSeconds: Int32 {
|
|
get {
|
|
if case .rebootSeconds(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .rebootSeconds(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Tell the node to shutdown in this many seconds (or <0 to cancel shutdown)
|
|
public var shutdownSeconds: Int32 {
|
|
get {
|
|
if case .shutdownSeconds(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .shutdownSeconds(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Tell the node to factory reset config; all device state and configuration will be returned to factory defaults; BLE bonds will be preserved.
|
|
public var factoryResetConfig: Int32 {
|
|
get {
|
|
if case .factoryResetConfig(let v)? = payloadVariant {return v}
|
|
return 0
|
|
}
|
|
set {payloadVariant = .factoryResetConfig(newValue)}
|
|
}
|
|
|
|
///
|
|
/// Tell the node to reset the nodedb.
|
|
/// When true, favorites are preserved through reset.
|
|
public var nodedbReset: Bool {
|
|
get {
|
|
if case .nodedbReset(let v)? = payloadVariant {return v}
|
|
return false
|
|
}
|
|
set {payloadVariant = .nodedbReset(newValue)}
|
|
}
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public enum OneOf_PayloadVariant: Equatable, Sendable {
|
|
///
|
|
/// Send the specified channel in the response to this message
|
|
/// NOTE: This field is sent with the channel index + 1 (to ensure we never try to send 'zero' - which protobufs treats as not present)
|
|
case getChannelRequest(UInt32)
|
|
///
|
|
/// TODO: REPLACE
|
|
case getChannelResponse(Channel)
|
|
///
|
|
/// Send the current owner data in the response to this message.
|
|
case getOwnerRequest(Bool)
|
|
///
|
|
/// TODO: REPLACE
|
|
case getOwnerResponse(User)
|
|
///
|
|
/// Ask for the following config data to be sent
|
|
case getConfigRequest(AdminMessage.ConfigType)
|
|
///
|
|
/// Send the current Config in the response to this message.
|
|
case getConfigResponse(Config)
|
|
///
|
|
/// Ask for the following config data to be sent
|
|
case getModuleConfigRequest(AdminMessage.ModuleConfigType)
|
|
///
|
|
/// Send the current Config in the response to this message.
|
|
case getModuleConfigResponse(ModuleConfig)
|
|
///
|
|
/// Get the Canned Message Module messages in the response to this message.
|
|
case getCannedMessageModuleMessagesRequest(Bool)
|
|
///
|
|
/// Get the Canned Message Module messages in the response to this message.
|
|
case getCannedMessageModuleMessagesResponse(String)
|
|
///
|
|
/// Request the node to send device metadata (firmware, protobuf version, etc)
|
|
case getDeviceMetadataRequest(Bool)
|
|
///
|
|
/// Device metadata response
|
|
case getDeviceMetadataResponse(DeviceMetadata)
|
|
///
|
|
/// Get the Ringtone in the response to this message.
|
|
case getRingtoneRequest(Bool)
|
|
///
|
|
/// Get the Ringtone in the response to this message.
|
|
case getRingtoneResponse(String)
|
|
///
|
|
/// Request the node to send it's connection status
|
|
case getDeviceConnectionStatusRequest(Bool)
|
|
///
|
|
/// Device connection status response
|
|
case getDeviceConnectionStatusResponse(DeviceConnectionStatus)
|
|
///
|
|
/// Setup a node for licensed amateur (ham) radio operation
|
|
case setHamMode(HamParameters)
|
|
///
|
|
/// Get the mesh's nodes with their available gpio pins for RemoteHardware module use
|
|
case getNodeRemoteHardwarePinsRequest(Bool)
|
|
///
|
|
/// Respond with the mesh's nodes with their available gpio pins for RemoteHardware module use
|
|
case getNodeRemoteHardwarePinsResponse(NodeRemoteHardwarePinsResponse)
|
|
///
|
|
/// Enter (UF2) DFU mode
|
|
/// Only implemented on NRF52 currently
|
|
case enterDfuModeRequest(Bool)
|
|
///
|
|
/// Delete the file by the specified path from the device
|
|
case deleteFileRequest(String)
|
|
///
|
|
/// Set zero and offset for scale chips
|
|
case setScale(UInt32)
|
|
///
|
|
/// Backup the node's preferences
|
|
case backupPreferences(AdminMessage.BackupLocation)
|
|
///
|
|
/// Restore the node's preferences
|
|
case restorePreferences(AdminMessage.BackupLocation)
|
|
///
|
|
/// Remove backups of the node's preferences
|
|
case removeBackupPreferences(AdminMessage.BackupLocation)
|
|
///
|
|
/// Send an input event to the node.
|
|
/// This is used to trigger physical input events like button presses, touch events, etc.
|
|
case sendInputEvent(AdminMessage.InputEvent)
|
|
///
|
|
/// Set the owner for this node
|
|
case setOwner(User)
|
|
///
|
|
/// Set channels (using the new API).
|
|
/// A special channel is the "primary channel".
|
|
/// The other records are secondary channels.
|
|
/// Note: only one channel can be marked as primary.
|
|
/// If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically.
|
|
case setChannel(Channel)
|
|
///
|
|
/// Set the current Config
|
|
case setConfig(Config)
|
|
///
|
|
/// Set the current Config
|
|
case setModuleConfig(ModuleConfig)
|
|
///
|
|
/// Set the Canned Message Module messages text.
|
|
case setCannedMessageModuleMessages(String)
|
|
///
|
|
/// Set the ringtone for ExternalNotification.
|
|
case setRingtoneMessage(String)
|
|
///
|
|
/// Remove the node by the specified node-num from the NodeDB on the device
|
|
case removeByNodenum(UInt32)
|
|
///
|
|
/// Set specified node-num to be favorited on the NodeDB on the device
|
|
case setFavoriteNode(UInt32)
|
|
///
|
|
/// Set specified node-num to be un-favorited on the NodeDB on the device
|
|
case removeFavoriteNode(UInt32)
|
|
///
|
|
/// Set fixed position data on the node and then set the position.fixed_position = true
|
|
case setFixedPosition(Position)
|
|
///
|
|
/// Clear fixed position coordinates and then set position.fixed_position = false
|
|
case removeFixedPosition(Bool)
|
|
///
|
|
/// Set time only on the node
|
|
/// Convenience method to set the time on the node (as Net quality) without any other position data
|
|
case setTimeOnly(UInt32)
|
|
///
|
|
/// Tell the node to send the stored ui data.
|
|
case getUiConfigRequest(Bool)
|
|
///
|
|
/// Reply stored device ui data.
|
|
case getUiConfigResponse(DeviceUIConfig)
|
|
///
|
|
/// Tell the node to store UI data persistently.
|
|
case storeUiConfig(DeviceUIConfig)
|
|
///
|
|
/// Set specified node-num to be ignored on the NodeDB on the device
|
|
case setIgnoredNode(UInt32)
|
|
///
|
|
/// Set specified node-num to be un-ignored on the NodeDB on the device
|
|
case removeIgnoredNode(UInt32)
|
|
///
|
|
/// Begins an edit transaction for config, module config, owner, and channel settings changes
|
|
/// This will delay the standard *implicit* save to the file system and subsequent reboot behavior until committed (commit_edit_settings)
|
|
case beginEditSettings(Bool)
|
|
///
|
|
/// Commits an open transaction for any edits made to config, module config, owner, and channel settings
|
|
case commitEditSettings(Bool)
|
|
///
|
|
/// Add a contact (User) to the nodedb
|
|
case addContact(SharedContact)
|
|
///
|
|
/// Initiate or respond to a key verification request
|
|
case keyVerification(KeyVerificationAdmin)
|
|
///
|
|
/// Tell the node to factory reset config everything; all device state and configuration will be returned to factory defaults and BLE bonds will be cleared.
|
|
case factoryResetDevice(Int32)
|
|
///
|
|
/// Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot)
|
|
/// Only Implemented for ESP32 Devices. This needs to be issued to send a new main firmware via bluetooth.
|
|
case rebootOtaSeconds(Int32)
|
|
///
|
|
/// This message is only supported for the simulator Portduino build.
|
|
/// If received the simulator will exit successfully.
|
|
case exitSimulator(Bool)
|
|
///
|
|
/// Tell the node to reboot in this many seconds (or <0 to cancel reboot)
|
|
case rebootSeconds(Int32)
|
|
///
|
|
/// Tell the node to shutdown in this many seconds (or <0 to cancel shutdown)
|
|
case shutdownSeconds(Int32)
|
|
///
|
|
/// Tell the node to factory reset config; all device state and configuration will be returned to factory defaults; BLE bonds will be preserved.
|
|
case factoryResetConfig(Int32)
|
|
///
|
|
/// Tell the node to reset the nodedb.
|
|
/// When true, favorites are preserved through reset.
|
|
case nodedbReset(Bool)
|
|
|
|
}
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public enum ConfigType: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|
public typealias RawValue = Int
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case deviceConfig // = 0
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case positionConfig // = 1
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case powerConfig // = 2
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case networkConfig // = 3
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case displayConfig // = 4
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case loraConfig // = 5
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case bluetoothConfig // = 6
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case securityConfig // = 7
|
|
|
|
///
|
|
/// Session key config
|
|
case sessionkeyConfig // = 8
|
|
|
|
///
|
|
/// device-ui config
|
|
case deviceuiConfig // = 9
|
|
case UNRECOGNIZED(Int)
|
|
|
|
public init() {
|
|
self = .deviceConfig
|
|
}
|
|
|
|
public init?(rawValue: Int) {
|
|
switch rawValue {
|
|
case 0: self = .deviceConfig
|
|
case 1: self = .positionConfig
|
|
case 2: self = .powerConfig
|
|
case 3: self = .networkConfig
|
|
case 4: self = .displayConfig
|
|
case 5: self = .loraConfig
|
|
case 6: self = .bluetoothConfig
|
|
case 7: self = .securityConfig
|
|
case 8: self = .sessionkeyConfig
|
|
case 9: self = .deviceuiConfig
|
|
default: self = .UNRECOGNIZED(rawValue)
|
|
}
|
|
}
|
|
|
|
public var rawValue: Int {
|
|
switch self {
|
|
case .deviceConfig: return 0
|
|
case .positionConfig: return 1
|
|
case .powerConfig: return 2
|
|
case .networkConfig: return 3
|
|
case .displayConfig: return 4
|
|
case .loraConfig: return 5
|
|
case .bluetoothConfig: return 6
|
|
case .securityConfig: return 7
|
|
case .sessionkeyConfig: return 8
|
|
case .deviceuiConfig: return 9
|
|
case .UNRECOGNIZED(let i): return i
|
|
}
|
|
}
|
|
|
|
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
public static let allCases: [AdminMessage.ConfigType] = [
|
|
.deviceConfig,
|
|
.positionConfig,
|
|
.powerConfig,
|
|
.networkConfig,
|
|
.displayConfig,
|
|
.loraConfig,
|
|
.bluetoothConfig,
|
|
.securityConfig,
|
|
.sessionkeyConfig,
|
|
.deviceuiConfig,
|
|
]
|
|
|
|
}
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
public enum ModuleConfigType: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|
public typealias RawValue = Int
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case mqttConfig // = 0
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case serialConfig // = 1
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case extnotifConfig // = 2
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case storeforwardConfig // = 3
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case rangetestConfig // = 4
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case telemetryConfig // = 5
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case cannedmsgConfig // = 6
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case audioConfig // = 7
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case remotehardwareConfig // = 8
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case neighborinfoConfig // = 9
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case ambientlightingConfig // = 10
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case detectionsensorConfig // = 11
|
|
|
|
///
|
|
/// TODO: REPLACE
|
|
case paxcounterConfig // = 12
|
|
case UNRECOGNIZED(Int)
|
|
|
|
public init() {
|
|
self = .mqttConfig
|
|
}
|
|
|
|
public init?(rawValue: Int) {
|
|
switch rawValue {
|
|
case 0: self = .mqttConfig
|
|
case 1: self = .serialConfig
|
|
case 2: self = .extnotifConfig
|
|
case 3: self = .storeforwardConfig
|
|
case 4: self = .rangetestConfig
|
|
case 5: self = .telemetryConfig
|
|
case 6: self = .cannedmsgConfig
|
|
case 7: self = .audioConfig
|
|
case 8: self = .remotehardwareConfig
|
|
case 9: self = .neighborinfoConfig
|
|
case 10: self = .ambientlightingConfig
|
|
case 11: self = .detectionsensorConfig
|
|
case 12: self = .paxcounterConfig
|
|
default: self = .UNRECOGNIZED(rawValue)
|
|
}
|
|
}
|
|
|
|
public var rawValue: Int {
|
|
switch self {
|
|
case .mqttConfig: return 0
|
|
case .serialConfig: return 1
|
|
case .extnotifConfig: return 2
|
|
case .storeforwardConfig: return 3
|
|
case .rangetestConfig: return 4
|
|
case .telemetryConfig: return 5
|
|
case .cannedmsgConfig: return 6
|
|
case .audioConfig: return 7
|
|
case .remotehardwareConfig: return 8
|
|
case .neighborinfoConfig: return 9
|
|
case .ambientlightingConfig: return 10
|
|
case .detectionsensorConfig: return 11
|
|
case .paxcounterConfig: return 12
|
|
case .UNRECOGNIZED(let i): return i
|
|
}
|
|
}
|
|
|
|
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
public static let allCases: [AdminMessage.ModuleConfigType] = [
|
|
.mqttConfig,
|
|
.serialConfig,
|
|
.extnotifConfig,
|
|
.storeforwardConfig,
|
|
.rangetestConfig,
|
|
.telemetryConfig,
|
|
.cannedmsgConfig,
|
|
.audioConfig,
|
|
.remotehardwareConfig,
|
|
.neighborinfoConfig,
|
|
.ambientlightingConfig,
|
|
.detectionsensorConfig,
|
|
.paxcounterConfig,
|
|
]
|
|
|
|
}
|
|
|
|
public enum BackupLocation: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|
public typealias RawValue = Int
|
|
|
|
///
|
|
/// Backup to the internal flash
|
|
case flash // = 0
|
|
|
|
///
|
|
/// Backup to the SD card
|
|
case sd // = 1
|
|
case UNRECOGNIZED(Int)
|
|
|
|
public init() {
|
|
self = .flash
|
|
}
|
|
|
|
public init?(rawValue: Int) {
|
|
switch rawValue {
|
|
case 0: self = .flash
|
|
case 1: self = .sd
|
|
default: self = .UNRECOGNIZED(rawValue)
|
|
}
|
|
}
|
|
|
|
public var rawValue: Int {
|
|
switch self {
|
|
case .flash: return 0
|
|
case .sd: return 1
|
|
case .UNRECOGNIZED(let i): return i
|
|
}
|
|
}
|
|
|
|
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
public static let allCases: [AdminMessage.BackupLocation] = [
|
|
.flash,
|
|
.sd,
|
|
]
|
|
|
|
}
|
|
|
|
///
|
|
/// Input event message to be sent to the node.
|
|
public struct InputEvent: 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.
|
|
|
|
///
|
|
/// The input event code
|
|
public var eventCode: UInt32 = 0
|
|
|
|
///
|
|
/// Keyboard character code
|
|
public var kbChar: UInt32 = 0
|
|
|
|
///
|
|
/// The touch X coordinate
|
|
public var touchX: UInt32 = 0
|
|
|
|
///
|
|
/// The touch Y coordinate
|
|
public var touchY: UInt32 = 0
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
}
|
|
|
|
public init() {}
|
|
}
|
|
|
|
///
|
|
/// Parameters for setting up Meshtastic for ameteur radio usage
|
|
public struct HamParameters: 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.
|
|
|
|
///
|
|
/// Amateur radio call sign, eg. KD2ABC
|
|
public var callSign: String = String()
|
|
|
|
///
|
|
/// Transmit power in dBm at the LoRA transceiver, not including any amplification
|
|
public var txPower: Int32 = 0
|
|
|
|
///
|
|
/// The selected frequency of LoRA operation
|
|
/// Please respect your local laws, regulations, and band plans.
|
|
/// Ensure your radio is capable of operating of the selected frequency before setting this.
|
|
public var frequency: Float = 0
|
|
|
|
///
|
|
/// Optional short name of user
|
|
public var shortName: String = String()
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
}
|
|
|
|
///
|
|
/// Response envelope for node_remote_hardware_pins
|
|
public struct NodeRemoteHardwarePinsResponse: 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.
|
|
|
|
///
|
|
/// Nodes and their respective remote hardware GPIO pins
|
|
public var nodeRemoteHardwarePins: [NodeRemoteHardwarePin] = []
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
}
|
|
|
|
public struct SharedContact: 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.
|
|
|
|
///
|
|
/// The node number of the contact
|
|
public var nodeNum: UInt32 = 0
|
|
|
|
///
|
|
/// The User of the contact
|
|
public var user: User {
|
|
get {return _user ?? User()}
|
|
set {_user = newValue}
|
|
}
|
|
/// Returns true if `user` has been explicitly set.
|
|
public var hasUser: Bool {return self._user != nil}
|
|
/// Clears the value of `user`. Subsequent reads from it will return its default value.
|
|
public mutating func clearUser() {self._user = nil}
|
|
|
|
///
|
|
/// Add this contact to the blocked / ignored list
|
|
public var shouldIgnore: Bool = false
|
|
|
|
///
|
|
/// Set the IS_KEY_MANUALLY_VERIFIED bit
|
|
public var manuallyVerified: Bool = false
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
public init() {}
|
|
|
|
fileprivate var _user: User? = nil
|
|
}
|
|
|
|
///
|
|
/// This message is used by a client to initiate or complete a key verification
|
|
public struct KeyVerificationAdmin: 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.
|
|
|
|
public var messageType: KeyVerificationAdmin.MessageType = .initiateVerification
|
|
|
|
///
|
|
/// The nodenum we're requesting
|
|
public var remoteNodenum: UInt32 = 0
|
|
|
|
///
|
|
/// The nonce is used to track the connection
|
|
public var nonce: UInt64 = 0
|
|
|
|
///
|
|
/// The 4 digit code generated by the remote node, and communicated outside the mesh
|
|
public var securityNumber: UInt32 {
|
|
get {return _securityNumber ?? 0}
|
|
set {_securityNumber = newValue}
|
|
}
|
|
/// Returns true if `securityNumber` has been explicitly set.
|
|
public var hasSecurityNumber: Bool {return self._securityNumber != nil}
|
|
/// Clears the value of `securityNumber`. Subsequent reads from it will return its default value.
|
|
public mutating func clearSecurityNumber() {self._securityNumber = nil}
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
///
|
|
/// Three stages of this request.
|
|
public enum MessageType: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|
public typealias RawValue = Int
|
|
|
|
///
|
|
/// This is the first stage, where a client initiates
|
|
case initiateVerification // = 0
|
|
|
|
///
|
|
/// After the nonce has been returned over the mesh, the client prompts for the security number
|
|
/// And uses this message to provide it to the node.
|
|
case provideSecurityNumber // = 1
|
|
|
|
///
|
|
/// Once the user has compared the verification message, this message notifies the node.
|
|
case doVerify // = 2
|
|
|
|
///
|
|
/// This is the cancel path, can be taken at any point
|
|
case doNotVerify // = 3
|
|
case UNRECOGNIZED(Int)
|
|
|
|
public init() {
|
|
self = .initiateVerification
|
|
}
|
|
|
|
public init?(rawValue: Int) {
|
|
switch rawValue {
|
|
case 0: self = .initiateVerification
|
|
case 1: self = .provideSecurityNumber
|
|
case 2: self = .doVerify
|
|
case 3: self = .doNotVerify
|
|
default: self = .UNRECOGNIZED(rawValue)
|
|
}
|
|
}
|
|
|
|
public var rawValue: Int {
|
|
switch self {
|
|
case .initiateVerification: return 0
|
|
case .provideSecurityNumber: return 1
|
|
case .doVerify: return 2
|
|
case .doNotVerify: return 3
|
|
case .UNRECOGNIZED(let i): return i
|
|
}
|
|
}
|
|
|
|
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
public static let allCases: [KeyVerificationAdmin.MessageType] = [
|
|
.initiateVerification,
|
|
.provideSecurityNumber,
|
|
.doVerify,
|
|
.doNotVerify,
|
|
]
|
|
|
|
}
|
|
|
|
public init() {}
|
|
|
|
fileprivate var _securityNumber: UInt32? = nil
|
|
}
|
|
|
|
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
|
|
|
fileprivate let _protobuf_package = "meshtastic"
|
|
|
|
extension AdminMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = _protobuf_package + ".AdminMessage"
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}get_channel_request\0\u{3}get_channel_response\0\u{3}get_owner_request\0\u{3}get_owner_response\0\u{3}get_config_request\0\u{3}get_config_response\0\u{3}get_module_config_request\0\u{3}get_module_config_response\0\u{4}\u{2}get_canned_message_module_messages_request\0\u{3}get_canned_message_module_messages_response\0\u{3}get_device_metadata_request\0\u{3}get_device_metadata_response\0\u{3}get_ringtone_request\0\u{3}get_ringtone_response\0\u{3}get_device_connection_status_request\0\u{3}get_device_connection_status_response\0\u{3}set_ham_mode\0\u{3}get_node_remote_hardware_pins_request\0\u{3}get_node_remote_hardware_pins_response\0\u{3}enter_dfu_mode_request\0\u{3}delete_file_request\0\u{3}set_scale\0\u{3}backup_preferences\0\u{3}restore_preferences\0\u{3}remove_backup_preferences\0\u{3}send_input_event\0\u{4}\u{5}set_owner\0\u{3}set_channel\0\u{3}set_config\0\u{3}set_module_config\0\u{3}set_canned_message_module_messages\0\u{3}set_ringtone_message\0\u{3}remove_by_nodenum\0\u{3}set_favorite_node\0\u{3}remove_favorite_node\0\u{3}set_fixed_position\0\u{3}remove_fixed_position\0\u{3}set_time_only\0\u{3}get_ui_config_request\0\u{3}get_ui_config_response\0\u{3}store_ui_config\0\u{3}set_ignored_node\0\u{3}remove_ignored_node\0\u{4}\u{10}begin_edit_settings\0\u{3}commit_edit_settings\0\u{3}add_contact\0\u{3}key_verification\0\u{4}\u{1b}factory_reset_device\0\u{3}reboot_ota_seconds\0\u{3}exit_simulator\0\u{3}reboot_seconds\0\u{3}shutdown_seconds\0\u{3}factory_reset_config\0\u{3}nodedb_reset\0\u{3}session_passkey\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 {
|
|
var v: UInt32?
|
|
try decoder.decodeSingularUInt32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getChannelRequest(v)
|
|
}
|
|
}()
|
|
case 2: try {
|
|
var v: Channel?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .getChannelResponse(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getChannelResponse(v)
|
|
}
|
|
}()
|
|
case 3: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getOwnerRequest(v)
|
|
}
|
|
}()
|
|
case 4: try {
|
|
var v: User?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .getOwnerResponse(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getOwnerResponse(v)
|
|
}
|
|
}()
|
|
case 5: try {
|
|
var v: AdminMessage.ConfigType?
|
|
try decoder.decodeSingularEnumField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getConfigRequest(v)
|
|
}
|
|
}()
|
|
case 6: try {
|
|
var v: Config?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .getConfigResponse(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getConfigResponse(v)
|
|
}
|
|
}()
|
|
case 7: try {
|
|
var v: AdminMessage.ModuleConfigType?
|
|
try decoder.decodeSingularEnumField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getModuleConfigRequest(v)
|
|
}
|
|
}()
|
|
case 8: try {
|
|
var v: ModuleConfig?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .getModuleConfigResponse(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getModuleConfigResponse(v)
|
|
}
|
|
}()
|
|
case 10: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getCannedMessageModuleMessagesRequest(v)
|
|
}
|
|
}()
|
|
case 11: try {
|
|
var v: String?
|
|
try decoder.decodeSingularStringField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getCannedMessageModuleMessagesResponse(v)
|
|
}
|
|
}()
|
|
case 12: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getDeviceMetadataRequest(v)
|
|
}
|
|
}()
|
|
case 13: try {
|
|
var v: DeviceMetadata?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .getDeviceMetadataResponse(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getDeviceMetadataResponse(v)
|
|
}
|
|
}()
|
|
case 14: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getRingtoneRequest(v)
|
|
}
|
|
}()
|
|
case 15: try {
|
|
var v: String?
|
|
try decoder.decodeSingularStringField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getRingtoneResponse(v)
|
|
}
|
|
}()
|
|
case 16: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getDeviceConnectionStatusRequest(v)
|
|
}
|
|
}()
|
|
case 17: try {
|
|
var v: DeviceConnectionStatus?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .getDeviceConnectionStatusResponse(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getDeviceConnectionStatusResponse(v)
|
|
}
|
|
}()
|
|
case 18: try {
|
|
var v: HamParameters?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .setHamMode(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .setHamMode(v)
|
|
}
|
|
}()
|
|
case 19: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getNodeRemoteHardwarePinsRequest(v)
|
|
}
|
|
}()
|
|
case 20: try {
|
|
var v: NodeRemoteHardwarePinsResponse?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .getNodeRemoteHardwarePinsResponse(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getNodeRemoteHardwarePinsResponse(v)
|
|
}
|
|
}()
|
|
case 21: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .enterDfuModeRequest(v)
|
|
}
|
|
}()
|
|
case 22: try {
|
|
var v: String?
|
|
try decoder.decodeSingularStringField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .deleteFileRequest(v)
|
|
}
|
|
}()
|
|
case 23: try {
|
|
var v: UInt32?
|
|
try decoder.decodeSingularUInt32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .setScale(v)
|
|
}
|
|
}()
|
|
case 24: try {
|
|
var v: AdminMessage.BackupLocation?
|
|
try decoder.decodeSingularEnumField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .backupPreferences(v)
|
|
}
|
|
}()
|
|
case 25: try {
|
|
var v: AdminMessage.BackupLocation?
|
|
try decoder.decodeSingularEnumField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .restorePreferences(v)
|
|
}
|
|
}()
|
|
case 26: try {
|
|
var v: AdminMessage.BackupLocation?
|
|
try decoder.decodeSingularEnumField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .removeBackupPreferences(v)
|
|
}
|
|
}()
|
|
case 27: try {
|
|
var v: AdminMessage.InputEvent?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .sendInputEvent(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .sendInputEvent(v)
|
|
}
|
|
}()
|
|
case 32: try {
|
|
var v: User?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .setOwner(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .setOwner(v)
|
|
}
|
|
}()
|
|
case 33: try {
|
|
var v: Channel?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .setChannel(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .setChannel(v)
|
|
}
|
|
}()
|
|
case 34: try {
|
|
var v: Config?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .setConfig(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .setConfig(v)
|
|
}
|
|
}()
|
|
case 35: try {
|
|
var v: ModuleConfig?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .setModuleConfig(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .setModuleConfig(v)
|
|
}
|
|
}()
|
|
case 36: try {
|
|
var v: String?
|
|
try decoder.decodeSingularStringField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .setCannedMessageModuleMessages(v)
|
|
}
|
|
}()
|
|
case 37: try {
|
|
var v: String?
|
|
try decoder.decodeSingularStringField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .setRingtoneMessage(v)
|
|
}
|
|
}()
|
|
case 38: try {
|
|
var v: UInt32?
|
|
try decoder.decodeSingularUInt32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .removeByNodenum(v)
|
|
}
|
|
}()
|
|
case 39: try {
|
|
var v: UInt32?
|
|
try decoder.decodeSingularUInt32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .setFavoriteNode(v)
|
|
}
|
|
}()
|
|
case 40: try {
|
|
var v: UInt32?
|
|
try decoder.decodeSingularUInt32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .removeFavoriteNode(v)
|
|
}
|
|
}()
|
|
case 41: try {
|
|
var v: Position?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .setFixedPosition(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .setFixedPosition(v)
|
|
}
|
|
}()
|
|
case 42: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .removeFixedPosition(v)
|
|
}
|
|
}()
|
|
case 43: try {
|
|
var v: UInt32?
|
|
try decoder.decodeSingularFixed32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .setTimeOnly(v)
|
|
}
|
|
}()
|
|
case 44: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getUiConfigRequest(v)
|
|
}
|
|
}()
|
|
case 45: try {
|
|
var v: DeviceUIConfig?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .getUiConfigResponse(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .getUiConfigResponse(v)
|
|
}
|
|
}()
|
|
case 46: try {
|
|
var v: DeviceUIConfig?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .storeUiConfig(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .storeUiConfig(v)
|
|
}
|
|
}()
|
|
case 47: try {
|
|
var v: UInt32?
|
|
try decoder.decodeSingularUInt32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .setIgnoredNode(v)
|
|
}
|
|
}()
|
|
case 48: try {
|
|
var v: UInt32?
|
|
try decoder.decodeSingularUInt32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .removeIgnoredNode(v)
|
|
}
|
|
}()
|
|
case 64: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .beginEditSettings(v)
|
|
}
|
|
}()
|
|
case 65: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .commitEditSettings(v)
|
|
}
|
|
}()
|
|
case 66: try {
|
|
var v: SharedContact?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .addContact(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .addContact(v)
|
|
}
|
|
}()
|
|
case 67: try {
|
|
var v: KeyVerificationAdmin?
|
|
var hadOneofValue = false
|
|
if let current = self.payloadVariant {
|
|
hadOneofValue = true
|
|
if case .keyVerification(let m) = current {v = m}
|
|
}
|
|
try decoder.decodeSingularMessageField(value: &v)
|
|
if let v = v {
|
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .keyVerification(v)
|
|
}
|
|
}()
|
|
case 94: try {
|
|
var v: Int32?
|
|
try decoder.decodeSingularInt32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .factoryResetDevice(v)
|
|
}
|
|
}()
|
|
case 95: try {
|
|
var v: Int32?
|
|
try decoder.decodeSingularInt32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .rebootOtaSeconds(v)
|
|
}
|
|
}()
|
|
case 96: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .exitSimulator(v)
|
|
}
|
|
}()
|
|
case 97: try {
|
|
var v: Int32?
|
|
try decoder.decodeSingularInt32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .rebootSeconds(v)
|
|
}
|
|
}()
|
|
case 98: try {
|
|
var v: Int32?
|
|
try decoder.decodeSingularInt32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .shutdownSeconds(v)
|
|
}
|
|
}()
|
|
case 99: try {
|
|
var v: Int32?
|
|
try decoder.decodeSingularInt32Field(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .factoryResetConfig(v)
|
|
}
|
|
}()
|
|
case 100: try {
|
|
var v: Bool?
|
|
try decoder.decodeSingularBoolField(value: &v)
|
|
if let v = v {
|
|
if self.payloadVariant != nil {try decoder.handleConflictingOneOf()}
|
|
self.payloadVariant = .nodedbReset(v)
|
|
}
|
|
}()
|
|
case 101: try { try decoder.decodeSingularBytesField(value: &self.sessionPasskey) }()
|
|
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
|
|
switch self.payloadVariant {
|
|
case .getChannelRequest?: try {
|
|
guard case .getChannelRequest(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 1)
|
|
}()
|
|
case .getChannelResponse?: try {
|
|
guard case .getChannelResponse(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
|
}()
|
|
case .getOwnerRequest?: try {
|
|
guard case .getOwnerRequest(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 3)
|
|
}()
|
|
case .getOwnerResponse?: try {
|
|
guard case .getOwnerResponse(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
|
|
}()
|
|
case .getConfigRequest?: try {
|
|
guard case .getConfigRequest(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularEnumField(value: v, fieldNumber: 5)
|
|
}()
|
|
case .getConfigResponse?: try {
|
|
guard case .getConfigResponse(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
|
|
}()
|
|
case .getModuleConfigRequest?: try {
|
|
guard case .getModuleConfigRequest(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularEnumField(value: v, fieldNumber: 7)
|
|
}()
|
|
case .getModuleConfigResponse?: try {
|
|
guard case .getModuleConfigResponse(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 8)
|
|
}()
|
|
case .getCannedMessageModuleMessagesRequest?: try {
|
|
guard case .getCannedMessageModuleMessagesRequest(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 10)
|
|
}()
|
|
case .getCannedMessageModuleMessagesResponse?: try {
|
|
guard case .getCannedMessageModuleMessagesResponse(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularStringField(value: v, fieldNumber: 11)
|
|
}()
|
|
case .getDeviceMetadataRequest?: try {
|
|
guard case .getDeviceMetadataRequest(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 12)
|
|
}()
|
|
case .getDeviceMetadataResponse?: try {
|
|
guard case .getDeviceMetadataResponse(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 13)
|
|
}()
|
|
case .getRingtoneRequest?: try {
|
|
guard case .getRingtoneRequest(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 14)
|
|
}()
|
|
case .getRingtoneResponse?: try {
|
|
guard case .getRingtoneResponse(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularStringField(value: v, fieldNumber: 15)
|
|
}()
|
|
case .getDeviceConnectionStatusRequest?: try {
|
|
guard case .getDeviceConnectionStatusRequest(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 16)
|
|
}()
|
|
case .getDeviceConnectionStatusResponse?: try {
|
|
guard case .getDeviceConnectionStatusResponse(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 17)
|
|
}()
|
|
case .setHamMode?: try {
|
|
guard case .setHamMode(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 18)
|
|
}()
|
|
case .getNodeRemoteHardwarePinsRequest?: try {
|
|
guard case .getNodeRemoteHardwarePinsRequest(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 19)
|
|
}()
|
|
case .getNodeRemoteHardwarePinsResponse?: try {
|
|
guard case .getNodeRemoteHardwarePinsResponse(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 20)
|
|
}()
|
|
case .enterDfuModeRequest?: try {
|
|
guard case .enterDfuModeRequest(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 21)
|
|
}()
|
|
case .deleteFileRequest?: try {
|
|
guard case .deleteFileRequest(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularStringField(value: v, fieldNumber: 22)
|
|
}()
|
|
case .setScale?: try {
|
|
guard case .setScale(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 23)
|
|
}()
|
|
case .backupPreferences?: try {
|
|
guard case .backupPreferences(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularEnumField(value: v, fieldNumber: 24)
|
|
}()
|
|
case .restorePreferences?: try {
|
|
guard case .restorePreferences(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularEnumField(value: v, fieldNumber: 25)
|
|
}()
|
|
case .removeBackupPreferences?: try {
|
|
guard case .removeBackupPreferences(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularEnumField(value: v, fieldNumber: 26)
|
|
}()
|
|
case .sendInputEvent?: try {
|
|
guard case .sendInputEvent(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 27)
|
|
}()
|
|
case .setOwner?: try {
|
|
guard case .setOwner(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 32)
|
|
}()
|
|
case .setChannel?: try {
|
|
guard case .setChannel(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 33)
|
|
}()
|
|
case .setConfig?: try {
|
|
guard case .setConfig(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 34)
|
|
}()
|
|
case .setModuleConfig?: try {
|
|
guard case .setModuleConfig(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 35)
|
|
}()
|
|
case .setCannedMessageModuleMessages?: try {
|
|
guard case .setCannedMessageModuleMessages(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularStringField(value: v, fieldNumber: 36)
|
|
}()
|
|
case .setRingtoneMessage?: try {
|
|
guard case .setRingtoneMessage(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularStringField(value: v, fieldNumber: 37)
|
|
}()
|
|
case .removeByNodenum?: try {
|
|
guard case .removeByNodenum(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 38)
|
|
}()
|
|
case .setFavoriteNode?: try {
|
|
guard case .setFavoriteNode(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 39)
|
|
}()
|
|
case .removeFavoriteNode?: try {
|
|
guard case .removeFavoriteNode(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 40)
|
|
}()
|
|
case .setFixedPosition?: try {
|
|
guard case .setFixedPosition(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 41)
|
|
}()
|
|
case .removeFixedPosition?: try {
|
|
guard case .removeFixedPosition(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 42)
|
|
}()
|
|
case .setTimeOnly?: try {
|
|
guard case .setTimeOnly(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularFixed32Field(value: v, fieldNumber: 43)
|
|
}()
|
|
case .getUiConfigRequest?: try {
|
|
guard case .getUiConfigRequest(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 44)
|
|
}()
|
|
case .getUiConfigResponse?: try {
|
|
guard case .getUiConfigResponse(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 45)
|
|
}()
|
|
case .storeUiConfig?: try {
|
|
guard case .storeUiConfig(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 46)
|
|
}()
|
|
case .setIgnoredNode?: try {
|
|
guard case .setIgnoredNode(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 47)
|
|
}()
|
|
case .removeIgnoredNode?: try {
|
|
guard case .removeIgnoredNode(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 48)
|
|
}()
|
|
case .beginEditSettings?: try {
|
|
guard case .beginEditSettings(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 64)
|
|
}()
|
|
case .commitEditSettings?: try {
|
|
guard case .commitEditSettings(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 65)
|
|
}()
|
|
case .addContact?: try {
|
|
guard case .addContact(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 66)
|
|
}()
|
|
case .keyVerification?: try {
|
|
guard case .keyVerification(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 67)
|
|
}()
|
|
case .factoryResetDevice?: try {
|
|
guard case .factoryResetDevice(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularInt32Field(value: v, fieldNumber: 94)
|
|
}()
|
|
case .rebootOtaSeconds?: try {
|
|
guard case .rebootOtaSeconds(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularInt32Field(value: v, fieldNumber: 95)
|
|
}()
|
|
case .exitSimulator?: try {
|
|
guard case .exitSimulator(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 96)
|
|
}()
|
|
case .rebootSeconds?: try {
|
|
guard case .rebootSeconds(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularInt32Field(value: v, fieldNumber: 97)
|
|
}()
|
|
case .shutdownSeconds?: try {
|
|
guard case .shutdownSeconds(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularInt32Field(value: v, fieldNumber: 98)
|
|
}()
|
|
case .factoryResetConfig?: try {
|
|
guard case .factoryResetConfig(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularInt32Field(value: v, fieldNumber: 99)
|
|
}()
|
|
case .nodedbReset?: try {
|
|
guard case .nodedbReset(let v)? = self.payloadVariant else { preconditionFailure() }
|
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 100)
|
|
}()
|
|
case nil: break
|
|
}
|
|
if !self.sessionPasskey.isEmpty {
|
|
try visitor.visitSingularBytesField(value: self.sessionPasskey, fieldNumber: 101)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: AdminMessage, rhs: AdminMessage) -> Bool {
|
|
if lhs.sessionPasskey != rhs.sessionPasskey {return false}
|
|
if lhs.payloadVariant != rhs.payloadVariant {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension AdminMessage.ConfigType: SwiftProtobuf._ProtoNameProviding {
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0DEVICE_CONFIG\0\u{1}POSITION_CONFIG\0\u{1}POWER_CONFIG\0\u{1}NETWORK_CONFIG\0\u{1}DISPLAY_CONFIG\0\u{1}LORA_CONFIG\0\u{1}BLUETOOTH_CONFIG\0\u{1}SECURITY_CONFIG\0\u{1}SESSIONKEY_CONFIG\0\u{1}DEVICEUI_CONFIG\0")
|
|
}
|
|
|
|
extension AdminMessage.ModuleConfigType: SwiftProtobuf._ProtoNameProviding {
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0MQTT_CONFIG\0\u{1}SERIAL_CONFIG\0\u{1}EXTNOTIF_CONFIG\0\u{1}STOREFORWARD_CONFIG\0\u{1}RANGETEST_CONFIG\0\u{1}TELEMETRY_CONFIG\0\u{1}CANNEDMSG_CONFIG\0\u{1}AUDIO_CONFIG\0\u{1}REMOTEHARDWARE_CONFIG\0\u{1}NEIGHBORINFO_CONFIG\0\u{1}AMBIENTLIGHTING_CONFIG\0\u{1}DETECTIONSENSOR_CONFIG\0\u{1}PAXCOUNTER_CONFIG\0")
|
|
}
|
|
|
|
extension AdminMessage.BackupLocation: SwiftProtobuf._ProtoNameProviding {
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0FLASH\0\u{1}SD\0")
|
|
}
|
|
|
|
extension AdminMessage.InputEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = AdminMessage.protoMessageName + ".InputEvent"
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}event_code\0\u{3}kb_char\0\u{3}touch_x\0\u{3}touch_y\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.eventCode) }()
|
|
case 2: try { try decoder.decodeSingularUInt32Field(value: &self.kbChar) }()
|
|
case 3: try { try decoder.decodeSingularUInt32Field(value: &self.touchX) }()
|
|
case 4: try { try decoder.decodeSingularUInt32Field(value: &self.touchY) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if self.eventCode != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.eventCode, fieldNumber: 1)
|
|
}
|
|
if self.kbChar != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.kbChar, fieldNumber: 2)
|
|
}
|
|
if self.touchX != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.touchX, fieldNumber: 3)
|
|
}
|
|
if self.touchY != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.touchY, fieldNumber: 4)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: AdminMessage.InputEvent, rhs: AdminMessage.InputEvent) -> Bool {
|
|
if lhs.eventCode != rhs.eventCode {return false}
|
|
if lhs.kbChar != rhs.kbChar {return false}
|
|
if lhs.touchX != rhs.touchX {return false}
|
|
if lhs.touchY != rhs.touchY {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension HamParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = _protobuf_package + ".HamParameters"
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}call_sign\0\u{3}tx_power\0\u{1}frequency\0\u{3}short_name\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.decodeSingularStringField(value: &self.callSign) }()
|
|
case 2: try { try decoder.decodeSingularInt32Field(value: &self.txPower) }()
|
|
case 3: try { try decoder.decodeSingularFloatField(value: &self.frequency) }()
|
|
case 4: try { try decoder.decodeSingularStringField(value: &self.shortName) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if !self.callSign.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.callSign, fieldNumber: 1)
|
|
}
|
|
if self.txPower != 0 {
|
|
try visitor.visitSingularInt32Field(value: self.txPower, fieldNumber: 2)
|
|
}
|
|
if self.frequency.bitPattern != 0 {
|
|
try visitor.visitSingularFloatField(value: self.frequency, fieldNumber: 3)
|
|
}
|
|
if !self.shortName.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.shortName, fieldNumber: 4)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: HamParameters, rhs: HamParameters) -> Bool {
|
|
if lhs.callSign != rhs.callSign {return false}
|
|
if lhs.txPower != rhs.txPower {return false}
|
|
if lhs.frequency != rhs.frequency {return false}
|
|
if lhs.shortName != rhs.shortName {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension NodeRemoteHardwarePinsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = _protobuf_package + ".NodeRemoteHardwarePinsResponse"
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}node_remote_hardware_pins\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.decodeRepeatedMessageField(value: &self.nodeRemoteHardwarePins) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if !self.nodeRemoteHardwarePins.isEmpty {
|
|
try visitor.visitRepeatedMessageField(value: self.nodeRemoteHardwarePins, fieldNumber: 1)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: NodeRemoteHardwarePinsResponse, rhs: NodeRemoteHardwarePinsResponse) -> Bool {
|
|
if lhs.nodeRemoteHardwarePins != rhs.nodeRemoteHardwarePins {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension SharedContact: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = _protobuf_package + ".SharedContact"
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}node_num\0\u{1}user\0\u{3}should_ignore\0\u{3}manually_verified\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.nodeNum) }()
|
|
case 2: try { try decoder.decodeSingularMessageField(value: &self._user) }()
|
|
case 3: try { try decoder.decodeSingularBoolField(value: &self.shouldIgnore) }()
|
|
case 4: try { try decoder.decodeSingularBoolField(value: &self.manuallyVerified) }()
|
|
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.nodeNum != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.nodeNum, fieldNumber: 1)
|
|
}
|
|
try { if let v = self._user {
|
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
|
} }()
|
|
if self.shouldIgnore != false {
|
|
try visitor.visitSingularBoolField(value: self.shouldIgnore, fieldNumber: 3)
|
|
}
|
|
if self.manuallyVerified != false {
|
|
try visitor.visitSingularBoolField(value: self.manuallyVerified, fieldNumber: 4)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: SharedContact, rhs: SharedContact) -> Bool {
|
|
if lhs.nodeNum != rhs.nodeNum {return false}
|
|
if lhs._user != rhs._user {return false}
|
|
if lhs.shouldIgnore != rhs.shouldIgnore {return false}
|
|
if lhs.manuallyVerified != rhs.manuallyVerified {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension KeyVerificationAdmin: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
public static let protoMessageName: String = _protobuf_package + ".KeyVerificationAdmin"
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}message_type\0\u{3}remote_nodenum\0\u{1}nonce\0\u{3}security_number\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.messageType) }()
|
|
case 2: try { try decoder.decodeSingularUInt32Field(value: &self.remoteNodenum) }()
|
|
case 3: try { try decoder.decodeSingularUInt64Field(value: &self.nonce) }()
|
|
case 4: try { try decoder.decodeSingularUInt32Field(value: &self._securityNumber) }()
|
|
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.messageType != .initiateVerification {
|
|
try visitor.visitSingularEnumField(value: self.messageType, fieldNumber: 1)
|
|
}
|
|
if self.remoteNodenum != 0 {
|
|
try visitor.visitSingularUInt32Field(value: self.remoteNodenum, fieldNumber: 2)
|
|
}
|
|
if self.nonce != 0 {
|
|
try visitor.visitSingularUInt64Field(value: self.nonce, fieldNumber: 3)
|
|
}
|
|
try { if let v = self._securityNumber {
|
|
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 4)
|
|
} }()
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
public static func ==(lhs: KeyVerificationAdmin, rhs: KeyVerificationAdmin) -> Bool {
|
|
if lhs.messageType != rhs.messageType {return false}
|
|
if lhs.remoteNodenum != rhs.remoteNodenum {return false}
|
|
if lhs.nonce != rhs.nonce {return false}
|
|
if lhs._securityNumber != rhs._securityNumber {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension KeyVerificationAdmin.MessageType: SwiftProtobuf._ProtoNameProviding {
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0INITIATE_VERIFICATION\0\u{1}PROVIDE_SECURITY_NUMBER\0\u{1}DO_VERIFY\0\u{1}DO_NOT_VERIFY\0")
|
|
}
|