Merge pull request #233 from meshtastic/2.0_Alpha_Launch

Crash Report Cleanup
This commit is contained in:
Garth Vander Houwen 2022-11-11 19:22:41 -08:00 committed by GitHub
commit 2dcf1f950b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 23 deletions

View file

@ -520,8 +520,8 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
if nodeInfo != nil {
if self.connectedPeripheral != nil && self.connectedPeripheral.num == nodeInfo!.num {
if nodeInfo!.user != nil {
connectedPeripheral.shortName = nodeInfo!.user!.shortName ?? "????"
connectedPeripheral.longName = nodeInfo!.user!.longName ?? "Unknown"
connectedPeripheral.shortName = nodeInfo?.user?.shortName ?? "????"
connectedPeripheral.longName = nodeInfo?.user?.longName ?? "Unknown"
}
}
}
@ -776,17 +776,17 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
positionPacket.altitude = Int32(LocationHelper.currentAltitude)
positionPacket.timestamp = UInt32(LocationHelper.currentTimestamp.timeIntervalSince1970)
positionPacket.groundSpeed = UInt32(LocationHelper.currentSpeed)
//positionPacket.groundTrack = UInt32(LocationHelper.currentHeading)
var waypointPacket = Waypoint()
waypointPacket.latitudeI = Int32(LocationHelper.currentLocation.latitude * 1e7)
waypointPacket.longitudeI = Int32(LocationHelper.currentLocation.longitude * 1e7)
let oneWeekFromNow = Calendar.current.date(byAdding: .day, value: 7, to: Date())
waypointPacket.expire = UInt32(oneWeekFromNow!.timeIntervalSince1970)
waypointPacket.name = "Test Waypoint"
if LocationHelper.currentHeading > 0 {
positionPacket.groundTrack = UInt32(LocationHelper.currentHeading)
}
//var waypointPacket = Waypoint()
//waypointPacket.latitudeI = Int32(LocationHelper.currentLocation.latitude * 1e7)
//waypointPacket.longitudeI = Int32(LocationHelper.currentLocation.longitude * 1e7)
//let oneWeekFromNow = Calendar.current.date(byAdding: .day, value: 7, to: Date())
//waypointPacket.expire = UInt32(oneWeekFromNow!.timeIntervalSince1970)
//waypointPacket.name = "Test Waypoint"
var meshPacket = MeshPacket()
meshPacket.to = UInt32(destNum)
meshPacket.from = 0 // Send 0 as from from phone to device to avoid warning about client trying to set node num

View file

@ -7,15 +7,13 @@ import CoreData
struct MeshtasticAppleApp: App {
let persistenceController = PersistenceController.shared
@ObservedObject private var bleManager: BLEManager = BLEManager.shared
@ObservedObject private var userSettings: UserSettings = UserSettings()
@Environment(\.scenePhase) var scenePhase
@State var saveChannels = false
@State var incomingUrl: URL?
@State var channelSettings: String?
@Environment(\.scenePhase) var scenePhase
var body: some Scene {
WindowGroup {

View file

@ -103,7 +103,7 @@ struct Connect: View {
Text("Num: \(String(node!.num))")
Text("Short Name: \(node?.user?.shortName ?? "????")")
Text("Long Name: \(node?.user?.longName ?? "Unknown")")
Text("Max Channels: \(String(node!.myInfo!.maxChannels))")
Text("Max Channels: \(String(node?.myInfo?.maxChannels ?? 0))")
Text("Bitrate: \(String(format: "%.2f", node?.myInfo?.bitrate ?? 0.00))")
Text("BLE RSSI: \(bleManager.connectedPeripheral.rssi)")

View file

@ -29,8 +29,8 @@ struct Contacts: View {
List {
Section(header: Text("Channels (groups)")) {
// Display Contacts for the rest of the non admin channels
if node != nil {
ForEach(node!.myInfo!.channels?.array as! [ChannelEntity], id: \.self) { (channel: ChannelEntity) in
if node != nil && node!.myInfo != nil && node!.myInfo!.channels != nil {
ForEach(node!.myInfo!.channels!.array as! [ChannelEntity], id: \.self) { (channel: ChannelEntity) in
if channel.name?.lowercased() ?? "" != "admin" && channel.name?.lowercased() ?? "" != "gpio" {
VStack {
NavigationLink(destination: ChannelMessageList(channel: channel)) {

View file

@ -21,12 +21,6 @@ struct DeviceMetricsLog: View {
var node: NodeInfoEntity
struct MountPrice: Identifiable {
var id = UUID()
var mount: String
var value: Double
}
var body: some View {
NavigationStack {
let oneDayAgo = Calendar.current.date(byAdding: .day, value: -3, to: Date())