/*===========================================================================
FILE: 
   QmiAudio.h

DESCRIPTION:
   QMI Audio Service APIs. Service type 0xF1

Copyright (C) 2015 Sierra Wireless Incorporated. All rights reserved.
                   Sierra Wireless Proprietary/GTDR
==========================================================================*/

#ifndef __QMI_AUDIO_API_H__
#define __QMI_AUDIO_API_H__
/*=========================================================================*/
// Definitions
/*=========================================================================*/

/** 
* \defgroup GroupAudio Audio Service
*/
/*@{*/

/*=========================================================================*/
// Structs
/*=========================================================================*/
#ifdef __cplusplus
	extern "C" {
#endif

#ifdef __cplusplus
	};
#endif

/*=========================================================================*/
// Prototypes
/*=========================================================================*/

//////////////////////////////////////////////////////////////////////////////
///
/// The message requests to get the profile content of the requested generator. 
/// AUDIOI_CMD_VAL_GET_AUDIO_PROFILE_REQ 0x60
/// 
/// \param	pGenerator
///			[I]	Audio generator
///			\li 0 – Voice
///			\li 1 – Key Beep
///			\li 2 – MIDI
///
/// \param  pProfile
///			[O]	Audio profile
///			\li 0 – Handset
///			\li 1 – Headset
///			\li 2 – Car kit
///			\li 3 – Speaker phone
///			\li 4 – Auxiliary
///			\li 5 – TTY
///			\li 6 – Auxiliary external PCM
///			\li 7 – Primary external PCM
///			\li 8 – External slave PCM
///			\li 9 – I2S
///
/// \param  pEarMute
///			[O]	Ear mute setting
///			\li 0 – unmuted
///			\li 1 – muted
///
/// \param  pMicMute
///			[O]	MIC mute setting
///			\li 0 – unmuted
///			\li 1 – muted
///
/// \param  pVolume
///			[O]	Audio volume level (0-7)
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	AudioGetProfile( 
	// req params
	BYTE*		pGenerator,
	// resp params
	BYTE*       pProfile,  
	BYTE*       pEarMute,  
	BYTE*       pMicMute,  
	BYTE*		pVolume
	);

//////////////////////////////////////////////////////////////////////////////
///
/// The message requests to set set audio profile.
/// AUDIOI_CMD_VAL_SET_AUDIO_PROFILE 0x61
/// 
/// \param  pProfile
///			[I]	Audio profile
///			\li 0 – Handset
///			\li 1 – Headset
///			\li 2 – Car kit
///			\li 3 – Speaker phone
///			\li 4 – Auxiliary
///			\li 5 – TTY
///			\li 6 – Auxiliary external PCM
///			\li 7 – Primary external PCM
///			\li 8 – External slave PCM
///			\li 9 – I2S
///
/// \param  pEarMute
///			[I]	Ear mute setting
///			\li 0 – unmuted
///			\li 1 – muted
///
/// \param  pMicMute
///			[I]	MIC mute setting
///			\li 0 – unmuted
///			\li 1 – muted
///
/// \param	pGenerator
///			[I]	Audio generator
///			\li 0 – Voice
///			\li 1 – Key Beep
///			\li 2 – MIDI
///
/// \param  pVolume
///			[I]	Audio volume level (0-7)
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	AudioSetProfile( 
	// req params
	BYTE*  		pProfile,
	BYTE*  		pEarMute,
	BYTE*  		pMicMute,
	BYTE*  		pGenerator,
	BYTE*  		pVolume
	// resp params
	);

//////////////////////////////////////////////////////////////////////////////
///
/// The message requests to get the a setting of an audio path config item that is a Byte value. 
/// AUDIOI_CMD_VAL_GET_AUDIO_PATH_CONFIG_REQ 0x64
/// 
/// \param  pProfile
///			[I]	Audio profile
///			\li 0 – Handset
///			\li 1 – Headset
///			\li 2 – Car kit
///			\li 3 – Speaker phone
///			\li 4 – Auxiliary
///			\li 5 – TTY
///			\li 6 – Auxiliary external PCM
///			\li 7 – Primary external PCM
///			\li 8 – External slave PCM
///			\li 9 – I2S
///
/// \param	pItem
///			[I] Item to retrieve
///			\li 0x00 – AV_EC
///			\li 0x01 – AV_NS
///			\li 0x08 – AV_RXAGC
///			\li 0x09 – AV_TXAGC
///
/// \param  pValue
///			[O]	Value of the item retrieved
///			\li 0x00 – AV_EC - Echo Cancellation Mode
///					0 – Echo cancellation off
///					1 – Handset mode
///					2 – Headset mode
///					3 – Car kit mode
///					4 – Speaker mode
///			\li 0x01 – AV_NS 
///					0 – Noise suppression off
///					1 – Noise suppression on
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	AudioGetPathByte( 
	// req params
	BYTE*		pProfile,
	BYTE*		pItem,
	// resp params
	BYTE*		pValue
	);

