// @generated by protoc-gen-es v2.12.0 with parameter "target=ts"
// @generated from file meshtastic/admin.proto (package meshtastic, syntax proto3)
/* eslint-disable */

import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
import type { Channel } from "./channel_pb";
import { file_meshtastic_channel } from "./channel_pb";
import type { Config } from "./config_pb";
import { file_meshtastic_config } from "./config_pb";
import type { DeviceConnectionStatus } from "./connection_status_pb";
import { file_meshtastic_connection_status } from "./connection_status_pb";
import type { DeviceUIConfig } from "./device_ui_pb";
import { file_meshtastic_device_ui } from "./device_ui_pb";
import type { DeviceMetadata, NodeRemoteHardwarePin, Position, User } from "./mesh_pb";
import { file_meshtastic_mesh } from "./mesh_pb";
import type { ModuleConfig } from "./module_config_pb";
import { file_meshtastic_module_config } from "./module_config_pb";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file meshtastic/admin.proto.
 */
export const file_meshtastic_admin: GenFile = /*@__PURE__*/
  fileDesc(" ", [file_meshtastic_channel, file_meshtastic_config, file_meshtastic_connection_status, file_meshtastic_device_ui, file_meshtastic_mesh, file_meshtastic_module_config]);

/**
 *
 * 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)
 *
 * @generated from message meshtastic.AdminMessage
 */
