mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
35 lines
574 B
Swift
35 lines
574 B
Swift
//
|
|
// NetworkEnums.swift
|
|
// Meshtastic
|
|
//
|
|
// Copyright(C) Garth Vander Houwen 11/25/22.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
enum EthernetMode: Int, CaseIterable, Identifiable {
|
|
|
|
case dhcp = 0
|
|
case staticip = 1
|
|
|
|
var id: Int { self.rawValue }
|
|
var description: String {
|
|
|
|
switch self {
|
|
case .dhcp:
|
|
return "DHCP"
|
|
case .staticip:
|
|
return "Static IP"
|
|
}
|
|
}
|
|
func protoEnumValue() -> Config.NetworkConfig.AddressMode {
|
|
|
|
switch self {
|
|
|
|
case .dhcp:
|
|
return Config.NetworkConfig.AddressMode.dhcp
|
|
case .staticip:
|
|
return Config.NetworkConfig.AddressMode.static
|
|
}
|
|
}
|
|
}
|