//////////////////////////////////////////////////////////////////////////////
///
/// The message requests to get the a setting of an audio path config item that is a Word value. 
/// AUDIOI_CMD_VAL_GET_AUDIO_PATH_CONFIG_REQ 0x64
/// 
/// \param  pProfile
///			[I]	Audio profile
///			\li 0 – Handset
///			\li 1 – Headset
///			\li 2 – Car kit
///			\li 3 – Speaker phone
///			\li 4 – Auxiliary
///			\li 5 – TTY
///			\li 6 – Auxiliary external PCM
///			\li 7 – Primary external PCM
///			\li 8 – External slave PCM
///			\li 9 – I2S
///
/// \param	pItem
///			[I] Item to retrieve
///			\li 0x02 - AV_TXVOL
///			\li 0x04 - AV_CODECSTG
///
/// \param  pValue
///			[O]	Value of the item retrieved
///			\li 0x02 - AV_TXVOL (0x0000 – 0xffff)
///			\li 0x04 - AV_CODECSTG (0x0000 – 0xffff)
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	AudioGetPathWord( 
	// req params
	BYTE*		pProfile,
	BYTE*		pItem,
	// resp params
	WORD*		pValue
	);

//////////////////////////////////////////////////////////////////////////////
///
/// The message requests to get the a setting of an audio path config item that is a PCM filter. 
/// AUDIOI_CMD_VAL_GET_AUDIO_PATH_CONFIG_REQ 0x64
/// 
/// \param  pProfile
///			[I]	Audio profile
///			\li 0 – Handset
///			\li 1 – Headset
///			\li 2 – Car kit
///			\li 3 – Speaker phone
///			\li 4 – Auxiliary
///			\li 5 – TTY
///			\li 6 – Auxiliary external PCM
///			\li 7 – Primary external PCM
///			\li 8 – External slave PCM
///			\li 9 – I2S
///
/// \param	pItem
///			[I] Item to retrieve
///			\li 0x05 - AV_TXPCMIIRFLTR
///			\li 0x06 - AV_RXPCMIIRFLTR
///
/// \param  pPCMFilterFlag
///			[O]	IRR filter flag
///			\li 0x0000 – IIR filter disable
///			\li 0xffff – IIR filter enable
///
/// \param  pPCMFilterStageCount
///			[O]	Number of IRR filter stage (0-4)
///
/// \param  pPCMFilterStageValue
///			[O]	Values of the stages (up to 4 stages)
///
/// \param  pPCMFilterStageSize
///			[I]	Size of pPCMFilterStageValue, must be 25
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	AudioGetPathPCMFilter( 
	// req params
	BYTE*		pProfile,
	BYTE*		pItem,
	// resp params
	WORD*		pPCMFilterFlag,
	WORD*		pPCMFilterStageCount,
	DWORD*		pPCMFilterStageValue,
	WORD*		pPCMFilterStageSize
	);
	
//////////////////////////////////////////////////////////////////////////////
///
/// The message requests to set the audio path configuration parameters
/// AUDIOI_CMD_VAL_SET_AUDIO_PATH_CONFIG_REQ 0x65
/// 
/// \param  pProfile
///			[I]	Audio profile
///			\li 0 – Handset
///			\li 1 – Headset
///			\li 2 – Car kit
///			\li 3 – Speaker phone
///			\li 4 – Auxiliary
///			\li 5 – TTY
///			\li 6 – Auxiliary external PCM
///			\li 7 – Primary external PCM
///			\li 8 – External slave PCM
///			\li 9 – I2S
///
/// \param	pEchoCancel
///			[I] AV_EC - Echo Cancellation Mode
///			\li 0 – Echo cancellation off
///			\li 1 – Handset mode
///			\li 2 – Headset mode
///			\li 3 – Car kit mode
///			\li 4 – Speaker mode
///
/// \param  pNoiseSuppression
///			[I]	AV_NS Noise Suppression
///			\li 0 – Noise suppression off
///			\li 1 – Noise suppression on
///
/// \param  pTXVol
///			[I]	TX Voice Volume (0x0000 – 0xffff)
///
/// \param  pSTGain
///			[I]	CODEC ST gain (Sidetone Gain) (0x0000 – 0xffff)
///
/// \param  pTXPCMFilterFlag
///			[I]	TX IRR filter flag
///				\li 0x0000 – IIR filter disable
///				\li 0xffff – IIR filter enable
///
/// \param  pTXPCMFilterStageCount
///			[I]	Number of TX IRR filter stage (0-4)
///
/// \param  pTXPCMFilterStageValue
///			[I]	Values of the stages (up to 4 stages)
///
/// \param  pTXPCMFilterStageSize
///			[I]	Size of pTXPCMFilterStageValue, must be 25
///
/// \param  pRXPCMFilterFlag
///			[I]	RX IRR filter flag
///				\li 0x0000 – IIR filter disable
///				\li 0xffff – IIR filter enable
///
/// \param  pRXPCMFilterStageCount
///			[I]	Number of RX IRR filter stage (0-4)
///
/// \param  pRXPCMFilterStageValue
///			[I]	Values of the stages (up to 4 stages)
///
/// \param  pRXPCMFilterStageSize
///			[I]	Size of pRXPCMFilterStageValue, must be 25
///
/// \param  pRXAvcAgcSwitch
///			[I]	RX AVC/AGC switch
///
/// \param  pTXAvcAgcSwitch
///			[I]	TX AVC/AGC switch
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	AudioSetAudioPath( 
	// req params
	BYTE*		pProfile,
	BYTE*		pEchoCancel,
	BYTE*		pNoiseSuppression,
	WORD*		pTXVol,
	WORD*		pSTGain,
	WORD*		pTXPCMFilterFlag,
	WORD*		pTXPCMFilterStageCount,
	DWORD*		pTXPCMFilterStageValue,
	WORD*		pTXPCMFilterStageSize,
	WORD*		pRXPCMFilterFlag,
	WORD*		pRXPCMFilterStageCount,
	DWORD*		pRXPCMFilterStageValue,
	WORD*		pRXPCMFilterStageSize,
	BYTE*		pRXAvcAgcSwitch,
	BYTE*		pTXAvcAgcSwitch
	// resp params
	);
	
