Merge remote-tracking branch 'refs/remotes/origin/main'

Conflicts:
	Meshtastic Client.xcodeproj/project.pbxproj
This commit is contained in:
Garth Vander Houwen 2021-11-07 11:09:40 -08:00
commit 8d543b5ab6
53 changed files with 355 additions and 35 deletions

View file

@ -660,9 +660,11 @@
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = "1,2,6";
VALIDATE_PRODUCT = YES;
};
name = Release;

View file

@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "SwiftProtobuf",
"repositoryURL": "https://github.com/apple/swift-protobuf.git",
"state": {
"branch": null,
"revision": "1f62db409f2c9b0223a3f68567b4a01333aae778",
"version": "1.17.0"
}
}
]
},
"version": 1
}

View file

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "9B1FFF75-E7CB-412C-9E36-818818560AB5"
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "E2F0AD2B-B4D4-4739-AFCE-569FBD4DD145"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "MeshtasticClient/Views/Helpers/BLEManager.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "141"
endingLineNumber = "141"
landmarkName = "centralManager(_:didDisconnectPeripheral:error:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
uuid = "12255D18-6C26-414C-961B-253AC2DA6E98"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
breakpointStackSelectionBehavior = "1"
scope = "1"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "F27E80D7-F96D-46E5-8456-4F1098121908"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "MeshtasticClient/Helpers/BLEManager.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "471"
endingLineNumber = "471"
landmarkName = "peripheral(_:didUpdateValueFor:error:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "4241791A-F03C-444B-B7FD-A5749F95FD51"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "MeshtasticClient/Helpers/BLEManager.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "353"
endingLineNumber = "353"
landmarkName = "peripheral(_:didUpdateNotificationStateFor:error:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "DB6E77E0-7B23-469A-B2C0-01FB3B30FBB2"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "MeshtasticClient/Helpers/BLEManager.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "431"
endingLineNumber = "431"
landmarkName = "peripheral(_:didUpdateValueFor:error:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "655DCEC0-309D-430A-AF50-2453B6ADB1F6.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "655DCEC0-309D-430A-AF50-2453B6ADB1F6-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "655DCEC0-309D-430A-AF50-2453B6ADB1F6-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "RAK7205_Enclosure-With-Solar-Panel_Top-View_01_9ed42002-fb51-4c49-a69e-43fcef692ef6_739x@2x.progressive-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "RAK7205_Enclosure-With-Solar-Panel_Top-View_01_9ed42002-fb51-4c49-a69e-43fcef692ef6_739x@2x.progressive.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "tbeam-2.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "tbeam-1.jpg",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tbeam.jpg",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "techo-2.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "techo-1.jpg",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "techo.jpg",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "tlora-2.jpeg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "tlora-1.jpeg",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tlora.jpeg",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

View file

