/*===========================================================================
FILE: 
   QmiOMAAPI.h

DESCRIPTION:
   QMI Open Mobile Alliance Service APIs. Service type 0xE2

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

#ifndef __QMI_OMA_API_H__
#define __QMI_OMA_API_H__
/*=========================================================================*/
// Definitions
/*=========================================================================*/

/** 
* \defgroup GroupOMA Open Mobile Alliance Service
*/
/*@{*/

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

#ifdef __cplusplus
	};
#endif

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


//////////////////////////////////////////////////////////////////////////////
///
/// This function enables/disables the OMA-DM state callback function
/// QMI_OMA_SET_EVENT_REPORT_MSG 0x0001
/// QMI_OMA_SET_EVENT_REPORT_IND 0x0001
///
/// \param	pCallback   [ I ] - Callback function (0 = disable)
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI SetOMADMStateCallback( tFNOMADMState pCallback );

//////////////////////////////////////////////////////////////////////////////
///
/// This function enables/disables the OMA-DM network initiated alert
/// callback function
/// QMI_OMA_SET_EVENT_REPORT_MSG     0x0001
/// QMI_OMA_SET_EVENT_REPORT_IND_MSG 0x0001  
///
/// \param  pCallback   [ I ] - Callback function (0 = disable)
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI SetOMADMAlertCallback( tFNOMADMAlert pCallback );

//////////////////////////////////////////////////////////////////////////////
///
/// This function sends the specified OMA-DM selection for the current 
/// network initiated session
/// 
/// \param	selection   [ I ] - Selection
/// \param	sessionID   [ I ] - Unique session ID
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI OMADMSendSelection( 
   ULONG                      selection,
   USHORT                     sessionID );

//////////////////////////////////////////////////////////////////////////////
///
/// This function returns the OMA-DM feature settings
/// 
/// \param	pbProvisioning [ O ] - Device provisioning service update enabled
/// pbPRLUpdate    [ O ] - PRL service update enabled
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI OMADMGetFeatureSettings( 
   ULONG *                    pbProvisioning,
   ULONG *                    pbPRLUpdate );

//////////////////////////////////////////////////////////////////////////////
///
/// This function sets the OMA-DM device provisioning service 
/// update feature setting
/// QMI_OMA_DM_SET_FEATURE_SETTING_MSG 0x0025
///
/// \param	bProvisioning  [ I ] - Device provisioning service update enabled
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI OMADMSetProvisioningFeature( 
   ULONG                      bProvisioning );

//////////////////////////////////////////////////////////////////////////////
///
/// This function sets the OMA-DM PRL service update feature setting
/// QMI_OMA_DM_SET_FEATURE_SETTING_MSG 0x0025
///
/// \param  bPRLUpdate     [ I ] - PRL service update enabled
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI OMADMSetPRLUpdateFeature( 
   ULONG                      bPRLUpdate );
   
//////////////////////////////////////////////////////////////////////////////
///
/// This function returns information related to the current (or previous
/// if no session is active) OMA-DM session
/// QMI_OMA_DM_GET_SESSION_INFO_MSG 0x0022
///
/// \param  pSessionState  [ O ] - State of session
/// \param  pSessionType   [ O ] - Type of session
/// \param  pFailureReason [ O ] - Session failure reason (when state indicates failure)
/// \param  pRetryCount    [ O ] - Session retry count (when state indicates retrying)
/// \param  pSessionPause  [ O ] - Session pause timer (when state indicates retrying)
/// \param  pTimeRemaining [ O ] - Pause time remaining (when state indicates retrying)
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI OMADMGetSessionInfo( 
   ULONG *                    pSessionState,
   ULONG *                    pSessionType,
   ULONG *                    pFailureReason,
   BYTE *                     pRetryCount,
   WORD *                     pSessionPause,
   WORD *                     pTimeRemaining );

//////////////////////////////////////////////////////////////////////////////
///
/// This function returns information about the pending network initiated
/// alert
/// QMI_OMA_DM_GET_SESSION_INFO_MSG 0x0022
/// 
/// \param  pSessionType   [ O ] - Type of session
/// \param  pSessionID     [ O ] - Unique session ID
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI OMADMGetPendingNIA( 
   ULONG *                    pSessionType,
   USHORT *                   pSessionID );


//////////////////////////////////////////////////////////////////////////////
///
/// This function starts an OMA-DM session
/// QMI_OMA_DM_START_SESSION_MSG 0x0020
/// 
/// \param	sessionType [ I ] - Type of session to initiate
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI OMADMStartSession( ULONG sessionType );

//////////////////////////////////////////////////////////////////////////////
///
/// This function cancels an ongoing OMA-DM session
/// QMI_OMA_DM_CANCEL_SESSION_MSG 0x0021
///
/// \return See GobiErrorCodes.h
///
///////////////////////////////////////////////////////////////////////////////
IMPORTGOBI ULONG GOBICMAPI OMADMCancelSession();   

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