From e6d6efe495561b596d45814c711fc78b7ad0cd22 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Sat, 25 Mar 2023 22:14:39 -0700 Subject: [PATCH] Additional RTTTL config --- Meshtastic/Helpers/BLEManager.swift | 6 +++--- Meshtastic/Helpers/MeshPackets.swift | 3 +++ Meshtastic/Persistence/UpdateCoreData.swift | 6 +++--- Meshtastic/Views/Settings/Config/Module/RtttlConfig.swift | 6 ++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Meshtastic/Helpers/BLEManager.swift b/Meshtastic/Helpers/BLEManager.swift index 5347d8b0..40d69a25 100644 --- a/Meshtastic/Helpers/BLEManager.swift +++ b/Meshtastic/Helpers/BLEManager.swift @@ -1344,10 +1344,10 @@ class BLEManager: NSObject, CBPeripheralDelegate, ObservableObject { return 0 } - public func saveRtttlConfig(config: RTTTLConfig, fromUser: UserEntity, toUser: UserEntity, adminIndex: Int32) -> Int64 { + public func saveRtttlConfig(ringtone: String, fromUser: UserEntity, toUser: UserEntity, adminIndex: Int32) -> Int64 { var adminPacket = AdminMessage() - adminPacket.setRingtoneMessage = config.ringtone + adminPacket.setRingtoneMessage = ringtone var meshPacket: MeshPacket = MeshPacket() meshPacket.id = UInt32.random(in: UInt32(UInt8.max).. 0 { // Should show a saved successfully alert once I know that to be true // for now just disable the button after a successful save @@ -123,7 +121,7 @@ struct RtttlConfig: View { setRtttLConfigValue() // Need to request a Rtttl Config from the remote node before allowing changes - if bleManager.connectedPeripheral != nil && node?.rangeTestConfig == nil { + if bleManager.connectedPeripheral != nil && node?.rtttlConfig == nil { let connectedNode = getNodeInfo(id: bleManager.connectedPeripheral.num, context: context) if node != nil && connectedNode != nil { _ = bleManager.requestRtttlConfig(fromUser: connectedNode!.user!, toUser: node!.user!, adminIndex: connectedNode?.myInfo?.adminIndex ?? 0)