platform_hardware_interfaces/soundtrigger/2.1/ISoundTriggerHwCallback.hal
Mikhail Naganov 882d2377ec soundtrigger: Define v2.1 HAL
SoundTrigger 2.1 HAL is an extension to 2.0 fixing
the issue with of data blobs of arbitrary size that
can't outgrow HwBinder's IPC transaction size limit.
Instead of vectors, shared memory handles are used.

Added methods for getting and setting parameters.
The parameters are opaque to the framework, it does
not interpret them.

Bug: 68823037
Change-Id: I01c0c867e1d13023a22ccf408e84da78947d3bc2
Test: run hardware/interfaces/update-makefiles.sh
2018-01-17 09:31:57 -08:00

91 lines
3.2 KiB
Text

/*
* Copyright 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.hardware.soundtrigger@2.1;
import @2.0::ISoundTriggerHwCallback;
import @2.0::PhraseRecognitionExtra;
/**
* SoundTrigger HAL Callback interface. Obtained during SoundTrigger setup.
*/
@hidl_callback
interface ISoundTriggerHwCallback extends @2.0::ISoundTriggerHwCallback {
/**
* Generic recognition event sent via recognition callback.
*/
struct RecognitionEvent {
/** Event header. Any data contained in the 'header.data' field
* is ignored */
@2.0::ISoundTriggerHwCallback.RecognitionEvent header;
/** Opaque event data */
memory data;
};
/**
* Specialized recognition event for key phrase recognitions.
*/
struct PhraseRecognitionEvent {
/** Common part of the recognition event */
RecognitionEvent common;
/** List of descriptors for each recognized key phrase */
vec<PhraseRecognitionExtra> phraseExtras;
};
/**
* Event sent via load sound model callback.
*/
struct ModelEvent {
/** Event header. Any data contained in the 'header.data' field
* is ignored */
@2.0::ISoundTriggerHwCallback.ModelEvent header;
/** Opaque event data, passed transparently by the framework */
memory data;
};
/**
* Callback method called by the HAL when the sound recognition triggers.
*
* @param event A RecognitionEvent structure containing detailed results
* of the recognition triggered
* @param cookie The cookie passed by the framework when recognition was
* started (see ISoundtriggerHw.startRecognition*())
*/
recognitionCallback_2_1(RecognitionEvent event, CallbackCookie cookie);
/**
* Callback method called by the HAL when the sound recognition triggers
* for a key phrase sound model.
*
* @param event A RecognitionEvent structure containing detailed results
* of the recognition triggered
* @param cookie The cookie passed by the framework when recognition was
* started (see ISoundtriggerHw.startRecognition*())
*/
phraseRecognitionCallback_2_1(PhraseRecognitionEvent event,
CallbackCookie cookie);
/**
* Callback method called by the HAL when the sound model loading completes.
*
* @param event A ModelEvent structure containing detailed results of the
* model loading operation
* @param cookie The cookie passed by the framework when loading was
* initiated (see ISoundtriggerHw.loadSoundModel*())
*/
soundModelCallback_2_1(ModelEvent event, CallbackCookie cookie);
};