mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
commit
8fdcb2a0d5
5 changed files with 37 additions and 35 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue