2024-06-07 22:09:20 -05:00
|
|
|
import CoreData
|
|
|
|
|
import MeshtasticProtobufs
|
|
|
|
|
|
|
|
|
|
extension StoreForwardConfigEntity {
|
|
|
|
|
convenience init(
|
|
|
|
|
context: NSManagedObjectContext,
|
|
|
|
|
config: ModuleConfig.StoreForwardConfig
|
|
|
|
|
) {
|
|
|
|
|
self.init(context: context)
|
|
|
|
|
self.enabled = config.enabled
|
|
|
|
|
self.heartbeat = config.heartbeat
|
|
|
|
|
self.records = Int32(config.records)
|
|
|
|
|
self.historyReturnMax = Int32(config.historyReturnMax)
|
|
|
|
|
self.historyReturnWindow = Int32(config.historyReturnWindow)
|
|
|
|
|
}
|
2024-06-28 19:41:17 -07:00
|
|
|
|
2024-06-07 22:09:20 -05:00
|
|
|
func update(with config: ModuleConfig.StoreForwardConfig) {
|
|
|
|
|
enabled = config.enabled
|
|
|
|
|
heartbeat = config.heartbeat
|
|
|
|
|
records = Int32(config.records)
|
|
|
|
|
historyReturnMax = Int32(config.historyReturnMax)
|
|
|
|
|
historyReturnWindow = Int32(config.historyReturnWindow)
|
|
|
|
|
}
|
|
|
|
|
}
|