export type AdminMessage = Message<"meshtastic.AdminMessage"> & {
  /**
   *
   * 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.
   *
   * @generated from field: bytes session_passkey = 101;
   */
  sessionPasskey: Uint8Array;

  /**
   *
   * TODO: REPLACE
   *
   * @generated from oneof meshtastic.AdminMessage.payload_variant
   */
  payloadVariant: {
    /**
     *
     * 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)
     *
     * @generated from field: uint32 get_channel_request = 1;
     */
    value: number;
    case: "getChannelRequest";
  } | {
    /**
     *
     * TODO: REPLACE
     *
     * @generated from field: meshtastic.Channel get_channel_response = 2;
     */
    value: Channel;
    case: "getChannelResponse";
  } | {
    /**
     *
     * Send the current owner data in the response to this message.
     *
     * @generated from field: bool get_owner_request = 3;
     */
    value: boolean;
    case: "getOwnerRequest";
  } | {
    /**
     *
     * TODO: REPLACE
     *
     * @generated from field: meshtastic.User get_owner_response = 4;
     */
    value: User;
    case: "getOwnerResponse";
  } | {
    /**
     *
     * Ask for the following config data to be sent
     *
     * @generated from field: meshtastic.AdminMessage.ConfigType get_config_request = 5;
     */
    value: AdminMessage_ConfigType;
    case: "getConfigRequest";
  } | {
    /**
     *
     * Send the current Config in the response to this message.
     *
     * @generated from field: meshtastic.Config get_config_response = 6;
     */
    value: Config;
    case: "getConfigResponse";
  } | {
    /**
     *
     * Ask for the following config data to be sent
     *
     * @generated from field: meshtastic.AdminMessage.ModuleConfigType get_module_config_request = 7;
     */
    value: AdminMessage_ModuleConfigType;
    case: "getModuleConfigRequest";
  } | {
    /**
     *
     * Send the current Config in the response to this message.
     *
     * @generated from field: meshtastic.ModuleConfig get_module_config_response = 8;
     */
    value: ModuleConfig;
    case: "getModuleConfigResponse";
  } | {
    /**
     *
     * Get the Canned Message Module messages in the response to this message.
     *
     * @generated from field: bool get_canned_message_module_messages_request = 10;
     */
    value: boolean;
    case: "getCannedMessageModuleMessagesRequest";
  } | {
    /**
     *
     * Get the Canned Message Module messages in the response to this message.
     *
     * @generated from field: string get_canned_message_module_messages_response = 11;
     */
    value: string;
    case: "getCannedMessageModuleMessagesResponse";
  } | {
    /**
     *
     * Request the node to send device metadata (firmware, protobuf version, etc)
     *
     * @generated from field: bool get_device_metadata_request = 12;
     */
    value: boolean;
    case: "getDeviceMetadataRequest";
  } | {
    /**
     *
     * Device metadata response
     *
     * @generated from field: meshtastic.DeviceMetadata get_device_metadata_response = 13;
     */
    value: DeviceMetadata;
    case: "getDeviceMetadataResponse";
  } | {
    /**
     *
     * Get the Ringtone in the response to this message.
     *
     * @generated from field: bool get_ringtone_request = 14;
     */
    value: boolean;
    case: "getRingtoneRequest";
  } | {
    /**
     *
     * Get the Ringtone in the response to this message.
     *
     * @generated from field: string get_ringtone_response = 15;
     */
    value: string;
    case: "getRingtoneResponse";
  } | {
    /**
     *
     * Request the node to send it's connection status
     *
     * @generated from field: bool get_device_connection_status_request = 16;
     */
    value: boolean;
    case: "getDeviceConnectionStatusRequest";
  } | {
    /**
     *
     * Device connection status response
     *
     * @generated from field: meshtastic.DeviceConnectionStatus get_device_connection_status_response = 17;
     */
    value: DeviceConnectionStatus;
    case: "getDeviceConnectionStatusResponse";
  } | {
    /**
     *
     * Setup a node for licensed amateur (ham) radio operation
     *
     * @generated from field: meshtastic.HamParameters set_ham_mode = 18;
     */
    value: HamParameters;
    case: "setHamMode";
  } | {
    /**
     *
     * Get the mesh's nodes with their available gpio pins for RemoteHardware module use
     *
     * @generated from field: bool get_node_remote_hardware_pins_request = 19;
     */
    value: boolean;
    case: "getNodeRemoteHardwarePinsRequest";
  } | {
    /**
     *
     * Respond with the mesh's nodes with their available gpio pins for RemoteHardware module use
     *
     * @generated from field: meshtastic.NodeRemoteHardwarePinsResponse get_node_remote_hardware_pins_response = 20;
     */
    value: NodeRemoteHardwarePinsResponse;
    case: "getNodeRemoteHardwarePinsResponse";
  } | {
    /**
     *
     * Enter (UF2) DFU mode
     * Only implemented on NRF52 currently
     *
     * @generated from field: bool enter_dfu_mode_request = 21;
     */
    value: boolean;
    case: "enterDfuModeRequest";
  } | {
    /**
     *
     * Delete the file by the specified path from the device
     *
     * @generated from field: string delete_file_request = 22;
     */
    value: string;
    case: "deleteFileRequest";
  } | {
    /**
     *
     * Set zero and offset for scale chips
     *
     * @generated from field: uint32 set_scale = 23;
     */
    value: number;
    case: "setScale";
  } | {
    /**
     *
     * Backup the node's preferences
     *
     * @generated from field: meshtastic.AdminMessage.BackupLocation backup_preferences = 24;
     */
    value: AdminMessage_BackupLocation;
    case: "backupPreferences";
  } | {
    /**
     *
     * Restore the node's preferences
     *
     * @generated from field: meshtastic.AdminMessage.BackupLocation restore_preferences = 25;
     */
    value: AdminMessage_BackupLocation;
    case: "restorePreferences";
  } | {
    /**
     *
     * Remove backups of the node's preferences
     *
     * @generated from field: meshtastic.AdminMessage.BackupLocation remove_backup_preferences = 26;
     */
    value: AdminMessage_BackupLocation;
    case: "removeBackupPreferences";
  } | {
    /**
     *
     * Send an input event to the node.
     * This is used to trigger physical input events like button presses, touch events, etc.
     *
     * @generated from field: meshtastic.AdminMessage.InputEvent send_input_event = 27;
     */
    value: AdminMessage_InputEvent;
    case: "sendInputEvent";
  } | {
    /**
     *
     * Set the owner for this node
     *
     * @generated from field: meshtastic.User set_owner = 32;
     */
    value: User;
    case: "setOwner";
  } | {
    /**
     *
     * 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.
     *
     * @generated from field: meshtastic.Channel set_channel = 33;
     */
    value: Channel;
    case: "setChannel";
  } | {
    /**
     *
     * Set the current Config
     *
     * @generated from field: meshtastic.Config set_config = 34;
     */
    value: Config;
    case: "setConfig";
  } | {
    /**
     *
     * Set the current Config
     *
     * @generated from field: meshtastic.ModuleConfig set_module_config = 35;
     */
    value: ModuleConfig;
    case: "setModuleConfig";
  } | {
    /**
     *
     * Set the Canned Message Module messages text.
     *
     * @generated from field: string set_canned_message_module_messages = 36;
     */
    value: string;
    case: "setCannedMessageModuleMessages";
  } | {
    /**
     *
     * Set the ringtone for ExternalNotification.
     *
     * @generated from field: string set_ringtone_message = 37;
     */
    value: string;
    case: "setRingtoneMessage";
  } | {
    /**
     *
     * Remove the node by the specified node-num from the NodeDB on the device
     *
     * @generated from field: uint32 remove_by_nodenum = 38;
     */
    value: number;
    case: "removeByNodenum";
  } | {
    /**
     *
     * Set specified node-num to be favorited on the NodeDB on the device
     *
     * @generated from field: uint32 set_favorite_node = 39;
     */
    value: number;
    case: "setFavoriteNode";
  } | {
    /**
     *
     * Set specified node-num to be un-favorited on the NodeDB on the device
     *
     * @generated from field: uint32 remove_favorite_node = 40;
     */
    value: number;
    case: "removeFavoriteNode";
  } | {
    /**
     *
     * Set fixed position data on the node and then set the position.fixed_position = true
     *
     * @generated from field: meshtastic.Position set_fixed_position = 41;
     */
    value: Position;
    case: "setFixedPosition";
  } | {
    /**
     *
     * Clear fixed position coordinates and then set position.fixed_position = false
     *
     * @generated from field: bool remove_fixed_position = 42;
     */
    value: boolean;
    case: "removeFixedPosition";
  } | {
    /**
     *
     * Set time only on the node
     * Convenience method to set the time on the node (as Net quality) without any other position data
     *
     * @generated from field: fixed32 set_time_only = 43;
     */
    value: number;
    case: "setTimeOnly";
  } | {
    /**
     *
     * Tell the node to send the stored ui data.
     *
     * @generated from field: bool get_ui_config_request = 44;
     */
    value: boolean;
    case: "getUiConfigRequest";
  } | {
    /**
     *
     * Reply stored device ui data.
     *
     * @generated from field: meshtastic.DeviceUIConfig get_ui_config_response = 45;
     */
    value: DeviceUIConfig;
    case: "getUiConfigResponse";
  } | {
    /**
     *
     * Tell the node to store UI data persistently.
     *
     * @generated from field: meshtastic.DeviceUIConfig store_ui_config = 46;
     */
    value: DeviceUIConfig;
    case: "storeUiConfig";
  } | {
    /**
     *
     * Set specified node-num to be ignored on the NodeDB on the device
     *
     * @generated from field: uint32 set_ignored_node = 47;
     */
    value: number;
    case: "setIgnoredNode";
  } | {
    /**
     *
     * Set specified node-num to be un-ignored on the NodeDB on the device
     *
     * @generated from field: uint32 remove_ignored_node = 48;
     */
    value: number;
    case: "removeIgnoredNode";
  } | {
    /**
     *
     * Set specified node-num to be muted
     *
     * @generated from field: uint32 toggle_muted_node = 49;
     */
    value: number;
    case: "toggleMutedNode";
  } | {
    /**
     *
     * 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)
     *
     * @generated from field: bool begin_edit_settings = 64;
     */
    value: boolean;
    case: "beginEditSettings";
  } | {
    /**
     *
     * Commits an open transaction for any edits made to config, module config, owner, and channel settings
     *
     * @generated from field: bool commit_edit_settings = 65;
     */
    value: boolean;
    case: "commitEditSettings";
  } | {
    /**
     *
     * Add a contact (User) to the nodedb
     *
     * @generated from field: meshtastic.SharedContact add_contact = 66;
     */
    value: SharedContact;
    case: "addContact";
  } | {
    /**
     *
     * Initiate or respond to a key verification request
     *
     * @generated from field: meshtastic.KeyVerificationAdmin key_verification = 67;
     */
    value: KeyVerificationAdmin;
    case: "keyVerification";
  } | {
    /**
     *
     * 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.
     *
     * @generated from field: int32 factory_reset_device = 94;
     */
    value: number;
    case: "factoryResetDevice";
  } | {
    /**
     *
     * 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.
     * Deprecated in favor of reboot_ota_mode in 2.7.17
     *
     * @generated from field: int32 reboot_ota_seconds = 95 [deprecated = true];
     * @deprecated
     */
    value: number;
    case: "rebootOtaSeconds";
  } | {
    /**
     *
     * This message is only supported for the simulator Portduino build.
     * If received the simulator will exit successfully.
     *
     * @generated from field: bool exit_simulator = 96;
     */
    value: boolean;
    case: "exitSimulator";
  } | {
    /**
     *
     * Tell the node to reboot in this many seconds (or <0 to cancel reboot)
     *
     * @generated from field: int32 reboot_seconds = 97;
     */
    value: number;
    case: "rebootSeconds";
  } | {
    /**
     *
     * Tell the node to shutdown in this many seconds (or <0 to cancel shutdown)
     *
     * @generated from field: int32 shutdown_seconds = 98;
     */
    value: number;
    case: "shutdownSeconds";
  } | {
    /**
     *
     * Tell the node to factory reset config; all device state and configuration will be returned to factory defaults; BLE bonds will be preserved.
     *
     * @generated from field: int32 factory_reset_config = 99;
     */
    value: number;
    case: "factoryResetConfig";
  } | {
    /**
     *
     * Tell the node to reset the nodedb.
     * When true, favorites are preserved through reset.
     *
     * @generated from field: bool nodedb_reset = 100;
     */
    value: boolean;
    case: "nodedbReset";
  } | {
    /**
     *
     * Tell the node to reset into the OTA Loader
     *
     * @generated from field: meshtastic.AdminMessage.OTAEvent ota_request = 102;
     */
    value: AdminMessage_OTAEvent;
    case: "otaRequest";
  } | {
    /**
     *
     * Parameters and sensor configuration
     *
     * @generated from field: meshtastic.SensorConfig sensor_config = 103;
     */
    value: SensorConfig;
    case: "sensorConfig";
  } | {
    /**
     *
     * Lockdown passphrase delivery / unlock / lock-now command for hardened
     * firmware builds (see MESHTASTIC_LOCKDOWN). Used to provision the
     * passphrase on first boot, unlock encrypted storage on subsequent
     * reboots, re-verify on already-unlocked devices to authorize a new
     * client connection, or immediately re-lock the device.
     *
     * Replaces the earlier scheme that repurposed SecurityConfig.private_key
     * to carry passphrase bytes; that hack is retired.
     *
     * @generated from field: meshtastic.LockdownAuth lockdown_auth = 104;
     */
    value: LockdownAuth;
    case: "lockdownAuth";
  } | { case: undefined; value?: undefined };
};