//////////////////////////////////////////////////////////////////////////////
///
/// The message requests to get the volume value of a volume level of a requested item.
/// AUDIOI_CMD_VAL_GET_AUDIO_VOl_TLB_CONFIG_REQ 0x66
/// 
/// \param  pProfile
///			[I]	Audio profile
///			\li 0 – Handset
///			\li 1 – Headset
///			\li 2 – Car kit
///			\li 3 – Speaker phone
///			\li 4 – Auxiliary
///			\li 5 – TTY
///			\li 6 – Auxiliary external PCM
///			\li 7 – Primary external PCM
///			\li 8 – External slave PCM
///			\li 9 – I2S
///
/// \param	pGenerator
///			[I]	Audio generator
///			\li 0 – Voice
///			\li 1 – Key Beep
///			\li 2 – MIDI
///
/// \param  pVolume
///			[I]	Audio volume level (0-7)
///
/// \param  pItem
///			[I] The item to be retrieved
///			\li 13 - AV_RXVOLDB
///			\li 14 - AV_DTMFVOLDB
///			\li 15 - AV_PAD
///
/// \param  pValue
///			[O]	Value of the item retrieved
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	AudioGetVolTLBConfig( 
	// req params
	BYTE*		pProfile,
	BYTE*  		pGenerator,
	BYTE*  		pVolume,
	BYTE*  		pItem,
	// resp params
	WORD*       pValue
	);

//////////////////////////////////////////////////////////////////////////////
///
/// The message requests to get the volume value of a volume level of a requested item.
/// AUDIOI_CMD_VAL_SET_AUDIO_VOl_TLB_CONFIG_REQ 0x67
/// 
/// \param  pProfile
///			[I]	Audio profile
///			\li 0 – Handset
///			\li 1 – Headset
///			\li 2 – Car kit
///			\li 3 – Speaker phone
///			\li 4 – Auxiliary
///			\li 5 – TTY
///			\li 6 – Auxiliary external PCM
///			\li 7 – Primary external PCM
///			\li 8 – External slave PCM
///			\li 9 – I2S
///
/// \param	pGenerator
///			[I]	Audio generator
///			\li 0 – Voice
///			\li 1 – Key Beep
///			\li 2 – MIDI
///
/// \param  pVolume
///			[I]	Audio volume level (0-7)
///
/// \param  pItem
///			[I] The item to be retrieved
///			\li 13 - AV_RXVOLDB
///			\li 14 - AV_DTMFVOLDB
///			\li 15 - AV_PAD
///
/// \param  pInValue
///			[I]	Value of the item
///
/// \param  pOutValue
///			[O]	Result of the item
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	AudioSetVolTLBConfig( 
	// req params
	BYTE*		pProfile,
	BYTE*  		pGenerator,
	BYTE*  		pVolume,
	BYTE*  		pItem,
	WORD*       pInValue,
	// resp params
	WORD*       pOutValue
	);
	
//////////////////////////////////////////////////////////////////////////////
///
/// This message requests device to play a audio tone.
/// AUDIOI_CMD_VAL_PALY_AUDIO_TONE 0xF1
/// 
/// \param	pGenerator
///			[I]	Audio generator
///			\li 0 – Voice
///			\li 1 – Key Beep
///			\li 2 – MIDI
///
/// \param  pTone
///			[I]	Tone value (0x00 – 0x57)
///
/// \param  pDuration
///			[I] Duration of the tone
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	AudioPlayAudioTone( 
	// req params
	BYTE*  		pGenerator,
	BYTE*  		pTone,
	WORD*		pDuration //Optional
	// resp params
	);

/*@}*/ // End of Audio group
#endif