diff --git a/Meshtastic/Helpers/MeshPackets.swift b/Meshtastic/Helpers/MeshPackets.swift index 79475f4e..18fd6aa9 100644 --- a/Meshtastic/Helpers/MeshPackets.swift +++ b/Meshtastic/Helpers/MeshPackets.swift @@ -534,27 +534,27 @@ func routingPacket (packet: MeshPacket, connectedNodeNum: Int64, context: NSMana } fetchedMessage![0].ackSNR = packet.rxSnr fetchedMessage![0].ackTimestamp = Int32(packet.rxTime) + + if fetchedMessage![0].toUser != nil { + fetchedMessage![0].toUser!.objectWillChange.send() + } else { + let fetchMyInfoRequest: NSFetchRequest = NSFetchRequest.init(entityName: "MyInfoEntity") + fetchMyInfoRequest.predicate = NSPredicate(format: "myNodeNum == %lld", connectedNodeNum) + do { + let fetchedMyInfo = try context.fetch(fetchMyInfoRequest) as? [MyInfoEntity] + if fetchedMyInfo?.count ?? 0 > 0 { -// if fetchedMessage![0].toUser != nil { -// //fetchedMessage![0].toUser?.objectWillChange.send() -// } else { -// let fetchMyInfoRequest: NSFetchRequest = NSFetchRequest.init(entityName: "MyInfoEntity") -// fetchMyInfoRequest.predicate = NSPredicate(format: "myNodeNum == %lld", connectedNodeNum) -// do { -// let fetchedMyInfo = try context.fetch(fetchMyInfoRequest) as? [MyInfoEntity] -// if fetchedMyInfo?.count ?? 0 > 0 { -// -// for ch in fetchedMyInfo![0].channels!.array as? [ChannelEntity] ?? [] { -// -// if ch.index == packet.channel { -// // ch.objectWillChange.send() -// } -// } -// } -// } catch { -// -// } -// } + for ch in fetchedMyInfo![0].channels!.array as? [ChannelEntity] ?? [] { + + if ch.index == packet.channel { + ch.objectWillChange.send() + } + } + } + } catch { + + } + } } else { return diff --git a/Meshtastic/Protobufs/meshtastic/config.pb.swift b/Meshtastic/Protobufs/meshtastic/config.pb.swift index f327d250..eeee9214 100644 --- a/Meshtastic/Protobufs/meshtastic/config.pb.swift +++ b/Meshtastic/Protobufs/meshtastic/config.pb.swift @@ -375,8 +375,9 @@ struct Config { /// /// Bit field of boolean configuration options, indicating which optional - /// fields to include when assembling POSITION messages - /// Longitude and latitude are always included (also time if GPS-synced) + /// fields to include when assembling POSITION messages. + /// Longitude, latitude, altitude, speed, heading, and DOP + /// are always included (also time if GPS-synced) /// NOTE: the more fields are included, the larger the message will be - /// leading to longer airtime and a higher risk of packet loss enum PositionFlags: SwiftProtobuf.Enum { diff --git a/Meshtastic/Protobufs/meshtastic/mesh.pb.swift b/Meshtastic/Protobufs/meshtastic/mesh.pb.swift index 9467436f..c4d94c49 100644 --- a/Meshtastic/Protobufs/meshtastic/mesh.pb.swift +++ b/Meshtastic/Protobufs/meshtastic/mesh.pb.swift @@ -583,9 +583,8 @@ struct Position { /// /// This is usually not sent over the mesh (to save space), but it is sent - /// from the phone so that the local device can set its RTC If it is sent over - /// the mesh (because there are devices on the mesh without GPS), it will only - /// be sent by devices which has a hardware GPS clock. + /// from the phone so that the local device can set its time if it is sent over + /// the mesh (because there are devices on the mesh without GPS or RTC). /// seconds since 1970 var time: UInt32 { get {return _storage._time} diff --git a/Meshtastic/Protobufs/meshtastic/module_config.pb.swift b/Meshtastic/Protobufs/meshtastic/module_config.pb.swift index 5fae17a2..a1e60223 100644 --- a/Meshtastic/Protobufs/meshtastic/module_config.pb.swift +++ b/Meshtastic/Protobufs/meshtastic/module_config.pb.swift @@ -1020,6 +1020,7 @@ struct ModuleConfig { init() {} } + /// ///Ambient Lighting Module - Settings for control of onboard LEDs to allow users to adjust the brightness levels and respective color levels. ///Initially created for the RAK14001 RGB LED module. struct AmbientLightingConfig { @@ -1027,19 +1028,24 @@ struct ModuleConfig { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - ///Sets LED to on or off. + /// + /// Sets LED to on or off. var ledState: Bool = false - ///Sets the overall current for the LED, firmware side range for the RAK14001 is 1-31, but users should be given a range of 0-100% + /// + /// Sets the current for the LED output. Default is 10. var current: UInt32 = 0 - /// Red level + /// + /// Sets the red LED level. Values are 0-255. var red: UInt32 = 0 - ///Sets the green level of the LED, firmware side values are 0-255, but users should be given a range of 0-100% + /// + /// Sets the green LED level. Values are 0-255. var green: UInt32 = 0 - ///Sets the blue level of the LED, firmware side values are 0-255, but users should be given a range of 0-100% + /// + /// Sets the blue LED level. Values are 0-255. var blue: UInt32 = 0 var unknownFields = SwiftProtobuf.UnknownStorage() diff --git a/Meshtastic/Protobufs/meshtastic/telemetry.pb.swift b/Meshtastic/Protobufs/meshtastic/telemetry.pb.swift index 4294c83b..dc365499 100644 --- a/Meshtastic/Protobufs/meshtastic/telemetry.pb.swift +++ b/Meshtastic/Protobufs/meshtastic/telemetry.pb.swift @@ -284,11 +284,7 @@ struct Telemetry { // methods supported on all messages. /// - /// This is usually not sent over the mesh (to save space), but it is sent - /// from the phone so that the local device can set its RTC If it is sent over - /// the mesh (because there are devices on the mesh without GPS), it will only - /// be sent by devices which has a hardware GPS clock (IE Mobile Phone). - /// seconds since 1970 + /// Seconds since 1970 - or 0 for unknown/unset var time: UInt32 = 0 var variant: Telemetry.OneOf_Variant? = nil