/**
 * Describes the message meshtastic.AdminMessage.
 * Use `create(AdminMessageSchema)` to create a new message.
 */
export const AdminMessageSchema: GenMessage<AdminMessage> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 0);

/**
 *
 * Input event message to be sent to the node.
 *
 * @generated from message meshtastic.AdminMessage.InputEvent
 */
export type AdminMessage_InputEvent = Message<"meshtastic.AdminMessage.InputEvent"> & {
  /**
   *
   * The input event code
   *
   * @generated from field: uint32 event_code = 1;
   */
  eventCode: number;

  /**
   *
   * Keyboard character code
   *
   * @generated from field: uint32 kb_char = 2;
   */
  kbChar: number;

  /**
   *
   * The touch X coordinate
   *
   * @generated from field: uint32 touch_x = 3;
   */
  touchX: number;

  /**
   *
   * The touch Y coordinate
   *
   * @generated from field: uint32 touch_y = 4;
   */
  touchY: number;
};

/**
 * Describes the message meshtastic.AdminMessage.InputEvent.
 * Use `create(AdminMessage_InputEventSchema)` to create a new message.
 */
export const AdminMessage_InputEventSchema: GenMessage<AdminMessage_InputEvent> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 0, 0);

/**
 *
 * User is requesting an over the air update.
 * Node will reboot into the OTA loader
 *
 * @generated from message meshtastic.AdminMessage.OTAEvent
 */
