mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Merge remote-tracking branch 'refs/remotes/origin/2.6.12'
This commit is contained in:
commit
27343720be
5 changed files with 52 additions and 32 deletions
|
|
@ -60,9 +60,9 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
let NONCE_ONLY_DB = 69421
|
||||
private var isWaitingForWantConfigResponse = false
|
||||
|
||||
private var wantConfigTimer: Timer?
|
||||
private var wantConfigRetryCount = 0
|
||||
private let maxWantConfigRetries = 6
|
||||
private var wantConfigTimer: Timer?
|
||||
private var wantConfigRetryCount = 0
|
||||
private let maxWantConfigRetries = 6
|
||||
private let wantConfigTimeoutInterval: TimeInterval = 6.0
|
||||
|
||||
// MARK: init
|
||||
|
|
@ -799,42 +799,42 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
|
|||
}
|
||||
}
|
||||
}
|
||||
guard let cp = connectedPeripheral else {
|
||||
return
|
||||
}
|
||||
// Channels
|
||||
if decodedInfo.channel.isInitialized && connectedPeripheral != nil {
|
||||
if decodedInfo.channel.isInitialized {
|
||||
nowKnown = true
|
||||
channelPacket(channel: decodedInfo.channel, fromNum: Int64(truncatingIfNeeded: connectedPeripheral.num), context: context)
|
||||
channelPacket(channel: decodedInfo.channel, fromNum: Int64(truncatingIfNeeded: cp.num), context: context)
|
||||
}
|
||||
// Config
|
||||
if decodedInfo.config.isInitialized && !invalidVersion && connectedPeripheral != nil && self.connectedPeripheral?.num != 0 {
|
||||
if decodedInfo.config.isInitialized && !invalidVersion && cp.num != 0 {
|
||||
nowKnown = true
|
||||
localConfig(config: decodedInfo.config, context: context, nodeNum: Int64(truncatingIfNeeded: self.connectedPeripheral.num), nodeLongName: self.connectedPeripheral?.longName ?? "Unknown")
|
||||
localConfig(config: decodedInfo.config, context: context, nodeNum: Int64(truncatingIfNeeded: cp.num), nodeLongName: cp.longName)
|
||||
}
|
||||
// Module Config
|
||||
if decodedInfo.moduleConfig.isInitialized && !invalidVersion && self.connectedPeripheral?.num != 0 {
|
||||
if decodedInfo.moduleConfig.isInitialized && !invalidVersion && cp.num != 0 {
|
||||
onWantConfigResponseReceived()
|
||||
nowKnown = true
|
||||
moduleConfig(config: decodedInfo.moduleConfig, context: context, nodeNum: Int64(truncatingIfNeeded: self.connectedPeripheral.num), nodeLongName: self.connectedPeripheral?.longName ?? "Unknown")
|
||||
moduleConfig(config: decodedInfo.moduleConfig, context: context, nodeNum: Int64(truncatingIfNeeded: cp.num), nodeLongName: cp.longName)
|
||||
if decodedInfo.moduleConfig.payloadVariant == ModuleConfig.OneOf_PayloadVariant.cannedMessage(decodedInfo.moduleConfig.cannedMessage) {
|
||||
if decodedInfo.moduleConfig.cannedMessage.enabled {
|
||||
if let connectedNum = self.connectedPeripheral?.num, connectedNum > 0 {
|
||||
_ = self.getCannedMessageModuleMessages(destNum: connectedNum, wantResponse: true)
|
||||
}
|
||||
_ = self.getCannedMessageModuleMessages(destNum: cp.num, wantResponse: true)
|
||||
|
||||
}
|
||||
}
|
||||
if decodedInfo.config.payloadVariant == Config.OneOf_PayloadVariant.device(decodedInfo.config.device) {
|
||||
var dc = decodedInfo.config.device
|
||||
if dc.tzdef.isEmpty {
|
||||
dc.tzdef = TimeZone.current.posixDescription
|
||||
if let connectedNum = self.connectedPeripheral?.num, connectedNum > 0 {
|
||||
let adminMessageId = self.saveTimeZone(config: dc, user: connectedNum)
|
||||
}
|
||||
let adminMessageId = self.saveTimeZone(config: dc, user: cp.num)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Device Metadata
|
||||
if decodedInfo.metadata.firmwareVersion.count > 0 && !invalidVersion {
|
||||
nowKnown = true
|
||||
deviceMetadataPacket(metadata: decodedInfo.metadata, fromNum: connectedPeripheral.num, context: context)
|
||||
deviceMetadataPacket(metadata: decodedInfo.metadata, fromNum: cp.num, context: context)
|
||||
connectedPeripheral.firmwareVersion = decodedInfo.metadata.firmwareVersion
|
||||
let lastDotIndex = decodedInfo.metadata.firmwareVersion.lastIndex(of: ".")
|
||||
if lastDotIndex == nil {
|
||||
|
|
|
|||
|
|
@ -924,6 +924,8 @@ func upsertSecurityConfigPacket(config: Config.SecurityConfig, nodeNum: Int64, s
|
|||
fetchedNode[0].securityConfig?.adminKey = config.adminKey[0]
|
||||
if config.adminKey.count > 1 {
|
||||
fetchedNode[0].securityConfig?.adminKey2 = config.adminKey[1]
|
||||
}
|
||||
if config.adminKey.count > 2 {
|
||||
fetchedNode[0].securityConfig?.adminKey3 = config.adminKey[2]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -436,6 +436,12 @@ public struct Config: Sendable {
|
|||
/// Non-notification system buzzer tones only.
|
||||
/// Buzzer is enabled only for non-notification tones such as button presses, startup, shutdown, but not for alerts.
|
||||
case systemOnly // = 3
|
||||
|
||||
///
|
||||
/// Direct Message notifications only.
|
||||
/// Buzzer is enabled only for direct messages and alerts, but not for button presses.
|
||||
/// External notification config determines the specifics of the notification behavior.
|
||||
case directMsgOnly // = 4
|
||||
case UNRECOGNIZED(Int)
|
||||
|
||||
public init() {
|
||||
|
|
@ -448,6 +454,7 @@ public struct Config: Sendable {
|
|||
case 1: self = .disabled
|
||||
case 2: self = .notificationsOnly
|
||||
case 3: self = .systemOnly
|
||||
case 4: self = .directMsgOnly
|
||||
default: self = .UNRECOGNIZED(rawValue)
|
||||
}
|
||||
}
|
||||
|
|
@ -458,6 +465,7 @@ public struct Config: Sendable {
|
|||
case .disabled: return 1
|
||||
case .notificationsOnly: return 2
|
||||
case .systemOnly: return 3
|
||||
case .directMsgOnly: return 4
|
||||
case .UNRECOGNIZED(let i): return i
|
||||
}
|
||||
}
|
||||
|
|
@ -468,6 +476,7 @@ public struct Config: Sendable {
|
|||
.disabled,
|
||||
.notificationsOnly,
|
||||
.systemOnly,
|
||||
.directMsgOnly,
|
||||
]
|
||||
|
||||
}
|
||||
|
|
@ -2268,6 +2277,7 @@ extension Config.DeviceConfig.BuzzerMode: SwiftProtobuf._ProtoNameProviding {
|
|||
1: .same(proto: "DISABLED"),
|
||||
2: .same(proto: "NOTIFICATIONS_ONLY"),
|
||||
3: .same(proto: "SYSTEM_ONLY"),
|
||||
4: .same(proto: "DIRECT_MSG_ONLY"),
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -442,15 +442,15 @@ public enum HardwareModel: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|||
/// Elecrow CrowPanel Advance models, ESP32-S3 and TFT with SX1262 radio plugin
|
||||
case crowpanel // = 97
|
||||
|
||||
///*
|
||||
///
|
||||
/// Lilygo LINK32 board with sensors
|
||||
case link32 // = 98
|
||||
|
||||
///*
|
||||
///
|
||||
/// Seeed Tracker L1
|
||||
case seeedWioTrackerL1 // = 99
|
||||
|
||||
///*
|
||||
///
|
||||
/// Seeed Tracker L1 EINK driver
|
||||
case seeedWioTrackerL1Eink // = 100
|
||||
|
||||
|
|
@ -458,26 +458,30 @@ public enum HardwareModel: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|||
/// Reserved ID for future and past use
|
||||
case qwantzTinyArms // = 101
|
||||
|
||||
///*
|
||||
///
|
||||
/// Lilygo T-Deck Pro
|
||||
case tDeckPro // = 102
|
||||
|
||||
///*
|
||||
///
|
||||
/// Lilygo TLora Pager
|
||||
case tLoraPager // = 103
|
||||
|
||||
///*
|
||||
///
|
||||
/// GAT562 Mesh Trial Tracker
|
||||
case gat562MeshTrialTracker // = 104
|
||||
|
||||
///*
|
||||
/// RAKwireless WisMesh Tag
|
||||
///
|
||||
/// RAKwireless WisMesh Tag
|
||||
case wismeshTag // = 105
|
||||
|
||||
///*
|
||||
///
|
||||
/// RAKwireless WisBlock Core RAK3312 https://docs.rakwireless.com/product-categories/wisduo/rak3112-module/overview/
|
||||
case rak3312 // = 106
|
||||
|
||||
///
|
||||
/// Elecrow ThinkNode M5 https://www.elecrow.com/wiki/ThinkNode_M5_Meshtastic_LoRa_Signal_Transceiver_ESP32-S3.html
|
||||
case thinknodeM5 // = 107
|
||||
|
||||
///
|
||||
/// ------------------------------------------------------------------------------------------------------------------------------------------
|
||||
/// Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits.
|
||||
|
|
@ -598,6 +602,7 @@ public enum HardwareModel: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|||
case 104: self = .gat562MeshTrialTracker
|
||||
case 105: self = .wismeshTag
|
||||
case 106: self = .rak3312
|
||||
case 107: self = .thinknodeM5
|
||||
case 255: self = .privateHw
|
||||
default: self = .UNRECOGNIZED(rawValue)
|
||||
}
|
||||
|
|
@ -712,6 +717,7 @@ public enum HardwareModel: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|||
case .gat562MeshTrialTracker: return 104
|
||||
case .wismeshTag: return 105
|
||||
case .rak3312: return 106
|
||||
case .thinknodeM5: return 107
|
||||
case .privateHw: return 255
|
||||
case .UNRECOGNIZED(let i): return i
|
||||
}
|
||||
|
|
@ -826,6 +832,7 @@ public enum HardwareModel: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|||
.gat562MeshTrialTracker,
|
||||
.wismeshTag,
|
||||
.rak3312,
|
||||
.thinknodeM5,
|
||||
.privateHw,
|
||||
]
|
||||
|
||||
|
|
@ -1073,7 +1080,7 @@ public enum ExcludedModules: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|||
/// Paxcounter module
|
||||
case paxcounterConfig // = 4096
|
||||
|
||||
///
|
||||
///
|
||||
/// Bluetooth config (not technically a module, but used to indicate bluetooth capabilities)
|
||||
case bluetoothConfig // = 8192
|
||||
|
||||
|
|
@ -3656,6 +3663,7 @@ extension HardwareModel: SwiftProtobuf._ProtoNameProviding {
|
|||
104: .same(proto: "GAT562_MESH_TRIAL_TRACKER"),
|
||||
105: .same(proto: "WISMESH_TAG"),
|
||||
106: .same(proto: "RAK3312"),
|
||||
107: .same(proto: "THINKNODE_M5"),
|
||||
255: .same(proto: "PRIVATE_HW"),
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
|
|||
}
|
||||
|
||||
/// Note: There are no 'PowerMon' messages normally in use (PowerMons are sent only as structured logs - slogs).
|
||||
///But we wrap our State enum in this message to effectively nest a namespace (without our linter yelling at us)
|
||||
/// But we wrap our State enum in this message to effectively nest a namespace (without our linter yelling at us)
|
||||
public struct PowerMon: Sendable {
|
||||
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
||||
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||
|
|
@ -30,7 +30,7 @@ public struct PowerMon: Sendable {
|
|||
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
/// Any significant power changing event in meshtastic should be tagged with a powermon state transition.
|
||||
///If you are making new meshtastic features feel free to add new entries at the end of this definition.
|
||||
/// If you are making new meshtastic features feel free to add new entries at the end of this definition.
|
||||
public enum State: SwiftProtobuf.Enum, Swift.CaseIterable {
|
||||
public typealias RawValue = Int
|
||||
case none // = 0
|
||||
|
|
@ -57,8 +57,8 @@ public struct PowerMon: Sendable {
|
|||
case wifiOn // = 1024
|
||||
|
||||
///
|
||||
///GPS is actively trying to find our location
|
||||
///See GPSPowerState for more details
|
||||
/// GPS is actively trying to find our location
|
||||
/// See GPSPowerState for more details
|
||||
case gpsActive // = 2048
|
||||
case UNRECOGNIZED(Int)
|
||||
|
||||
|
|
@ -143,8 +143,8 @@ public struct PowerStressMessage: Sendable {
|
|||
|
||||
///
|
||||
/// What operation would we like the UUT to perform.
|
||||
///note: senders should probably set want_response in their request packets, so that they can know when the state
|
||||
///machine has started processing their request
|
||||
/// note: senders should probably set want_response in their request packets, so that they can know when the state
|
||||
/// machine has started processing their request
|
||||
public enum Opcode: SwiftProtobuf.Enum, Swift.CaseIterable {
|
||||
public typealias RawValue = Int
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue