/*===========================================================================
FILE: 
   SwiM2MAVAPI.h

DESCRIPTION:
   Sierra Wireless M2M AV Service APIs, Service Type 0xF5

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

#ifndef __SWI_M2MAV_API_H__
#define __SWI_M2MAV_API_H__
/*=========================================================================*/
// Definitions
/*=========================================================================*/

/** 
* \defgroup GroupSwiM2MAV Sierra Wireless M2MAV Service
*/
/*@{*/

/*=========================================================================*/
// Structs
/*=========================================================================*/

/*=========================================================================*/
// Definitions
/*=========================================================================*/
#ifdef GOBIAPI_EXPORTS
#define IMPORTGOBI extern "C" __declspec( dllexport )
#else  //GOBIAPI_EXPORTS
#ifdef __cplusplus
/* C++ callable DLL */
#define IMPORTGOBI extern "C" __declspec( dllimport )
#else
/* C callable DLL */
#define IMPORTGOBI __declspec( dllimport )
#endif
#endif //GOBIAPI_EXPORTS

// Calling convention for API
#define GOBICALLBACK __stdcall
#define GOBICMAPI __stdcall

#ifdef __cplusplus
extern "C" {
#endif


#define MAX_PIFACE_TABLE_SIZE		9

typedef struct
{
    BYTE		PIFACEParamLen;
	BYTE		PIFACEParam[MAX_PIFACE_TABLE_SIZE];
} PIFACETable;

typedef struct
{
    BYTE  			AudioProfile;
    BYTE  			ACDBDevice;
    BYTE  			PIFACEID;
    PIFACETable 	PIFACETbl;
} AudioConfig;

typedef struct
{
    LONG		B0;
    LONG		B1;
    LONG		B2;
    LONG		A1;
    LONG		A2;
} PCMIIRFilter;

typedef struct
{
    BYTE	Profile;
	BYTE	Switch;
	BYTE	Stage;
} PCMIIRSetConfig;

typedef struct
{
    BYTE			Profile;
	BYTE			Stage;
	PCMIIRFilter	Coeff;
} PCMIIRSetCoeff;
#ifdef __cplusplus
};
#endif

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

//////////////////////////////////////////////////////////////////////////////
///
/// The message requests to get the profile content. It is similar with 
/// at!avsetprofile?[<generator>]
/// QMI_SWI_M2M_AUDIO_GET_PROFILE 0x01
///
/// \param	pGenerator    [ I ] - Generator
/// \li     0:Voice
/// \param  pProfile      [ I ] Audio Profile
///
/// \param  pEarMute      [ O ] Ear mute
/// \li 0:Mute
/// \li 1:Unmute
///
/// \param  pMicMute      [ O ] Mic Mute
/// \li 0:Mute
/// \li 1:Unmute
///
/// \param  pOutGenerator [ O ] Generator
/// \li 0:Voice
///
/// \param  pVolume       [ O ] RX volume level
/// \li 0-5
///
/// \param  pCwtMute      [ O ] Call waiting tone mute
/// \li 0:Mute
/// \li 1:Unmute
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetProfile(
    // req params
    BYTE*		pGenerator,
    // resp params
    BYTE*       pProfile,
    BYTE*       pEarMute,
    BYTE*       pMicMute,
    BYTE*       pOutGenerator,
    BYTE*		pVolume,
    BYTE*       pCwtMute
);

//////////////////////////////////////////////////////////////////////////////
///
/// The message requests to set the profile content. It is similar 
/// with at!avsetprofile=<profile>[,<earmute>,<micmute>,<generator>,
/// <volume>[,<cwtmute>]]. This command is used to select a profile 
/// with which to establish a circuit-switched call. It will also 
/// change ACDB device and PIFACE which bind to this profile. The 
/// profile selection is persistent.
/// QMI_SWI_M2M_AUDIO_SET_PROFILE 0x02
///
/// \param	pProfile   [ I ] - Audio profile number
/// \li 0-5
/// \param	pEarMute   [ I ] - Ear mute
/// \li 0:Mute
/// \li 1:Unmute
/// \param	pMicMute   [ I ] - Mic mute
/// \li 0:Mute
/// \li 1:Unmute
/// \param	pGenerator [ I ] - Generator
/// \li 0:Voice
/// \param	pVolume    [ I ] - RX volume level
/// \li 0-5
/// \param	pCwtMute   [ I ] - Call waiting tone mute
/// \li 0:Mute
/// \li 1:Unmute
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetProfile(
    // req params
    BYTE*  		pProfile,
    BYTE*  		pEarMute,
    BYTE*  		pMicMute,
    BYTE*  		pGenerator,
    BYTE*  		pVolume,
    BYTE*       pCwtMute
    // resp params
);

//////////////////////////////////////////////////////////////////////////////
///
/// The message requests to get the RX volume level. It is similar with 
/// at!avsetvol?<profile>,<generator>
/// QMI_SWI_M2M_AUDIO_GET_VOLUME 0x03
///
/// \param	pProfile   [ I ] - Audio profile
/// \li 0-5
/// \param	pGenerator [ I ] - Generator
/// \li 0:Voice
/// \param	pVolume    [ O ] - RX volume level
/// \li 0-5
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetVolume(
    // req params
    BYTE*		pProfile,
    BYTE*  		pGenerator,
    // resp params
    BYTE*  		pVolume
);