export type AdminMessage_OTAEvent = Message<"meshtastic.AdminMessage.OTAEvent"> & {
  /**
   *
   * Tell the node to reboot into OTA mode for firmware update via BLE or WiFi (ESP32 only for now)
   *
   * @generated from field: meshtastic.OTAMode reboot_ota_mode = 1;
   */
  rebootOtaMode: OTAMode;

  /**
   *
   * A 32 byte hash of the OTA firmware.
   * Used to verify the integrity of the firmware before applying an update.
   *
   * @generated from field: bytes ota_hash = 2;
   */
  otaHash: Uint8Array;
};

/**
 * Describes the message meshtastic.AdminMessage.OTAEvent.
 * Use `create(AdminMessage_OTAEventSchema)` to create a new message.
 */
export const AdminMessage_OTAEventSchema: GenMessage<AdminMessage_OTAEvent> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 0, 1);

/**
 *
 * TODO: REPLACE
 *
 * @generated from enum meshtastic.AdminMessage.ConfigType
 */
export enum AdminMessage_ConfigType {
  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: DEVICE_CONFIG = 0;
   */
  DEVICE_CONFIG = 0,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: POSITION_CONFIG = 1;
   */
  POSITION_CONFIG = 1,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: POWER_CONFIG = 2;
   */
  POWER_CONFIG = 2,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: NETWORK_CONFIG = 3;
   */
  NETWORK_CONFIG = 3,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: DISPLAY_CONFIG = 4;
   */
  DISPLAY_CONFIG = 4,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: LORA_CONFIG = 5;
   */
  LORA_CONFIG = 5,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: BLUETOOTH_CONFIG = 6;
   */
  BLUETOOTH_CONFIG = 6,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: SECURITY_CONFIG = 7;
   */
  SECURITY_CONFIG = 7,

  /**
   *
   * Session key config
   *
   * @generated from enum value: SESSIONKEY_CONFIG = 8;
   */
  SESSIONKEY_CONFIG = 8,

  /**
   *
   * device-ui config
   *
   * @generated from enum value: DEVICEUI_CONFIG = 9;
   */
  DEVICEUI_CONFIG = 9,
}

/**
 * Describes the enum meshtastic.AdminMessage.ConfigType.
 */
export const AdminMessage_ConfigTypeSchema: GenEnum<AdminMessage_ConfigType> = /*@__PURE__*/
  enumDesc(file_meshtastic_admin, 0, 0);

/**
 *
 * TODO: REPLACE
 *
 * @generated from enum meshtastic.AdminMessage.ModuleConfigType
 */