@ -0,0 +1,20 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,20 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,20 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -20,8 +20,8 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
}
}
@ObservedObject var meshData : MeshData
@ObservedObject var messageData : MessageData
@Published var meshData : MeshData
@Published var messageData : MessageData
private var centralManager: CBCentralManager!
@ -114,22 +114,22 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
self.timeoutTimerCount += 1
if timeoutTimerCount == 6 {
if timeoutTimerCount == 10 {
if connectedPeripheral != nil && connectedPeripheral.peripheral.state != CBPeripheralState.connected {
if connectedPeripheral != nil {
self.centralManager?.cancelPeripheralConnection(connectedPeripheral.peripheral)
connectedNode = nil
connectedPeripheral = nil
if meshLoggingEnabled { Logger.log("BLE Connecting Timeout Timer disconnected orphaned radio: \(name) in state: \(connectedPeripheral.peripheral.state.rawValue)") }
}
self.lastConnectionError = "Timeout while connecting to \(name)."
print("BLE Connecting 2 Second Timeout Timer Fired \(timeoutTimerCount) Times and failed: \(name)")
if meshLoggingEnabled { Logger.log("BLE Connecting 2 Second Timeout Timer Fired \(timeoutTimerCount) Times and failed: \(name)") }
connectedNode = nil
connectedPeripheral = nil
self.lastConnectionError = "BLE Connecting Timeout after making \(timeoutTimerCount) attempts to connect to \(name)."
print("BLE Connecting Timeout after making \(timeoutTimerCount) attempts to connect to \(name).")
if meshLoggingEnabled { Logger.log("BLE Connecting Timeout after making \(timeoutTimerCount) attempts to connect to \(String(name)).") }
self.timeoutTimer?.invalidate()
self.timeoutTimerCount = 0
self.timeoutTimer?.invalidate()
}
else {
print("BLE Connecting 2 Second Timeout Timer Fired \(timeoutTimerCount) Time(s): \(name)")

View file

@ -6,6 +6,8 @@
<true/>
<key>com.apple.security.device.bluetooth</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.personal-information.location</key>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="19461" systemVersion="21A559" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="NodeInfoEntity" representedClassName="NodeInfoEntity" syncable="YES">
<fetchedProperty name="fetchedProperty" optional="YES">
<fetchRequest name="fetchedPropertyFetchRequest" entity="NodeInfoEntity"/>
</fetchedProperty>
</entity>
<elements>
<element name="NodeInfoEntity" positionX="-45" positionY="0" width="128" height="50"/>
</elements>
</model>

View file

@ -6,7 +6,7 @@ struct MeshtasticClientApp: App {
@ObservedObject private var bleManager: BLEManager = BLEManager()
@ObservedObject private var userSettings: UserSettings = UserSettings()
//let persistenceController = PersistenceController.shared
//@Environment(\.scenePhase) var scenePhase
@Environment(\.scenePhase) var scenePhase
var body: some Scene {
WindowGroup {
@ -15,18 +15,18 @@ struct MeshtasticClientApp: App {
.environmentObject(userSettings)
//.environment(\.managedObjectContext, persistenceController.container.viewContext)
}
//.onChange(of: scenePhase) { (newScenePhase) in
// switch newScenePhase {
// case .background:
// print("Scene is in the background")
// persistenceController.save()
// case .inactive:
// print("Scene is inactive")
// case .active:
// print("Scene is active")
// @unknown default:
// print("Apple must have changed something")
// }
//}
.onChange(of: scenePhase) { (newScenePhase) in
switch newScenePhase {
case .background:
print("Scene is in the background")
//persistenceController.save()
case .inactive:
print("Scene is inactive")
case .active:
print("Scene is active")
@unknown default:
print("Apple must have changed something")
}
}
}
}

View file

@ -0,0 +1,16 @@
import Foundation
import CoreData
//extension NodeInfoEntity {
// @nonobjc public class func createFetchRequest() -> NSFetchRequest<NodeInfoEntity> {
// return NSFetchRequest<Commit>(entityName: "NodeInfoEntity")
// }
// @NSManaged public var id: UInt32
// @NSManaged public var num: UInt32
// @NSManaged public var sha: String
// @NSManaged public var url: String
//}

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="19461" systemVersion="21A559" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="NodeInfoEntity" representedClassName="NodeInfoEntity" syncable="YES"/>
<elements>
<element name="NodeInfoEntity" positionX="-27" positionY="18" width="128" height="29"/>
</elements>
</model>

View file

@ -0,0 +1,8 @@
# 1.27.8
* Update NodeList SwipeAction Button to be role: Destructive
* Added com.apple.security.files.user-selected.read-write entitlement to AppSandbox for MacOS for Mesh log download
* Cleaned up bluetooth connecting timeout errors and logic, run 10 2 second timers now

View file

@ -103,7 +103,6 @@ struct Connect: View {
Button(role: .destructive) {
if bleManager.connectedPeripheral != nil && bleManager.connectedPeripheral.peripheral.state == CBPeripheralState.connected
{
bleManager.disconnectDevice()
isPreferredRadio = false
}

View file

@ -14,8 +14,10 @@ struct Messages: View {
@State private var totalBytes = 0
@State private var lastTypingMessage = ""
@FocusState private var focusedField: Field?
@Namespace var topId
@Namespace var bottomId
@State var showDeleteMessageAlert = false
@State private var deleteMessageId : UInt32 = 0

View file

@ -65,17 +65,15 @@ struct NodeList: View {
}
}
.swipeActions {
Button {
let nodeIndex = bleManager.meshData.nodes.firstIndex(where: { $0.id == node.id })
bleManager.meshData.nodes.remove(at: nodeIndex!)
bleManager.meshData.save()
.swipeActions (edge: .trailing) {
Button (role: .destructive) {
let nodeIndex = bleManager.meshData.nodes.firstIndex(where: { $0.num == node.num })
bleManager.meshData.nodes.remove(at: nodeIndex!)
bleManager.meshData.save()
} label: {
Label("Delete from app", systemImage: "trash")
}
.tint(.red)
}
}
}
}
@ -83,6 +81,7 @@ struct NodeList: View {
.navigationTitle("All Nodes")
.onAppear(
perform: {
bleManager.meshData.load()
if UIDevice.current.userInterfaceIdiom == .pad {
if bleManager.meshData.nodes.count > 0 {
selection = "0"