////////////////////////////////////////////////////////////////////////////////////
// Filename: oemaux.h
// Description: CDMA RIL Auxiliary (AUX) Interface header file.
// 08/01/03 - Initial version. (Giang Do-Tien)
// 10/24/03 - Clean-up and add PM support. (Gemini)
// 10/27/03 - Add CDMAPhoneComeIn, GetVersion and device PM related API
// 12/11/03 - Add AudioMutingSet, IsAudioMuted, enhance SetTetheredMode
// 04/02/04 - Remove:
//                    Muting API because muting functionality can be driven from other software query method,
//                    Create a duplicate API "EnableAudio" to replace "CDMAPhoneComeIn"
//                    UARTGetClock
//                    ActiveSyncCablePluggedIn
//                    IsTetheredMode
// 04/11/06 - Clean up for USB Model and audio control enhancement.
// 01/24/09 - Clean up for MC modem.
//WINSW00009583     mshah       02/24/09        Modify the function definitions for GetVolumnLevel and SetVolumnLevel in OEMAux.h      
//WINSW00011336     mshah       09/01/11        RILGOBI: Implement support for new Sprint requirements of ##CLEAR and ##RTN
////////////////////////////////////////////////////////////////////////////////////
#ifndef __OEMAUX_H_
#define __OEMAUX_H_

#ifdef __cplusplus
extern "C" {
#endif

#ifndef OEMAUXAPI
// This exports functions from AUX DLL.
#define	OEMAUXAPI	__declspec(dllexport) 
#endif

// AUX version info structure.
typedef struct tagAUX_VERSION_INFO
{
    DWORD dwVersion;	   	// HIWORD = major ver, LOWORD = minor ver.
} AUX_VERSION_INFO;

typedef AUX_VERSION_INFO * LPAUX_VERSION_INFO;

typedef enum {
  nON_OFF,          // Power ON/OFF modem.
} OutputSignal;

typedef enum {
   POWER_ON_BUTTON  = 0x00000040, // To query the actual (hardware) power state of the modem. Is the "power line" supplied to the modem or not?
} InputSignal;

typedef enum {
   HIGH, // A Change from LOW to HIGH state.
   LOW   // A change from HIGH to LOW state.
} SignalState;

typedef enum {
   OK_STATUS,       // No errors.
   TIMEOUT,         // Timeout.
   INVALID_PRM_ERR  // Error in parameter(s).
} RetStatus;

typedef enum {
  HANDSET_PATH,
  HEADSET_PATH,     // headset is plugged in, otherwise headset is not plugged in.
  BLUETOOTH_PATH,
  SPEAKER_PATH,
  TTY_PATH,
  HAC_PATH          // Hearing Aid Compatibility
} eAudioPath;

//
// The following functions must be supplied by the OEM.
//

// SetMIO
typedef RetStatus (*LPFNSetMIO) (OutputSignal , SignalState);
RetStatus OEMAUXAPI SetMIO(OutputSignal eSignal, SignalState eState);
#define SETMIO					TEXT("SetMIO")

// GetMIO
typedef RetStatus (*LPFNGetMIO) (InputSignal , SignalState *);
RetStatus OEMAUXAPI GetMIO(InputSignal eSignal, SignalState * eState);
#define GETMIO					TEXT("GetMIO")

// GetAudioPath
typedef RetStatus (*LPFNGetAudioPath) (eAudioPath * pAudioPath);
RetStatus OEMAUXAPI GetAudioPath(eAudioPath * pAudioPath);
#define GETAUDIOPATH		TEXT("GetAudioPath")

// GetVolumnLevel
typedef RetStatus  (*LPFNGetVolumnLevel)(DWORD *dwTXAudioLevel, DWORD *dwRXAudioLevel);
RetStatus OEMAUXAPI GetVolumnLevel (DWORD *dwTXAudioLevel, DWORD *dwRXAudioLevel);
#define GETVOLUMNLEVEL	TEXT("GetVolumnLevel")

// SetVolumnLevel
typedef RetStatus  (*LPFNSetVolumnLevel)(DWORD dwTXAudioLevel, DWORD dwRXAudioLevel);
RetStatus OEMAUXAPI SetVolumnLevel (DWORD dwTXAudioLevel, DWORD dwRXAudioLevel);
#define SETVOLUMNLEVEL	TEXT("SetVolumnLevel")

//InitiateHostBoot
typedef RetStatus  (*LPFNInitiateHostBoot)(DWORD dwBootType);
RetStatus OEMAUXAPI InitiateHostBoot (DWORD dwBootType);
#define INITIATEHOSTBOOT  TEXT("InitiateHostBoot")


// SetTetheredMode. If pDeviceHandle is not NULL, OEMAux should open the device
// and return the opened handle back to the caller, if open failed then not only
// *pDeviceHandle is NULL but RetStatus will be TIMEOUT. If open succeeds then
// OEMAUX caller is responsible to Read/Write/Close of this handle. It's decided that
// OEMAUX caller will un/block auto-suspend mode when calling SetTetheredMode.
typedef RetStatus (*LPFNSetTetheredMode) (BOOL  isEnable, void *pDeviceHandle);
RetStatus OEMAUXAPI SetTetheredMode(BOOL isEnable,  void *pDeviceHandle);
#define SETTETHEREDMODE	TEXT("SetTetheredMode")

// EnableAudio is the same as CDMAPhoneComeIn with a better name moving forward
// if RIL cannot find this function name then it will find CDMAPhoneComeIn as fallback plan
typedef void (*LPFNEnableAudio) ( BOOL bEnable );
void OEMAUXAPI EnableAudio (BOOL bEnable);
#define ENABLEAUDIO	    TEXT("EnableAudio")

typedef BOOL (*LPFNAUX_GetVersion) (LPAUX_VERSION_INFO lpAUXVersionInfo);
BOOL OEMAUXAPI AUX_GetVersion(LPAUX_VERSION_INFO lpAUXVersionInfo);
#define AUXGETVERSION	  TEXT("AUX_GetVersion")

typedef RetStatus (*LPFNAUX_Init) (void);
RetStatus OEMAUXAPI AUX_Init(void);
#define AUXINIT	  TEXT("AUX_Init")

typedef RetStatus (*LPFNAUX_Deinit) (void);
RetStatus OEMAUXAPI AUX_Deinit(void);
#define AUXDEINIT	  TEXT("AUX_Deinit")


#ifdef __cplusplus
}
#endif
#endif // end of __OEMAUX_H_