export enum AdminMessage_ModuleConfigType {
  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: MQTT_CONFIG = 0;
   */
  MQTT_CONFIG = 0,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: SERIAL_CONFIG = 1;
   */
  SERIAL_CONFIG = 1,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: EXTNOTIF_CONFIG = 2;
   */
  EXTNOTIF_CONFIG = 2,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: STOREFORWARD_CONFIG = 3;
   */
  STOREFORWARD_CONFIG = 3,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: RANGETEST_CONFIG = 4;
   */
  RANGETEST_CONFIG = 4,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: TELEMETRY_CONFIG = 5;
   */
  TELEMETRY_CONFIG = 5,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: CANNEDMSG_CONFIG = 6;
   */
  CANNEDMSG_CONFIG = 6,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: AUDIO_CONFIG = 7;
   */
  AUDIO_CONFIG = 7,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: REMOTEHARDWARE_CONFIG = 8;
   */
  REMOTEHARDWARE_CONFIG = 8,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: NEIGHBORINFO_CONFIG = 9;
   */
  NEIGHBORINFO_CONFIG = 9,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: AMBIENTLIGHTING_CONFIG = 10;
   */
  AMBIENTLIGHTING_CONFIG = 10,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: DETECTIONSENSOR_CONFIG = 11;
   */
  DETECTIONSENSOR_CONFIG = 11,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: PAXCOUNTER_CONFIG = 12;
   */
  PAXCOUNTER_CONFIG = 12,

  /**
   *
   * TODO: REPLACE
   *
   * @generated from enum value: STATUSMESSAGE_CONFIG = 13;
   */
  STATUSMESSAGE_CONFIG = 13,

  /**
   *
   * Traffic management module config
   *
   * @generated from enum value: TRAFFICMANAGEMENT_CONFIG = 14;
   */
  TRAFFICMANAGEMENT_CONFIG = 14,

  /**
   *
   * TAK module config
   *
   * @generated from enum value: TAK_CONFIG = 15;
   */
  TAK_CONFIG = 15,
}

/**
 * Describes the enum meshtastic.AdminMessage.ModuleConfigType.
 */
export const AdminMessage_ModuleConfigTypeSchema: GenEnum<AdminMessage_ModuleConfigType> = /*@__PURE__*/
  enumDesc(file_meshtastic_admin, 0, 1);

/**
 * @generated from enum meshtastic.AdminMessage.BackupLocation
 */
export enum AdminMessage_BackupLocation {
  /**
   *
   * Backup to the internal flash
   *
   * @generated from enum value: FLASH = 0;
   */
  FLASH = 0,

  /**
   *
   * Backup to the SD card
   *
   * @generated from enum value: SD = 1;
   */
  SD = 1,
}

/**
 * Describes the enum meshtastic.AdminMessage.BackupLocation.
 */
export const AdminMessage_BackupLocationSchema: GenEnum<AdminMessage_BackupLocation> = /*@__PURE__*/
  enumDesc(file_meshtastic_admin, 0, 2);

/**
 *
 * Lockdown passphrase delivery payload.
 *
 * One message handles three operations distinguished by content:
 *   - Provision (first-time): passphrase set, lock_now=false. Firmware
 *     generates DEK, wraps with passphrase-derived KEK, persists.
 *   - Unlock: passphrase set, lock_now=false. Firmware verifies
 *     passphrase against stored DEK, unlocks storage, authorizes the
 *     connection that delivered this packet.
 *   - Lock now: lock_now=true, passphrase ignored. Firmware revokes
 *     all client auth and reboots into the locked state.
 *
 * Firmware decides between provision and unlock based on its own state
 * (whether a DEK file already exists). Clients do not need to track
 * which case applies.
 *
 * @generated from message meshtastic.LockdownAuth
 */
