MimiTestController
public protocol MimiTestController : MimiCoreController
Controller which provides access to Test management.
MimiTestController
can be used to submit, view and manage Hearing Tests
related to the currently authenticated user.
-
MimiTestControllerObservable
Declaration
Swift
var observable: MimiCoreObservable<MimiTestControllerObservable> { get }
-
Latest test results that have been loaded.
Once this is loaded, it will be automatically updated whenever the test data changes.
Warning
This is cached and potentially out of date. To ensure you have the latest data useloadLatestResults()
Declaration
Swift
var latestResults: MimiTestResults? { get }
-
A weakly referenced
MimiConnectedHeadphoneProvider
object.Declaration
Swift
var connectedHeadphoneProvider: MimiConnectedHeadphoneProvider? { get set }
-
Loads the test type configuration.
Declaration
Swift
func loadTestTypeConfiguration(headphoneIdentifier: MimiHeadphoneIdentifier?, result: MimiCoreResultHandler<MimiTestTypeConfiguration>)
Parameters
headphoneIdentifier
Identifier of the currently connected headphone if available.
result
Result handler.
-
Submit a new test.
Test results are provided in the result handler.
Declaration
Swift
func submit(test: MimiTest, result: MimiCoreResultHandler<MimiTestResults>)
Parameters
test
New test to submit.
result
Result handler.
-
Submit a new Hearing Test Audiogram.
The submitted audiogram must include data points for 250Hz, 500Hz, 1000Hz, 2000Hz, 4000Hz and 8000Hz.
Additional frequencies outside that range may be included, however they will not be available in the updated
MimiTestResults
.Threshold values should be within the range of -10 to 120 dB HL.
Declaration
Swift
func submitAudiogram(leftEar: MimiTestAudiogram, rightEar: MimiTestAudiogram, metadata: MimiTestAudiogramMetadata, result: MimiCoreResultHandler<MimiSubmitAudiogramResponse>)
Parameters
leftEar
Audiogram data for the left ear.
rightEar
Audiogram data for the right ear.
metadata
Metadata for the audiogram.
result
Result handler.
-
Load headphones.
Declaration
Swift
func loadHeadphones(connectionType: MimiHeadphone.ConnectionType, result: MimiCoreResultHandler<[MimiHeadphone]>)
Parameters
connectionType
Connection type of the headphone.
result
Result of load.
-
Delete a test which is associated with a test result.
Declaration
Swift
func delete(testResult: AnyMimiTestResult, result: MimiCoreResultHandler<Void>)
Parameters
testResult
Test result whose associated test is to be deleted.
result
Result of deletion.
-
Load test results.
The type of the tests loaded is decided by the
type
parameter.Declaration
Swift
func loadResults<RunResultData: MimiTestRunResultData>(type: RunResultData.Type, result: MimiCorePagedResultHandler<[MimiTestResult<RunResultData>]>)
Parameters
type
Run result data type.
result
Paged result handler with a limit of 20 test results per page.
-
Load test results (Swift Concurrency API)
The type of the tests loaded is decided by the
type
parameter.Declaration
Swift
func loadResults<RunResultData>(type: RunResultData.Type) async throws -> MimiCoreAsyncPagedResult<[MimiTestResult<RunResultData>]> where RunResultData : MimiTestRunResultData
Parameters
type
Run result data type.
Return Value
Async paged result function with a limit of 20 test results per page.
-
Load the latest test results.
Declaration
Swift
func loadLatestResults(result: MimiCoreResultHandler<MimiTestResults>)
Parameters
result
Result.