diff --git a/Source/Managers/BasicManager.swift b/Source/Managers/BasicManager.swift index 21a4bf8..c5cab09 100644 --- a/Source/Managers/BasicManager.swift +++ b/Source/Managers/BasicManager.swift @@ -35,7 +35,7 @@ public class BasicManager: McuManager { /// /// - parameter callback: The response callback with a ``McuMgrResponse``. public func eraseAppSettings(callback: @escaping McuMgrCallback) { - send(op: .write, commandId: ID.Reset, payload: [:], timeout: 1, callback: callback) + send(op: .write, commandId: ID.Reset, payload: [:], timeout: McuManager.FAST_TIMEOUT, callback: callback) } } diff --git a/Source/Managers/DefaultManager.swift b/Source/Managers/DefaultManager.swift index 9b004d8..b96acf8 100644 --- a/Source/Managers/DefaultManager.swift +++ b/Source/Managers/DefaultManager.swift @@ -111,7 +111,7 @@ public class DefaultManager: McuManager { /// /// - parameter callback: The response callback. public func params(callback: @escaping McuMgrCallback) { - send(op: .read, commandId: ID.McuMgrParameters, payload: nil, timeout: 1, callback: callback) + send(op: .read, commandId: ID.McuMgrParameters, payload: nil, timeout: McuManager.FAST_TIMEOUT, callback: callback) } } diff --git a/Source/Managers/ImageManager.swift b/Source/Managers/ImageManager.swift index 6cac3ee..08e362d 100644 --- a/Source/Managers/ImageManager.swift +++ b/Source/Managers/ImageManager.swift @@ -77,7 +77,7 @@ public class ImageManager: McuManager { // Hence, the longer timeout. uploadTimeoutInSeconds = McuManager.DEFAULT_SEND_TIMEOUT_SECONDS } else { - uploadTimeoutInSeconds = 1 + uploadTimeoutInSeconds = McuManager.FAST_TIMEOUT } send(op: .write, commandId: ImageID.Upload, payload: payload, timeout: uploadTimeoutInSeconds, callback: callback) diff --git a/Source/McuManager.swift b/Source/McuManager.swift index e5a9ae0..acc812f 100644 --- a/Source/McuManager.swift +++ b/Source/McuManager.swift @@ -33,6 +33,9 @@ open class McuManager { /// allowed to elapse before a send request is considered to have failed /// due to a timeout if no response is received. public static let DEFAULT_SEND_TIMEOUT_SECONDS = 40 + /// This is the default time to wait for a command to be sent, executed + /// and received (responded to) by the firmware on the other end. + public static let FAST_TIMEOUT = 2 //************************************************************************** // MARK: Properties