export type LockdownAuth = Message<"meshtastic.LockdownAuth"> & {
  /**
   *
   * Passphrase bytes (1-32). Empty when lock_now is true.
   * Capped to 32 to match the proto cap on related security fields.
   *
   * @generated from field: bytes passphrase = 1;
   */
  passphrase: Uint8Array;

  /**
   *
   * Optional override of the boot-count token TTL granted on success.
   * 0 = use firmware default (TOKEN_DEFAULT_BOOTS).
   * On reboot the firmware decrements this; when it reaches 0 the
   * device boots fully locked and requires a fresh passphrase.
   *
   * @generated from field: uint32 boots_remaining = 2;
   */
  bootsRemaining: number;

  /**
   *
   * Optional wall-clock expiry for the unlock token, as absolute
   * Unix-epoch seconds. 0 = no time limit (only the boot-count TTL
   * applies). On boot, if the device RTC is set and now > this value,
   * the token is treated as expired.
   *
   * @generated from field: uint32 valid_until_epoch = 3;
   */
  validUntilEpoch: number;

  /**
   *
   * If true, ignore passphrase fields, immediately revoke all
   * connection-level admin authorization, and reboot the device into
   * the locked state. Always honoured regardless of current lock state.
   *
   * @generated from field: bool lock_now = 4;
   */
  lockNow: boolean;

  /**
   *
   * Optional per-boot uptime cap on the unlocked session, in seconds.
   * 0 = unlimited (token-only enforcement, suitable for unattended
   * tower / infrastructure nodes).
   *
   * When non-zero, the firmware arms an uptime timer at unlock. On
   * each expiry, while there is still boot-count budget, the firmware
   * decrements the on-flash boot count in place, revokes per-
   * connection admin auth (clients must re-authenticate to see
   * content), re-engages the screen lock, and re-arms the timer
   * without rebooting. Mesh routing keeps running across session
   * boundaries; only when the boot-count budget reaches zero does
   * the device hard-lock and reboot.
   *
   * Total exposure ceiling = ((resolved boot count) + 1) * max_session_seconds.
   * The +1 accounts for the initial passphrase-unlocked session
   * itself, since boots_remaining is the number of subsequent
   * session rolls (each consuming one boot from the rollback ledger).
   * The resolved boot count is the value the firmware writes into the
   * token at unlock time: the client-supplied boots_remaining when
   * non-zero, otherwise the firmware default (TOKEN_DEFAULT_BOOTS).
   * Note that boots_remaining == 0 in this message means "use firmware
   * default", NOT "zero boots" — a client computing the ceiling for
   * display should mirror that resolution rather than multiplying the
   * raw request value.
   *
   * The cap is persisted in the token, so it survives token-based
   * auto-unlock across reboots. Explicit operator Lock Now still
   * deletes the token and forces passphrase re-entry.
   *
   * Uses millis() (CPU uptime), not wall-clock time, so the cap is
   * immune to GPS spoofing, RTC backup-battery removal, and Faraday
   * cage isolation — none of those move the uptime counter. The only
   * way to reset the session clock is a reboot, which costs a boot
   * from the on-flash, HMAC-bound counter.
   *
   * @generated from field: uint32 max_session_seconds = 5;
   */
  maxSessionSeconds: number;

  /**
   *
   * Disable lockdown mode. Requires a valid passphrase in the same
   * message (the device must prove the operator owns it before
   * reverting at-rest encryption). On success the firmware decrypts
   * every stored config / channel / nodedb file back to plaintext,
   * removes the wrapped DEK, unlock token, monotonic-counter, and
   * backoff files, and reboots out of lockdown.
   *
   * This is the inverse of the provision/unlock path: it is how the
   * client app's "lockdown mode" toggle returns a device to normal
   * operation.
   *
   * NOT reversed by this operation: APPROTECT. Once the debug port
   * lockout has been burned (on silicon where it is effective) it is
   * permanent — disabling lockdown decrypts your data and removes the
   * access gates, but the SWD/JTAG port stays locked for the life of
   * the device (recoverable only via a full chip erase over a debug
   * probe, which destroys all data). Clients should make this
   * irreversibility clear at the moment lockdown is first enabled.
   *
   * When true the passphrase field is still required; boots_remaining,
   * valid_until_epoch, max_session_seconds, and lock_now are ignored.
   *
   * @generated from field: bool disable = 6;
   */
  disable: boolean;
};

/**
 * Describes the message meshtastic.LockdownAuth.
 * Use `create(LockdownAuthSchema)` to create a new message.
 */
export const LockdownAuthSchema: GenMessage<LockdownAuth> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 1);

/**
 *
 * Parameters for setting up Meshtastic for ameteur radio usage
 *
 * @generated from message meshtastic.HamParameters
 */
export type HamParameters = Message<"meshtastic.HamParameters"> & {
  /**
   *
   * Amateur radio call sign, eg. KD2ABC
   *
   * @generated from field: string call_sign = 1;
   */
  callSign: string;

  /**
   *
   * Transmit power in dBm at the LoRA transceiver, not including any amplification
   *
   * @generated from field: int32 tx_power = 2;
   */
  txPower: number;

  /**
   *
   * 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.
   *
   * @generated from field: float frequency = 3;
   */
  frequency: number;

  /**
   *
   * Optional short name of user
   *
   * @generated from field: string short_name = 4;
   */
  shortName: string;

  /**
   *
   * Optional long name of user
   * Appended to callsign
   *
   * @generated from field: string long_name = 5;
   */
  longName: string;
};

/**
 * Describes the message meshtastic.HamParameters.
 * Use `create(HamParametersSchema)` to create a new message.
 */
export const HamParametersSchema: GenMessage<HamParameters> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 2);

/**
 *
 * Response envelope for node_remote_hardware_pins
 *
 * @generated from message meshtastic.NodeRemoteHardwarePinsResponse
 */
export type NodeRemoteHardwarePinsResponse = Message<"meshtastic.NodeRemoteHardwarePinsResponse"> & {
  /**
   *
   * Nodes and their respective remote hardware GPIO pins
   *
   * @generated from field: repeated meshtastic.NodeRemoteHardwarePin node_remote_hardware_pins = 1;
   */
  nodeRemoteHardwarePins: NodeRemoteHardwarePin[];
};

/**
 * Describes the message meshtastic.NodeRemoteHardwarePinsResponse.
 * Use `create(NodeRemoteHardwarePinsResponseSchema)` to create a new message.
 */
export const NodeRemoteHardwarePinsResponseSchema: GenMessage<NodeRemoteHardwarePinsResponse> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 3);

/**
 * @generated from message meshtastic.SharedContact
 */