//////////////////////////////////////////////////////////////////////////////
///
/// The message requests to set the RX volume level. It is similar with 
/// at!avsetvol=<profile>,<generator>,<level>. This command selects the 
/// RX volume level to be used with the selected audio profile. This setting 
/// is stored in non-volatile memory and persists across power cycles. 
/// QMI_SWI_M2M_AUDIO_SET_VOLUME 0x04
///
/// \param	pProfile   [ I ] - Audio profile
/// \li 0-5
/// \param	pGenerator [ I ] - Generator
/// \li 0:Voice
/// \param	pVolume    [ I ] - RX volume level
/// \li 0-5
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetVolume(
    // req params
    BYTE*		pProfile,
    BYTE*  		pGenerator,
    BYTE*  		pVolume
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetAVMute(
    // req params
    BYTE*  		pProfile,
    BYTE*  		pEarMute,
    BYTE*  		pMicMute,
    BYTE*  		pcwtMute//waiting tone mute
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetAVMute(
    // req params
    BYTE*  		pProfile,
    BYTE*  		pEarMute,
    BYTE*  		pMicMute,
    BYTE*  		pcwtMute//waiting tone mute
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetAVCFG(
    // req params
    BYTE*  		 pAudioProfile,
    BYTE*  		 pABCDDevice,
    BYTE*  		 pPIFACEID,
    PIFACETable* pPIFACETable
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetAVCFG(
    // req params
    // resp params
	AudioConfig*	pAudioConfig,
	BYTE*			pSize
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioNVDef(
    // req params
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetLPBK(
    // req params
    BYTE*	pEnable
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetSpeakerGain(
    // req params
    BYTE*		pProfile,
    // resp params
    USHORT*  	pSpkrGain
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetSpeakerGain(
    // req params
    BYTE*  		pProfile,
    USHORT*  	pSpkrGain
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetSTG(
    // req params
    BYTE*		pProfile,
    // resp params
    WORD*  		pGainValue
);


IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetSTG(
    // req params
    BYTE*		pProfile,
    WORD*  		pGainValue
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetTxVolume(
    // req params
    BYTE*		pProfile,
    // resp params
    WORD*  		pTxVolume
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetTxVolume(
    // req params
    BYTE*		pProfile,
    WORD*  		pTxVolume
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetMicGain(
    // req params
    BYTE*		pProfile,
    // resp params
    WORD*  		pMicGain
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetMicGain(
    // req params
    BYTE*		pProfile,
    WORD*  		pMicGain
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetVolDB(
    // req params
    BYTE*		pProfile,
    BYTE*  		pGenerator,
    BYTE*  		pLevel,
    // resp params
	WORD*		pValue
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetVolDB(
    // req params
    BYTE*		pProfile,
    BYTE*  		pGenerator,
    BYTE*  		pLevel,
    WORD*		pValue
	// resp params
);

/*IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetTXPCMIIR(
    // req params
    BYTE*  			pProfile,
	BYTE*			pOpMode,
	// resp params
	BYTE*           pSwitch,
    BYTE*           pStage,
    PCMIIRFilter*   pFilterCoeff
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetTXPCMIIR(
    // req params
    PCMIIRSetConfig*  	pConfig,
	PCMIIRSetCoeff*		pCoeff
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetRXPCMIIR(
    // req params
    BYTE*  			pProfile,
	BYTE*			pOpMode,
	// resp params
	BYTE*           pSwitch,
    BYTE*           pStage,
    PCMIIRFilter*   pFilterCoeff
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetRXPCMIIR(
    // req params
    PCMIIRSetConfig*  	pConfig,
	PCMIIRSetCoeff*		pCoeff
	// resp params
);*/

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetAVTXG(
    // req params
    BYTE*		pProfile,
    // resp params
    WORD*  		pEncoderGain
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetAVTXG(
    // req params
    BYTE*		pProfile,
    WORD*  		pEncoderGain
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetAVRXG(
    // req params
    BYTE*		pProfile,
    // resp params
    WORD*  		pDecoderGain
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetAVRXG(
    // req params
    BYTE*		pProfile,
    WORD*  		pDecoderGain
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetAVEC(
    // req params
    BYTE*		pProfile,
    // resp params
    BYTE*  		pSwitch
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetAVEC(
    // req params
    BYTE*		pProfile,
    BYTE*  		pSwitch
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetAVNS(
    // req params
    BYTE*		pProfile,
    // resp params
    BYTE*  		pSwitch
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetAVNS(
    // req params
    BYTE*		pProfile,
    BYTE*  		pSwitch
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioPlayTone(
	// req params
	BYTE*		pGenerator,
	BYTE*		pAudioTone,
	USHORT*		pToneDuration //optional
	// resp params
);
/*@}*/ // End of SwiM2MAV group
#endif //SwiM2MAVAPI_H