Skip to content

Commit

Permalink
Merge pull request #1034 from meshtastic/2.5.15
Browse files Browse the repository at this point in the history
v2.5.15 changes
  • Loading branch information
garthvh authored Jan 12, 2025
2 parents 10cf4b7 + da1afd9 commit a88edec
Show file tree
Hide file tree
Showing 26 changed files with 1,350 additions and 395 deletions.
883 changes: 603 additions & 280 deletions Localizable.xcstrings

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions Meshtastic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@
DD9A1A912BA2D2D3001E602E /* MeshtasticDataModelV 30.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MeshtasticDataModelV 30.xcdatamodel"; sourceTree = "<group>"; };
DDA0B6B1294CDC55001356EC /* Channels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Channels.swift; sourceTree = "<group>"; };
DDA1C48D28DB49D3009933EC /* ChannelRoles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChannelRoles.swift; sourceTree = "<group>"; };
DDA28B1B2D32C89200EF726F /* MeshtasticDataModelV 48.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MeshtasticDataModelV 48.xcdatamodel"; sourceTree = "<group>"; };
DDA6B2E828419CF2003E8C16 /* MeshPackets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeshPackets.swift; sourceTree = "<group>"; };
DDA951592BC6624100CEA535 /* TelemetryWeather.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelemetryWeather.swift; sourceTree = "<group>"; };
DDA9515B2BC6631200CEA535 /* TelemetryEnums.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TelemetryEnums.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1754,7 +1755,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.5.14;
MARKETING_VERSION = 2.5.15;
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
Expand Down Expand Up @@ -1788,7 +1789,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.5.14;
MARKETING_VERSION = 2.5.15;
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
Expand Down Expand Up @@ -1820,7 +1821,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.5.14;
MARKETING_VERSION = 2.5.15;
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient.Widgets;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1853,7 +1854,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.5.14;
MARKETING_VERSION = 2.5.15;
PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient.Widgets;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1965,6 +1966,7 @@
DD3CC6BA28E366DF00FA9159 /* Meshtastic.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
DDA28B1B2D32C89200EF726F /* MeshtasticDataModelV 48.xcdatamodel */,
DDDFE7402D0D4A070044463C /* MeshtasticDataModelV 47.xcdatamodel */,
DD0BE30C2CB785D8000BA445 /* MeshtasticDataModelV 46.xcdatamodel */,
DD6D5A342CA13BA600ED3032 /* MeshtasticDataModelV 45.xcdatamodel */,
Expand Down Expand Up @@ -2013,7 +2015,7 @@
DD5D0A9A2931AD6B00F7EA61 /* MeshtasticDataModelV2.xcdatamodel */,
DD3CC6BB28E366DF00FA9159 /* MeshtasticDataModel.xcdatamodel */,
);
currentVersion = DDDFE7402D0D4A070044463C /* MeshtasticDataModelV 47.xcdatamodel */;
currentVersion = DDA28B1B2D32C89200EF726F /* MeshtasticDataModelV 48.xcdatamodel */;
name = Meshtastic.xcdatamodeld;
path = Meshtastic/Meshtastic.xcdatamodeld;
sourceTree = "<group>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
value = "oslogToStdio"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "publicMqttUsername"
value = "meshdev"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
Expand Down
9 changes: 8 additions & 1 deletion Meshtastic/Enums/DeviceEnums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ enum DeviceRoles: Int, CaseIterable, Identifiable {
case repeater = 4
case router = 2
case routerClient = 3
case routerLate = 11

var id: Int { self.rawValue }
var name: String {
Expand All @@ -48,6 +49,8 @@ enum DeviceRoles: Int, CaseIterable, Identifiable {
return "device.role.name.clientHidden".localized
case .lostAndFound:
return "device.role.name.lostAndFound".localized
case .routerLate:
return "device.role.name.routerlate".localized
}

}
Expand Down Expand Up @@ -75,6 +78,8 @@ enum DeviceRoles: Int, CaseIterable, Identifiable {
return "device.role.clienthidden".localized
case .lostAndFound:
return "device.role.lostandfound".localized
case .routerLate:
return "device.role.routerlate".localized
}
}