export type SharedContact = Message<"meshtastic.SharedContact"> & {
  /**
   *
   * The node number of the contact
   *
   * @generated from field: uint32 node_num = 1;
   */
  nodeNum: number;

  /**
   *
   * The User of the contact
   *
   * @generated from field: meshtastic.User user = 2;
   */
  user?: User | undefined;

  /**
   *
   * Add this contact to the blocked / ignored list
   *
   * @generated from field: bool should_ignore = 3;
   */
  shouldIgnore: boolean;

  /**
   *
   * Set the IS_KEY_MANUALLY_VERIFIED bit
   *
   * @generated from field: bool manually_verified = 4;
   */
  manuallyVerified: boolean;
};

/**
 * Describes the message meshtastic.SharedContact.
 * Use `create(SharedContactSchema)` to create a new message.
 */
export const SharedContactSchema: GenMessage<SharedContact> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 4);

/**
 *
 * This message is used by a client to initiate or complete a key verification
 *
 * @generated from message meshtastic.KeyVerificationAdmin
 */
export type KeyVerificationAdmin = Message<"meshtastic.KeyVerificationAdmin"> & {
  /**
   * @generated from field: meshtastic.KeyVerificationAdmin.MessageType message_type = 1;
   */
  messageType: KeyVerificationAdmin_MessageType;

  /**
   *
   * The nodenum we're requesting
   *
   * @generated from field: uint32 remote_nodenum = 2;
   */
  remoteNodenum: number;

  /**
   *
   * The nonce is used to track the connection
   *
   * @generated from field: uint64 nonce = 3;
   */
  nonce: bigint;

  /**
   *
   * The 4 digit code generated by the remote node, and communicated outside the mesh
   *
   * @generated from field: optional uint32 security_number = 4;
   */
  securityNumber?: number | undefined;
};

/**
 * Describes the message meshtastic.KeyVerificationAdmin.
 * Use `create(KeyVerificationAdminSchema)` to create a new message.
 */
export const KeyVerificationAdminSchema: GenMessage<KeyVerificationAdmin> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 5);

/**
 *
 * Three stages of this request.
 *
 * @generated from enum meshtastic.KeyVerificationAdmin.MessageType
 */
export enum KeyVerificationAdmin_MessageType {
  /**
   *
   * This is the first stage, where a client initiates
   *
   * @generated from enum value: INITIATE_VERIFICATION = 0;
   */
  INITIATE_VERIFICATION = 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.
   *
   * @generated from enum value: PROVIDE_SECURITY_NUMBER = 1;
   */
  PROVIDE_SECURITY_NUMBER = 1,

  /**
   *
   * Once the user has compared the verification message, this message notifies the node.
   *
   * @generated from enum value: DO_VERIFY = 2;
   */
  DO_VERIFY = 2,

  /**
   *
   * This is the cancel path, can be taken at any point
   *
   * @generated from enum value: DO_NOT_VERIFY = 3;
   */
  DO_NOT_VERIFY = 3,
}

/**
 * Describes the enum meshtastic.KeyVerificationAdmin.MessageType.
 */
export const KeyVerificationAdmin_MessageTypeSchema: GenEnum<KeyVerificationAdmin_MessageType> = /*@__PURE__*/
  enumDesc(file_meshtastic_admin, 5, 0);

/**
 * @generated from message meshtastic.SensorConfig
 */
export type SensorConfig = Message<"meshtastic.SensorConfig"> & {
  /**
   *
   * SCD4X CO2 Sensor configuration
   *
   * @generated from field: meshtastic.SCD4X_config scd4x_config = 1;
   */
  scd4xConfig?: SCD4X_config | undefined;

  /**
   *
   * SEN5X PM Sensor configuration
   *
   * @generated from field: meshtastic.SEN5X_config sen5x_config = 2;
   */
  sen5xConfig?: SEN5X_config | undefined;

  /**
   *
   * SCD30 CO2 Sensor configuration
   *
   * @generated from field: meshtastic.SCD30_config scd30_config = 3;
   */
  scd30Config?: SCD30_config | undefined;

  /**
   *
   * SHTXX temperature and relative humidity sensor configuration
   *
   * @generated from field: meshtastic.SHTXX_config shtxx_config = 4;
   */
  shtxxConfig?: SHTXX_config | undefined;
};

/**
 * Describes the message meshtastic.SensorConfig.
 * Use `create(SensorConfigSchema)` to create a new message.
 */
export const SensorConfigSchema: GenMessage<SensorConfig> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 6);

/**
 * @generated from message meshtastic.SCD4X_config
 */
export type SCD4X_config = Message<"meshtastic.SCD4X_config"> & {
  /**
   *
   * Set Automatic self-calibration enabled
   *
   * @generated from field: optional bool set_asc = 1;
   */
  setAsc?: boolean | undefined;

  /**
   *
   * Recalibration target CO2 concentration in ppm (FRC or ASC)
   *
   * @generated from field: optional uint32 set_target_co2_conc = 2;
   */
  setTargetCo2Conc?: number | undefined;

  /**
   *
   * Reference temperature in degC
   *
   * @generated from field: optional float set_temperature = 3;
   */
  setTemperature?: number | undefined;

  /**
   *
   * Altitude of sensor in meters above sea level. 0 - 3000m (overrides ambient pressure)
   *
   * @generated from field: optional uint32 set_altitude = 4;
   */
  setAltitude?: number | undefined;

  /**
   *
   * Sensor ambient pressure in Pa. 70000 - 120000 Pa (overrides altitude)
   *
   * @generated from field: optional uint32 set_ambient_pressure = 5;
   */
  setAmbientPressure?: number | undefined;

  /**
   *
   * Perform a factory reset of the sensor
   *
   * @generated from field: optional bool factory_reset = 6;
   */
  factoryReset?: boolean | undefined;

  /**
   *
   * Power mode for sensor (true for low power, false for normal)
   *
   * @generated from field: optional bool set_power_mode = 7;
   */
  setPowerMode?: boolean | undefined;
};

/**
 * Describes the message meshtastic.SCD4X_config.
 * Use `create(SCD4X_configSchema)` to create a new message.
 */
export const SCD4X_configSchema: GenMessage<SCD4X_config> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 7);

/**
 * @generated from message meshtastic.SEN5X_config
 */
export type SEN5X_config = Message<"meshtastic.SEN5X_config"> & {
  /**
   *
   * Reference temperature in degC
   *
   * @generated from field: optional float set_temperature = 1;
   */
  setTemperature?: number | undefined;

  /**
   *
   * One-shot mode (true for low power - one-shot mode, false for normal - continuous mode)
   *
   * @generated from field: optional bool set_one_shot_mode = 2;
   */
  setOneShotMode?: boolean | undefined;
};

/**
 * Describes the message meshtastic.SEN5X_config.
 * Use `create(SEN5X_configSchema)` to create a new message.
 */
export const SEN5X_configSchema: GenMessage<SEN5X_config> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 8);

/**
 * @generated from message meshtastic.SCD30_config
 */
export type SCD30_config = Message<"meshtastic.SCD30_config"> & {
  /**
   *
   * Set Automatic self-calibration enabled
   *
   * @generated from field: optional bool set_asc = 1;
   */
  setAsc?: boolean | undefined;

  /**
   *
   * Recalibration target CO2 concentration in ppm (FRC or ASC)
   *
   * @generated from field: optional uint32 set_target_co2_conc = 2;
   */
  setTargetCo2Conc?: number | undefined;

  /**
   *
   * Reference temperature in degC
   *
   * @generated from field: optional float set_temperature = 3;
   */
  setTemperature?: number | undefined;

  /**
   *
   * Altitude of sensor in meters above sea level. 0 - 3000m (overrides ambient pressure)
   *
   * @generated from field: optional uint32 set_altitude = 4;
   */
  setAltitude?: number | undefined;

  /**
   *
   * Power mode for sensor (true for low power, false for normal)
   *
   * @generated from field: optional uint32 set_measurement_interval = 5;
   */
  setMeasurementInterval?: number | undefined;

  /**
   *
   * Perform a factory reset of the sensor
   *
   * @generated from field: optional bool soft_reset = 6;
   */
  softReset?: boolean | undefined;
};

/**
 * Describes the message meshtastic.SCD30_config.
 * Use `create(SCD30_configSchema)` to create a new message.
 */
export const SCD30_configSchema: GenMessage<SCD30_config> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 9);

/**
 * @generated from message meshtastic.SHTXX_config
 */
export type SHTXX_config = Message<"meshtastic.SHTXX_config"> & {
  /**
   *
   * Accuracy mode (0 = low, 1 = medium, 2 = high)
   *
   * @generated from field: optional uint32 set_accuracy = 1;
   */
  setAccuracy?: number | undefined;
};

/**
 * Describes the message meshtastic.SHTXX_config.
 * Use `create(SHTXX_configSchema)` to create a new message.
 */
export const SHTXX_configSchema: GenMessage<SHTXX_config> = /*@__PURE__*/
  messageDesc(file_meshtastic_admin, 10);

/**
 *
 * Firmware update mode for OTA updates
 *
 * @generated from enum meshtastic.OTAMode
 */
export enum OTAMode {
  /**
   *
   * Do not reboot into OTA mode
   *
   * @generated from enum value: NO_REBOOT_OTA = 0;
   */
  NO_REBOOT_OTA = 0,

  /**
   *
   * Reboot into OTA mode for BLE firmware update
   *
   * @generated from enum value: OTA_BLE = 1;
   */
  OTA_BLE = 1,

  /**
   *
   * Reboot into OTA mode for WiFi firmware update
   *
   * @generated from enum value: OTA_WIFI = 2;
   */
  OTA_WIFI = 2,
}

/**
 * Describes the enum meshtastic.OTAMode.
 */
export const OTAModeSchema: GenEnum<OTAMode> = /*@__PURE__*/
  enumDesc(file_meshtastic_admin, 0);

