Merge pull request #397 from meshtastic/main

Merge from main
This commit is contained in:
Garth Vander Houwen 2023-09-14 10:56:29 -07:00 committed by GitHub
commit 8fdcb2a0d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 35 deletions

View file

@ -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<NSFetchRequestResult> = 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<NSFetchRequestResult> = 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

View file

@ -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 {

View file

@ -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}

View file

@ -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()

View file

@ -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