Expand All @@ -84,7 +89,7 @@ enum DeviceRoles: Int, CaseIterable, Identifiable {
return "apps.iphone"
case .clientMute:
return "speaker.slash"
case .router, .routerClient:
case .router, .routerClient, .routerLate:
return "wifi.router"
case .repeater:
return "repeat"
Expand Down Expand Up @@ -127,6 +132,8 @@ enum DeviceRoles: Int, CaseIterable, Identifiable {
return Config.DeviceConfig.Role.clientHidden
case .lostAndFound:
return Config.DeviceConfig.Role.lostAndFound
case .routerLate:
return Config.DeviceConfig.Role.routerLate
}
}
}
Expand Down
64 changes: 32 additions & 32 deletions Meshtastic/Enums/LoraConfigEnums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,49 +83,49 @@ enum RegionCodes: Int, CaseIterable, Identifiable {
var description: String {
switch self {
case .unset:
return "Please set a region"
return "please.set.a.region".localized
case .us:
return "United States"
return "united.states".localized
case .eu433:
return "European Union 433mhz"
return "european.union.433mhz".localized
case .eu868:
return "European Union 868mhz"
return "european.union.868mhz".localized
case .cn:
return "China"
return "china".localized
case .jp:
return "Japan"
return "japan".localized
case .anz:
return "Australia / New Zealand"
return "australia.new.zealand".localized
case .kr:
return "Korea"
return "korea".localized
case .tw:
return "Taiwan"
return "taiwan".localized
case .ru:
return "Russia"
return "russia".localized
case .in:
return "India"
return "india".localized
case .nz865:
return "New Zealand 865mhz"
return "new.zealand.865mhz".localized
case .th:
return "Thailand"
return "thailand".localized
case .ua433:
return "Ukraine 433mhz"
return "ukraine.433mhz".localized
case .ua868:
return "Ukraine 868mhz"
return "ukraine.868mhz".localized
case .lora24:
return "2.4 GHZ"
return "2.4ghz".localized
case .my433:
return "Malaysia 433mhz"
return "malaysia.433mhz".localized
case .my919:
return "Malaysia 919mhz"
return "malaysia.919mhz".localized
case .sg923:
return "Singapore 923mhz"
return "singapore.923mhz".localized
case .ph433:
return "Philippines 433mhz"
return "philippines.433mhz".localized
case .ph868:
return "Philippines 868mhz"
return "philippines.868mhz".localized
case .ph915:
return "Philippines 915mhz"
return "philippines.915mhz".localized
}
}
var dutyCycle: Int {
Expand Down Expand Up @@ -289,25 +289,25 @@ enum ModemPresets: Int, CaseIterable, Identifiable {

var id: Int { self.rawValue }
var description: String {
switch self {
switch self {
case .longFast:
return "Long Range - Fast"
return "long.range.fast".localized
case .longSlow:
return "Long Range - Slow"
return "long.range.slow".localized
case .longModerate:
return "Long Range - Moderate"
return "long.range.moderate".localized
case .vLongSlow:
return "Very Long Range - Slow"
return "very.long.range.slow".localized
case .medSlow:
return "Medium Range - Slow"
return "medium.range.slow".localized
case .medFast:
return "Medium Range - Fast"
return "medium.range.fast".localized
case .shortSlow:
return "Short Range - Slow"
return "short.range.slow".localized
case .shortFast:
return "Short Range - Fast"
return "short.range.fast".localized
case .shortTurbo:
return "Short Range - Turbo"
return "short.range.turbo".localized
}
}
var name: String {
Expand Down
8 changes: 4 additions & 4 deletions Meshtastic/Extensions/CoreData/UserEntityExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ extension UserEntity {
return "TLORAT3S3EPAPER"
case "TLORAT3S3V1":
return "TLORAT3S3V1"
case "TLORAV2116":
return "TLORAV2116"
case "TLORAV2118":
return "TLORAV2118"
case "TLORAV211P6":
return "TLORAV211P6"
case "TLORAV211P8":
return "TLORAV211P8"
/// Seeed Studio
case "SENSECAPINDICATOR":
return "SENSECAPINDICATOR"
Expand Down
40 changes: 24 additions & 16 deletions Meshtastic/Helpers/BLEManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,15 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
context: context,
appState: appState
)
case .alertApp:
textMessageAppPacket(
packet: decodedInfo.packet,
wantRangeTestPackets: wantRangeTestPackets,
critical: true,
connectedNode: (self.connectedPeripheral != nil ? connectedPeripheral.num : 0),
context: context,
appState: appState
)
case .remoteHardwareApp:
MeshLogger.log("🕸️ MESH PACKET received for Remote Hardware App UNHANDLED \((try? decodedInfo.packet.jsonString()) ?? "JSON Decode Failure")")
case .positionApp:
Expand Down Expand Up @@ -903,10 +912,11 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
/// Add the destination node to the end of the route towards string and the beginning of the route back string
routeString += "\(traceRoute?.node?.user?.longName ?? "unknown".localized) \((traceRoute?.node?.num ?? 0).toHex()) (\(destinationHop.snr != -32 ? String(destinationHop.snr) : "unknown ".localized)dB)"
traceRoute?.routeText = routeString

traceRoute?.hopsBack = Int32(routingMessage.routeBack.count)
// Default to -1 only fill in if routeBack is valid below
traceRoute?.hopsBack = -1
// Only if hopStart is set and there is an SNR entry
if decodedInfo.packet.hopStart > 0 && routingMessage.snrBack.count > 0 {
traceRoute?.hopsBack = Int32(routingMessage.routeBack.count)
var routeBackString = "\(traceRoute?.node?.user?.longName ?? "unknown".localized) \((traceRoute?.node?.num ?? 0).toHex()) --> "
for (index, node) in routingMessage.routeBack.enumerated() {
var hopNode = getNodeInfo(id: Int64(node), context: context)
Expand Down Expand Up @@ -947,19 +957,19 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
let snrBackLast = Float(routingMessage.snrBack.last ?? -128) / 4
routeBackString += "\(connectedNode.user?.longName ?? String(connectedNode.num.toHex())) (\(snrBackLast != -32 ? String(snrBackLast) : "unknown ".localized)dB)"
traceRoute?.routeBackText = routeBackString
traceRoute?.hops = NSOrderedSet(array: hopNodes)
traceRoute?.time = Date()
do {
try context.save()
Logger.data.info("💾 Saved Trace Route")
} catch {
context.rollback()
let nsError = error as NSError
Logger.data.error("Error Updating Core Data TraceRouteHop: \(nsError, privacy: .public)")
}
let logString = String.localizedStringWithFormat("mesh.log.traceroute.received.route %@".localized, routeString)
MeshLogger.log("🪧 \(logString)")
}
traceRoute?.hops = NSOrderedSet(array: hopNodes)
traceRoute?.time = Date()
do {
try context.save()
Logger.data.info("💾 Saved Trace Route")
} catch {
context.rollback()
let nsError = error as NSError
Logger.data.error("Error Updating Core Data TraceRouteHop: \(nsError, privacy: .public)")
}
let logString = String.localizedStringWithFormat("mesh.log.traceroute.received.route %@".localized, routeString)
MeshLogger.log("🪧 \(logString)")
}
case .neighborinfoApp:
if let neighborInfo = try? NeighborInfo(serializedBytes: decodedInfo.packet.decoded.payload) {
Expand All @@ -978,8 +988,6 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate
MeshLogger.log("🕸️ MESH PACKET received for ATAK Plugin App UNHANDLED \((try? decodedInfo.packet.jsonString()) ?? "JSON Decode Failure")")
case .powerstressApp:
MeshLogger.log("🕸️ MESH PACKET received for Power Stress App UNHANDLED \((try? decodedInfo.packet.jsonString()) ?? "JSON Decode Failure")")
case .alertApp:
MeshLogger.log("🕸️ MESH PACKET received for Alert App UNHANDLED \((try? decodedInfo.packet.jsonString()) ?? "JSON Decode Failure")")
}

if decodedInfo.configCompleteID != 0 && decodedInfo.configCompleteID == configNonce {
Expand Down
4 changes: 4 additions & 0 deletions Meshtastic/Helpers/LocalNotificationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class LocalNotificationManager {
if notification.userNum != nil {
content.userInfo["userNum"] = notification.userNum
}
if notification.critical {
content.sound = UNNotificationSound.defaultCritical
}

let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)
let request = UNNotificationRequest(identifier: notification.id, content: content, trigger: trigger)
Expand Down Expand Up @@ -101,4 +104,5 @@ struct Notification {
var messageId: Int64?
var channel: Int32?
var userNum: Int64?
var critical: Bool = false
}
2 changes: 2 additions & 0 deletions Meshtastic/Helpers/MeshPackets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func myInfoPacket (myInfo: MyNodeInfo, peripheralId: String, context: NSManagedO
myInfoEntity.peripheralId = peripheralId
myInfoEntity.myNodeNum = Int64(myInfo.myNodeNum)
myInfoEntity.rebootCount = Int32(myInfo.rebootCount)
myInfoEntity.deviceId = myInfo.deviceID
do {
try context.save()
Logger.data.info("💾 Saved a new myInfo for node: \(myInfo.myNodeNum.toHex(), privacy: .public)")
Expand Down Expand Up @@ -820,6 +821,7 @@ func telemetryPacket(packet: MeshPacket, connectedNode: Int64, context: NSManage
func textMessageAppPacket(
packet: MeshPacket,
wantRangeTestPackets: Bool,
critical: Bool = false,
connectedNode: Int64,
storeForward: Bool = false,
context: NSManagedObjectContext,
Expand Down
12 changes: 9 additions & 3 deletions Meshtastic/Helpers/Mqtt/MqttClientProxyManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MqttClientProxyManager {
var debugLog = false
func connectFromConfigSettings(node: NodeInfoEntity) {
let defaultServerAddress = "mqtt.meshtastic.org"
let useSsl = node.mqttConfig?.tlsEnabled == true
var useSsl = node.mqttConfig?.tlsEnabled == false
var defaultServerPort = useSsl ? 8883 : 1883
var host = node.mqttConfig?.address
if host == nil || host!.isEmpty {
Expand All @@ -43,8 +43,14 @@ class MqttClientProxyManager {

if let host = host {
let port = defaultServerPort
let username = node.mqttConfig?.username
let password = node.mqttConfig?.password
var username = node.mqttConfig?.username
var password = node.mqttConfig?.password
if host == defaultServerAddress {

// username = ProcessInfo.processInfo.environment["publicMqttUsername"]
// password = ProcessInfo.processInfo.environment["publicMqttPsk"]
useSsl = false
}
let root = node.mqttConfig?.root?.count ?? 0 > 0 ? node.mqttConfig?.root : "msh"
let prefix = root!
topic = prefix + (supportedVersion ? "/2/e" : "/2/c") + "/#"
Expand Down
2 changes: 2 additions & 0 deletions Meshtastic/Meshtastic.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.usernotifications.critical-alerts</key>
<true/>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:meshtastic.org/e/*</string>
Expand Down
2 changes: 1 addition & 1 deletion Meshtastic/Meshtastic.xcdatamodeld/.xccurrentversion
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>MeshtasticDataModelV 47.xcdatamodel</string>
<string>MeshtasticDataModelV 48.xcdatamodel</string>
</dict>
</plist>
Loading

0 comments on commit a88edec

Please sign in to comment.