/*===========================================================================
FILE: 
   SwiWwanCmApi.h

DESCRIPTION:
   Sierra Wireless WAN Connection Manager API for Gobi

Copyright (C) 2011 Sierra Wireless Incorporated. All rights reserved.
                   Sierra Wireless Proprietary/GTDR

/*=========================================================================*/
// Definitions
/*=========================================================================*/

#ifndef __SWIWWANCMAPI_H__
#define __SWIWWANCMAPI_H__

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

// Calling convention for API
#define SWICALLBACK __stdcall
#define SWICMAPI __stdcall

/** 
* \defgroup GroupWCM WAN Connection Manager
*/
/*@{*/


#ifdef __cplusplus
   extern "C" {
#endif

///////////////////////////////////////////////////////////////////////////////
///
///	API Return Codes
///
///	See QC WWAN CM API for a description of return codes defined by Qualcomm.
///
/// The following is a list of return codes defined by Sierra Wireless.
///
/// Value	Description
/// ---------------------------------------------------------------------------
///  0899	API functions invoked within the context of an API callback thread
///			is not allowed.
///
///////////////////////////////////////////////////////////////////////////////

// RX/TX Packet counts callback function
typedef void (SWICALLBACK * tFNPacketTotals)(ULONG totalPacketTX, ULONG totalPacketRX);

// New NMEA sentence callback function
typedef void (SWICALLBACK * tFNNewNMEA)(LPCSTR pNMEA);

// New NMEA sentence plus mode callback function
typedef void (SWICALLBACK * tFNNewNMEAPlus)(LPCSTR pNMEA, ULONG mode);

// Signal strength information callback function
typedef void (SWICALLBACK * tFNSwiSignalStrengthInfo)(
	INT8	nCdmaRssi,
	ULONG	nCdmaEcio,
	INT8	nHdrRssi,
	ULONG	nHdrEcio,
	ULONG	nHdrSinr,
	ULONG	nHdrIo,
	INT8	nGsmRssi,
	INT8	nWcdmaRssi,
	ULONG	nWcdmaEcio,
	INT8	nLteRssi,
	INT8	nLteRsrq,
	INT16	nLteRsrp,
	UINT8	nLteSnr
	);

///////////////////////////////////////////////////////////////////////////////
///
/// ECIO callback function
///
///	\param	[O] nEcio
///				ECIO value representing negative 0.5 dBm increments, i.e., 
///				2 means -1 dBm; valid range of this field is 14 to 63 
///				(14 means -7 dBm, 63 means -31.5 dBm)
///
///			[O] nRadioIf
///					0x00 – None (no service)
///					0x01 – cdma2000 1X
///					0x02 – cdma2000 HRPD (1xEV-DO)
///					0x03 – AMPS
///					0x04 – GSM
///					0x05 – UMTS
///
///	\sa SetEcioCallback
///
///////////////////////////////////////////////////////////////////////////////
typedef void (SWICALLBACK * tFNEcio)(INT8 nEcio, ULONG nRadioIf);

///////////////////////////////////////////////////////////////////////////////
///
/// SNIR callback function
///
///	\param	[O] nSnir
///				SINR level - SNIR is only applicable for 1xEV-DO; valid levels
///				are 0 to 8 where max value for
///					- Level 0 is -9 dB
///					- Level 1 is -6 dB
///					- Level 2 is -4.5 dB
///					- Level 3 is -3 dB
///					- Level 4 is -2 dB
///					- Level 5 is +1 dB
///					- Level 6 is +3 dB
///					- Level 7 is +6 dB
///					- Level 8 is +9 dB
///
///	\sa SetSnirCallback
///
///////////////////////////////////////////////////////////////////////////////
typedef void (SWICALLBACK * tFNSnir)(ULONG nSnir);

///////////////////////////////////////////////////////////////////////////////
///
///	Error rate callback function
///
///	\param	[O] nErrorRate
///				Error rate of frames/packets/bits/blocks transmitted in the
///				channel duration a call; valid error rates values between 1
///				and 10000 will be returned to indicate the percentage; e.g.
///				value of 300 means error rate is 3%; a value of 0xFFFF
///				indicates that the error rate is unknown/unavailable.
///				
///				Terms used for error rate in different technologies:
///					- Frame Error Rate CDMA
///					- Packet Error Rate for HDR
///					- Bit Error Rate for GSM
///					- Block Error Rate for UMTS
///
///			[O] nRadioIf
///				Radio interface technology of the signal being measured
///					0x00 - None (no service)
///					0x01 - cdma2000 1X
///					0x02 - cdma2000 HRPD (1xEV-DO)
///					0x04 - GSM
///					0x05 - UMTS
///
///	\sa SetErrorRateCallback
///
///////////////////////////////////////////////////////////////////////////////
typedef void (SWICALLBACK * tFNErrorRate)(ULONG nErrorRate, ULONG nRadioIf);

///////////////////////////////////////////////////////////////////////////////
///
///	RSRQ callback function
///
///	\param	[O] nRsrq
///				RSRQ value in dB in signed integer value.  Valid range of this
///				field is -3 to -20 (-3 means -3dB, -20 means -20 dB)
/// 
///			[O] nRadioIf
///				Radio interface technology of the signal being measured
///					0x08 - LTE
///
///	\sa SetRsrqCallback
///
///////////////////////////////////////////////////////////////////////////////
typedef void (SWICALLBACK * tFNRsrq)(INT8 nRsrq, ULONG nRadioIf);

///////////////////////////////////////////////////////////////////////////////
///
///	Device removal callback function
///
///	\param	[O] nStatus	
///				Status code 
///
///	\sa SetDeviceRemovalCallback
///
///////////////////////////////////////////////////////////////////////////////
typedef void (SWICALLBACK * tFNSwiDeviceRemoval)(ULONG nStatus);

///////////////////////////////////////////////////////////////////////////////
///
///	This function enables/disables the device removal callback function.
/// 
/// The callback will be invoked when the device becomes unavailable.  The
/// application should cache required information and release the callback
/// thread ASAP.  The application must then call QCWWANDisconnect to shutdown 
/// the API.  To reinitialize the API, QCWWANConnect must be called.  Note that
/// previous callback assignments will be lost and must be re-assigned.
///
///	\param	[I] pCallback	
///				Callback function (NULL = disable).
///
///	\return	Return code
///
///	\sa tFNSwiDeviceRemoval
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiSetDeviceRemovalCallback(tFNSwiDeviceRemoval pCallback);

///////////////////////////////////////////////////////////////////////////////
///
///	This function enables/disables the ECIO callback function.
/// 
/// The callback will be invoked when the current ECIO and the last value indicated
/// crosses the specified threshold.
///
///	\param	[I] pCallback	
///				Callback function (NULL = disable).
/// 
///			[I] nThreshold
///				ECIO delta at which an event report indication will be sent.
///				ECIO delta is an unsigned, 1 byte value that increments in 
///				negative 0.5 dBm, e.g., ECIO delta of 2 means a change of -1 dBm.
///				Must be 0 when disabling the callback.
///
///	\return	Return code
///
///	\sa tFNEcio
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiSetEcioCallback(tFNEcio pCallback, BYTE nThreshold);

///////////////////////////////////////////////////////////////////////////////
///
///	This function enables/disables the SNIR callback function.
/// 
/// The callback will be invoked when the current SNIR and the last value indicated
/// crosses the specified threshold.
///
///	\param	[I] pCallback	
///				Callback function (NULL = disable).
/// 
///			[I] nThreshold
///				SINR delta level at which an event report indication, including
///				the current SINR, will be sent to the requesting control point;
///				sinr_delta level is an unsigned, 1 byte value.  Must be 0 when
///				disabling callback.
///
///	\return	Return code
///
///	\sa tFNSnir
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiSetSnirCallback(tFNSnir pCallback, BYTE nThreshold);

///////////////////////////////////////////////////////////////////////////////
///
///	This function enables/disables the error rate callback function.
///
///	\param	[I] pCallback	
///				Callback function (NULL = disable).
///
///	\return	Return code
///
///	\sa tFNErrorRate
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiSetErrorRateCallback(tFNErrorRate pCallback);

///////////////////////////////////////////////////////////////////////////////
///
///	This function enables/disables the RSRQ callback function.
/// 
/// The callback will be invoked when the current RSRQ and the last value indicated
/// crosses the specified threshold.
///
///	\param	[I] pCallback	
///				Callback function (NULL = disable).
/// 
///			[I] nThreshold
///				RSRQ delta level at which an event report indication, including
///				the current RSRQ, will be sent to the requesting control point; 
///				rsrq_delta level is an unsigned, 1 byte value.  Must be 0 when
///				disabling callback
///
///	\return	Return code
///
///	\sa tFNRsrq
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiSetRsrqCallback(tFNRsrq pCallback, BYTE nThreshold);

///////////////////////////////////////////////////////////////////////////////
///
///	This command forces the device to drop the traffic channel. The channel may 
/// be reactivated the next time data is sent over the interface. Thus, there 
/// is no guarantee that the channel will remain dormant for any guaranteed period.
///
///	\param	None
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiGoDormant(void);

///////////////////////////////////////////////////////////////////////////////
///
/// This function queries the behavior used to route new MT messages to 
/// MSM memory storage and WMS clients. The response indicates the current 
/// actions for all messaging routes on the MSM device taken upon receipt of 
/// an incoming WMS message matching that route.
/// 
/// This API is similar to Qualcomm's Gobi Anywhere SetSMSRoutes API.  The main
/// difference is the Sierra version uses BYTE for each SMS route array item 
/// whereas Qualcomm defined ULONG.
///
///	\param	[O] pRouteInstances 
///				Number of routes
/// 
///         [O] pRouteList
///				List of route type, route class, route memory, route value
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI GetRoutes( 
   ULONG*	pRouteInstances, 
   BYTE*	pRouteList );

///////////////////////////////////////////////////////////////////////////////
///
/// This function sets the routing action taken upon receipt of incoming the 
/// WMS message per message category. A storage location on the MSM device and 
/// whether indications should be sent to interested WMS clients may be 
/// specified separate for each message category.
/// All routes need not be set at the same time. Routes not specified in the 
/// request message will be left unchanged.
/// 
/// This API is similar to Qualcomm's Gobi Anywhere SetSMSRoutes API.  The main
/// difference is the Sierra version uses BYTE for each SMS route array item 
/// whereas Qualcomm defined ULONG.
///
///	\param	[I] RouteInstances 
///				Number of routes
/// 
///         [I] pRouteList
///				List of route type, route class, route memory, route value
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SetRoutes( 
   ULONG	nRouteInstances, 
   BYTE*	pRouteList );


///////////////////////////////////////////////////////////////////////////////
///
/// This function returns IP configuration data for the current packet 
/// data session. 
///
/// \param  [O] pIPAddress
///				Assigned IPv4 address
///
///         [O] pGatewayAddress
///				Assigned IPv4 gateway address
///
///         [O] pSubnetMask
///				Assigned IPv4 subnet mask
///
///         [O] pPrimaryDnsAddress
///				Assigned IPv4 primary DNS address
///
///         [O] pSecondaryDnsAddress
///				Assigned IPv4 secondary DNS address
///  
/// \return Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI GetIPConfiguration(
    ULONG *	pIPAddress, 
    ULONG *	pGatewayAddress, 
    ULONG *	pSubnetMask, 
    ULONG *	pPrimaryDnsAddress, 
    ULONG *	pSecondaryDnsAddress );

///////////////////////////////////////////////////////////////////////////////
///
/// This function can be used to decode a WCDMA draft message read from the 
/// device using GetSMS() API.  The text message will be returned in UCS2 along 
/// with related message information. 
///
/// Note that some text messages span multiple messages.  Decoded messages can
/// be concatenated based on the information returned by this function.  All
/// text message segments part of the same text message shall share a message 
/// reference number and the same number of total segments.
///
/// \param  [I] pMessage
///				Message read off the device via GetSMS
///
/// \param  [I/O] pDestAddrLength
///				Upon input, indicates the maximum number of ASCII characters 
///				(including NULL termination) that the pDestAddr buffer can
///				accommodate.  Note that a length of 14 is reasonable.
///				Upon successful output, returns the length of destination 
///				address string (including NULL termination)
///
/// \param  [O] pDestAddr
///				Returns NULL-terminated ASCII String containing destination address
///				International number will be prepended with a '+' character
///
/// \param  [I/O] pTextMsgLength
///				Upon input, specifies the number of UCS2 characters the given text
///				message buffer can accommodate.  Upon successful output, returns 
///				the number of UCS2 characters returns in the given text message 
///				buffer (including the NULL-terminator).
///
/// \param  [O] pTextMsg
///				Returns the text message as  NULL-terminated UCS2 string
///
/// \param  [I/O] pScAddrLength (optional pointer)
///				Upon input, indicates the maximum number of ASCII characters 
///				(including NULL termination) that the pScAddr buffer 
///				can accommodate.  Note that a length of 14 is reasonable.
///				Upon successful output, returns the length of SC address string
///				(including the NULL termination)
///				
/// \param  [O] pScAddr (optional pointer)
///				NULL-terminated ASCII String containing service center address
///				International number will be prepended with a '+' character.
///      
/// \param  [O] pRejectDuplicates (optional pointer)
///             Returns the reject duplicates parameter.  A value of TRUE 
///				instructs the service center to reject new messages that have 
///				the same message reference number and destination address as a 
///				message already held in the service center.
///
/// \param  [O] pStatusReportReq (optional pointer)
///				Returns the status report request parameter.
///             A value of TRUE indicates that a status report is requested.
///
/// \param  [O] pReplyPath (optional pointer)
///				Returns the reply path parameter.
///				See 3GPP TS 23.040 Annex D for more information.
///
/// \param  [O] pValidityFormat (optional pointer)
///				Returns validity period format (see note for more information)
///					0 - no validity period present
///					1 - relative validity period format
///					2 - enhanced validity period format
///					3 - absolute validity period format
///
/// \param  [O] validityPeriod[7] (optional pointer)
///				Returns the validity period (see note for more information)
///					Relative format:  only the first octet is used
///					Enhanced format:  all 7 bytes are used
///					Absolute format:  all 7 bytes are used
///
/// \param  [O] pConcatenatedMsg (optional pointer)
///				Returns TRUE if this message is a segment of a concatenated message
///          
/// \param  [O] pMsgRefNum (optional pointer)
///				Returns the message reference number
///
/// \param  [O] pTotalSegments (optional pointer)
///				Returns the total number of segments if this message is part of a 
///				concatenated message.
///
/// \param  [O] pSegmentNum (optional pointer)
///				Returns the segment sequence number of this portion of the concatenated
///				message.
///
/// \note  Validity period formats
///			Relative format is 1 octet in length and takes the following form:
///           For values 0 to 143: validity period = (value + 1)* 5 minutes
///           For values 144 to 167: validity period = 12 hours + (value - 143)* 30 minutes
///           For values 168 to 196: validity period = (value - 166) * 1 day
///           For values 197 to 255: validity period = (value - 192) * 1 week
///
///         Absolute format is 7 octets in length and takes the following form:
///				YYMMDDHHMMSSTZ where
///					YY - year
///					MM - month
///					DD - day
///					HH - hour
///					MM - minute
///					SS - second
///					TZ - timezone
///				The timezone is in relation to GMT, one unit is equal to 15  
///				minutes and the MSB indicates a negative value
///
///          Enhanced format is 7 octets in length.  Please see 3GPP TS 23.040 for
///          the form.
///
/// \return QCWWAN_ERR_BUFFER_TOO_SMALL if pDestAddrLength, pTextMsgLength or 
///			pScAddrLength is too small to accommodate the decoded data then
///			the required length will be returned in the problem parameter.
///
///			SWI_ERR_API_INVALID_PDU_MESSAGE_TYPE if the given message can not be
///			decoded by this function because it is of a different format.
///
///			See other return codes.
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI WCDMADecodeMOTextMsg(
	BYTE*    pMessage,
	BYTE*    pDestAddrLength,
	CHAR*    pDestAdd,
	BYTE*    pTextMsgLength,
	WCHAR*   pTextMsg,
	BYTE*    pScAddrLength,
	CHAR*    pScAddr,
	BOOLEAN* pRejectDuplicates,
	BOOLEAN* pStatusReportReq,
	BOOLEAN* pReplyPath,
	BYTE*    pValidityFormat,
	BYTE     validityPeriod[7],
	BOOLEAN* pConcatenatedMsg,
	ULONG*   pMsgRefNum,
	BYTE*    pTotalSegments,
	BYTE*    pSegmentNum);

///////////////////////////////////////////////////////////////////////////////
///
/// This function can be used to decode a received WCDMA SMS message read off 
/// the device using the GetSMS() API. The text message will be returned in 
/// UCS2 along with related message information. 
///
/// Note that some text messages span multiple messages.  Decoded messages can
/// be concatenated based on the information returned by this function.  All
/// text message segment share a message reference number and the same number of
/// total segments.
///
/// \param  [I] pMessage
///				Message read off the device via GetSMS
///
/// \param  [I/O] pSenderAddrLength
///				Upon input, indicates the maximum number of ASCII characters 
///				(including NULL termination) that the pSenderAddr buffer can
///				accommodate.  Note that a length of 14 is reasonable.
///				Upon successful output, returns the length of destination 
///				address string (including the NULL termination)
///
/// \param  [O] pSenderAddr
///				Returns NULL-terminated ASCII String containing destination address
///				International number will be prepended with a '+' character.
///
/// \param  [I/O] pTextMsgLength
///				Upon input, specifies the number of UCS2 characters the given text 
///				message buffer can accommodate.  Upon successful output, returns 
///				the number of UCS2 characters returns in the given text message 
///				buffer (including the NULL-terminator)
///
/// \param  [O] pTextMsg
///				Returns the text message as  NULL-terminated UCS2 string
///
/// \param  [I/O] pScAddrLength (optional pointer)
///				Upon input, indicates the maximum number of ASCII characters 
///				(including NULL termination) that the pScAddr buffer can 
///				accommodate. Note that a length of 14 is reasonable.  Upon 
///				successful output, returns the length of SC address string 
///				(including the NULL termination)
///				
/// \param  [O] pScAddr (optional pointer)
///				NULL-terminated ASCII String containing service center address
///				International number will be prepended with a '+' character.
///      
/// \param  [O] pMoreMsgSend (optional pointer)
///             Returns the more message to send parameter.  A value of TRUE 
///				indicates that no more messages are waiting to be delivered
///
/// \param  [O] pReplyPath (optional pointer)
///				Returns the reply path parameter.
///             See 3GPP TS 23.040 Annex D for more information
///
/// \param  [O] pStatusReportInd (optional pointer)
///				Returns the status report indication parameter.
///             A value of TRUE indicates a that a status report will be returned 
///				to the sender
///
/// \param  [O] scTimeStamp[7] (optional pointer)
///				Returns the service center address which takes the form:
///					YYMMDDHHMMSSTZ where
///						YY - year
///						MM - month
///						DD - day 
///						HH - hour
///						MM - minute
///						SS - second
///						TZ - timezone
///				All values are in decimal.  The timezone is in relation to GMT, 
///             one unit is equal to 15 minutes and the MSB indicates a negative 
///             value
///
/// \param  [O] pConcatenatedMsg (optional pointer)
///				Returns TRUE if this message is a segment of a concatenated message
///          
/// \param  [O] pMsgRefNum (optional pointer)
///				Returns the message reference number
///
/// \param  [O] pTotalSegments (optional pointer)
///				Returns the total number of segments if this message is part of a 
///				concatenated message.
///
/// \param  [O] pSegmentNum (optional pointer)
///				Returns the segment sequence number of this portion of the concatenated
///				message.
///
/// \return QCWWAN_ERR_BUFFER_TOO_SMALL if pSenderAddrLength, pTextMsgLength or 
///			pScAddrLength is too small to accommodate the decoded data then
///			the required length will be returned in the problem parameter.
///
///			SWI_ERR_API_INVALID_PDU_MESSAGE_TYPE if the given message can not 
///			decoded by this function because it is of a different format.
///
///			See other return codes.
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI WCDMADecodeMTTextMsg(
	BYTE*    pMessage,
	BYTE*    pSenderAddrLength,
	CHAR*    pSenderAddr,
	BYTE*    pTextMsgLength,
	WCHAR*   pTextMsg,
	BYTE*    pScAddrLength,
	CHAR*    pScAddr,
	BOOLEAN* pMoreMsgSend,
	BOOLEAN* pReplyPath,
	BOOLEAN* pStatusReportInd,
	BYTE     scTimeStamp[7],
	BOOLEAN* pConcatenatedMsg,
	ULONG*   pMsgRefNum,
	BYTE*    pTotalSegments,
	BYTE*    pSegmentNum);

///////////////////////////////////////////////////////////////////////////////
///
/// This function can be used to decode a received CDMA SMS message read off 
/// the device using the GetSMS() API. The text message will be returned in 
/// UCS2 along with related message information. 
///
/// \param  [I] messageLength:
///				Length of the message to be decoded in bytes
///
/// \param  [I] pMessage:
///				Message read off the device via GetSMS
///
/// \param  [I/O] pSenderAddrLength
///				Upon input, indicates the maximum number of ASCII characters 
///				(including NULL termination) that the pSenderAddr buffer can
///				accommodate.  Note that a length of 14 is reasonable.
///				Upon successful output, returns the length of originating 
///				address string (including the NULL termination)
///
/// \param  [O] pSenderAddr
///				Returns NULL-terminated ASCII String containing the originating address
///				International number will be prepended with a '+' character.
///
/// \param  [I/O] pTextMsgLength
///				Upon input, specifies the number of UCS2 characters the given text 
///				message buffer can accommodate.  Upon successful output, returns 
///				the number of UCS2 characters returns in the given text message 
///				buffer (including the NULL-terminator)
///
/// \param  [O] pTextMsg
///				Returns the text message as  NULL-terminated UCS2 string
///      
/// \param  [O] pPriority (optional pointer)
///             Returns the priority setting of the message
///					0x00 - normal
///					0x01 - interactive
///					0x02 - urgent
///					0x03 - emergency
///					0xFF - unavailable setting
///
/// \param  [O] pPrivacy (optional pointer)
///				Returns the privacy setting of the message
///					0x00 - not restricted
///					0x01 - restricted
///					0x02 - confidential
///					0x03 - secret
///					0xFF - unavailable setting
///
/// \param  [O] pLanguage (optional pointer)
///				Returns the language setting of the message
///					0x00 - unspecified
///					0x01 - english
///					0x02 - french
///					0x03 - spanish
///					0x04 - japanese
///					0x05 - korean
///					0x06 - chinese
///					0x07 - hebrew
///					0xFF - unavailable setting
///
/// \param  [O] mcTimeStamp[7] (optional pointer)
///				Returns the message center timestamp which takes the form:
///					YYMMDDHHMMSSTZ where
///						YY - year
///						MM - month
///						DD - day 
///						HH - hour
///						MM - minute
///						SS - second
///						TZ - timezone
///				All values are in decimal.  The timezone is in relation to GMT, 
///             one unit is equal to 15 minutes and the MSB indicates a negative 
///             value.  If this information is unavailable for this message then
///				this field will be filled with 0xFF.
///
/// \param  [O] absoluteValidity[7] (optional pointer)
///				Returns the absolute validity period setting for this message.  This
/// 			field takes the same form as mcTimeStamp.
///          
/// \param  [O] pRelativeValidity (optional pointer)
///				Returns the relative validity period.  Values have the following meanings:
///				  For values 0 to 143: validity period = (value + 1)* 5 minutes
///				  For values 144 to 167: validity period = 12 hours + (value - 143)* 30 minutes
///				  For values 168 to 196: validity period = (value - 166) * 1 day
///				  For values 197 to 244: validity period = (value - 192) * 1 week
///				  For value 245: validity period = indefinite
///               For value 246: validity period = immediate
///				  For value 247: validity period = valid until mobile becomes inactive
///               For value 248: validity period = valid until registration area changes
///               For values 249 to 254: reserved
///				  for value 255: unavailable information
///
/// \param  [O] pDisplayMode (optional pointer)
///				Returns the display mode parameter
///					0x00 - immediate display
///					0x01 - mobile default setting
///					0x02 - user invoked
///					0x03 - reserved
///					0xFF - unavailable parameter
///
/// \param  [O] pUserAcknowledgementReq (optional pointer)
///				Returns the user (manual) acknowledgment request parameter
///					TRUE means the user is requested to manually acknowledge the 
///						delivery of the message
///                 FALSE means no such user acknowledgement is requested
///
/// \param  [O] pReadAcknowledgementReq (optional pointer)
///				Returns the read acknowledgement request parameter
///					TRUE means acknowledgment of the message being viewed is requested
///                 FALSE means no such read acknowledgement is requested
///
/// \param  [O] pAlertPriority (optional pointer)
///				Returns the alerting parameter setting
///					0x00 - use default alert
///					0x01 - use low priority alert
///					0x02 - use medium priority alert
///					0x03 - use high priority alert
///					0xFF - unavailable parameter
///
/// \param  [O] pCallbkAddrLength (optional pointer)
///				returns the length of Callback  
///				address string (including the NULL termination)
///
/// \param  [O] pCallbkAddr
///				Returns NULL-terminated ASCII String containing callback address String 
///				containing the Call Back number with a 32 maximum characters.
///
/// \return QCWWAN_ERR_BUFFER_TOO_SMALL if pSenderAddrLength, pTextMsgLength or 
///			pScAddrLength is too small to accommodate the decoded data then
///			the required length will be returned in the problem parameter.
///
///			SWI_ERR_API_INVALID_PDU_MESSAGE_TYPE if the given message can not 
///			decoded by this function because it is of a different format.
///
///			See other return codes.
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI CDMADecodeMTTextMsg(
	ULONG    messageLength,
	BYTE*    pMessage,
	ULONG*   pMessageID,
	BYTE*    pSenderAddrLength,
	CHAR*    pSenderAddr,
	BYTE*    pTextMsgLength,
	WCHAR*   pTextMsg,
	BYTE*    pPriority,
	BYTE*    pPrivacy,
	BYTE*    pLanguage,
	BYTE     mcTimeStamp[7],
	BYTE     absoluteValidity[7],
	BYTE*    pRelativeValidity,
	BYTE*    pDisplayMode,
	BOOL*    pUserAcknowledgementReq,
	BOOL*    pReadAcknowledgementReq,
	BYTE*    pAlertPriority,
	BYTE*    pCallbkAddrLength = NULL,
	CHAR*    pCallbkAddr = NULL
);

///////////////////////////////////////////////////////////////////////////////
///
/// This function can be used to encode an outgoing WCDMA message.  The 
/// the resulting message can be either stored on the device using SaveSMS()
/// or sent to the service center using SendSMS().  
///
/// The caller must provide an UCS2 text message to be encoded, a message
/// reference number and a destination address.  All other information
/// is optional for the caller to specify.  Default values will be used in
/// the encoded when option parameter are not given.  
///
/// The caller can specify what character set should be used to encode
///	the given text message.  If the character set is not specified then this
/// function will encode the message using the character set that yields the
/// smallest encoded message.
///
/// Some text messages will span multiple messages.  This function return
/// all the messages necessary to encode the entire given text message.
///
/// \param  [I/O] pMessageListSize:
///				Upon input, specifies the total number of Messages that can be 
///				constructed in the memory indicated by pMessageList.  Note that
///				in WCDMA it may take multiple message to encode a single text message
///				Upon successful output, specifies the total number of Messages 
///				required.
///
/// \param  [O] pMessageList:
///				A list of constructed message where every member of the list takes
///				the following form:
///					BYTE messageLength
///					BYTE message[176]
///		
/// \param  [I] messageRefNum 
///				The message reference number for this message.  This value should 
///				be incremented for every message the host application sends.
///
/// \param  [I] pDestAddr
///				Gives NULL-terminated ASCII String containing destination address.
///				International number will be prepended with a '+' character.
///
/// \param  [I] textMsgLength
///				Number of UCS2 characters in the text message (excluding NULL)
///
/// \param  [O] pTextMsg
///				UCS2 text message to be encoded
///
/// \param  [I] pScAddr (optional pointer)
///				Gives NULL-terminated ASCII String containing service center address.
///				International number will be prepended with a '+' character.
///      
/// \param  [I] pRejectDuplicates (optional pointer)
///             Gives the reject duplicates parameter.  TRUE instructs the service
///				center to reject new messages if they share the same message 
///				reference number and destination address as a message already
///				being held in the service center.  FALSE instructs the service 
///				centre to accept new messages if they share the same message 
///				reference number and destination address as a message already 
///				being held in the service center (default setting if NULL 
///				pointer is given)
///              
/// \param  [I] pStatusReportReq (optional pointer)
///				Gives the status report request parameter.  TRUE if a status report
///				is requested.  FALSE if no status report is requested (default 
///				setting if NULL pointer is given).
///
/// \param  [I] pReplyPath (optional pointer)
///				Gives the reply path parameter.  FALSE is the default setting if
///				NULL pointer is given.  See 3GPP TS 23.040 Annex D for more information 
///
/// \param  [I] pDestAddr
///				Gives NULL-terminated ASCII String containing destination address.
///				International number will be prepended with a '+' character.
///
/// \param  [I] pValidityFormat (optional pointer)
///				Gives validity period format (see note for more information)
///					0 - no validity period present (default setting if NULL pointer given)
///					1 - relative validity period format (recommended as a validity period format)
///					2 - enhanced validity period format
///					3 - absolute validity period format
///
/// \param  [I] validityPeriod[7] (optional pointer)
///				Gives the validity period (see note for more information)
///					Relative format:  only the first octet is used
///					Enhanced format:  all 7 bytes are used
///					Absolute format:  all 7 bytes are used
///
/// \param  [I/O] pEncodingAlphabet (optional pointer)
///				Upon input, specifies the alphabet the text message should be encoded in
///					0 - smallest possible alphabet (default if NULL pointer given)
///					1 - default 7-bit alphabet
///					2 - 8-bit alphabet (ASCII)
///					3 - UCS2
///				Upon successful output, specifies the alphabet used to encode the message.
///
/// \note  Validity period formats:
///			Relative format is 1 octet in length and takes the following form:
///           for values 0 to 143: validity period = (value + 1)* 5 minutes
///           for values 144 to 167: validity period = 12 hours + (value - 143)* 30 minutes
///           for values 168 to 196: validity period = (value - 166) * 1 day
///           for values 197 to 255: validity period = (value - 192) * 1 week
///
///         Absolute format is 7 octets in length and takes the following form:
///				YYMMDDHHMMSSTZ where
///					YY - year
///					MM - month
///					DD - day
///					HH - hour
///					MM - minute
///					SS - second
///					TZ - timezone
///				The timezone is in relation to GMT, one unit is equal to 15  
///				minutes and the MSB indicates a negative value
///
///          Enhanced format is 7 octets in length.  Please see 3GPP TS 23.040 for
///          the form.
///
/// \return QCWWAN_ERR_BUFFER_TOO_SMALL if pMessageListSize is too small to 
///			accommodate given text message.  pMessageListSize shall return 
///			the required size.
///
///			SWI_ERR_API_IMPOSSIBLE_ENCODING if requested encoding alphabet can not
///			accommodate the given text message.  pEncodingAlphabet shall return
///			an appropriate encoding alphabet.
///
///			See other return codes
/// 
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI WCDMAEncodeMOTextMsg(
	BYTE*    pMessageListSize,
	BYTE*    pMessageList,
	BYTE     messageRefNum,
	CHAR*    pDestAddr,
	ULONG    textMsgLength,
	WCHAR*   pTextMsg,
	CHAR*    pScAddr,
	BOOLEAN* pRejectDuplicates,
	BOOLEAN* pStatusReportReq,
	BOOLEAN* pReplyPath,
	BYTE*    pValidityFormat,
	BYTE     validityPeriod[7],
	BYTE*    pEncodingAlphabet);

///////////////////////////////////////////////////////////////////////////////
///
/// This function can be used to encode an outgoing CDMA message.  The 
/// the resulting message can be either stored on the device using SaveSMS()
/// or sent to the service center using SendSMS().  
///
/// The caller must provide an UCS2 text message to be encoded, a message
/// ID, a callback address and a destination address.  All other information
/// is optional for the caller to specify.  Default values will be used in
/// the encoded when option parameter are not given.  
///
/// Note that currently this API can only encode 7bit ASCII messages.
///
/// \param  [I/O] pMessageSize:
///				Upon input, specifies the total number of bytes that the given 
///				pMessage buffer can hold (a buffer of length 240 is recommended)
///				Upon successful output, specifies the length of the constructed 
///				message placed in the pMessage buffer (in bytes).
///
/// \param  [O] pMessage:
///				The constructed raw message 
///
/// \param  [I] messageId 
///				The message reference number for this message.  This value should 
///				be incremented for every message the host application sends.
///
/// \param  [I] pDestAddr
///				Gives NULL-terminated ASCII String containing a destination address.
///				International number will be prepended with a '+' character.
///
/// \param  [I] pCallbackAddr
///				Gives NULL-terminated ASCII String containing a callback address.
///				International number will be prepended with a '+' character.
///
/// \param  [I] textMsgLength
///				Number of UCS2 characters in the text message (excluding NULL)
///
/// \param  [O] pTextMsg
///				UCS2 text message to be encoded
///
/// \param  [I] pPriority (optional pointer)
///				Gives the priority of the outgoing message:
///					0 - normal (default if NULL pointer is given)
///					1 - interactive
///					2 - urgent
///					3 - emergency
///					64 - 64 is decoded value for URGENT VZAM Support interactive
///					128 - 128 is decoded value for URGENT VZAM Support urgent
///					192 - 128 is decoded value for URGENT VZAM Support emergency
///
/// \param  [I/O] pEncodingAlphabet (optional pointer)
///				Upon input, specifies the alphabet the text message should be encoded in
///					0 - 8bit ASCII (not supported at this time)
///					1 - IS91EP (not supported at this time)
///					2 - 7bit ASCII (default if NULL pointer is given)
///					3 - IA5 (not supported at this time)
///					4 - unicode (not supported at this time)
///					5 - shift JIS (not supported at this time)
///					6 - korean (not supported at this time)
///					7 - latin hebrew (not supported at this time)
///					8 - latin (not supported at this time)
///					9 - GSM 7 bit default
///				Upon successful output, specifies the alphabet used to encode the message.
///
/// \param  [I] pRelValidity (optional pointer)
///				Gives the relative validity period of the outgoing message per per 4.5.6-1 of spec
///					0 - Set Relative validity to 11 
///					1 - Set Relative validity to 71 
///					2 - Set Relative validity to 167 
///					3 - Set Relative validity to 169 
///					4 - Set Relative validity to 171 
///				Values have the following meanings:
///				  For values 0 to 143: validity period = (value + 1)* 5 minutes
///				  For values 144 to 167: validity period = 12 hours + (value - 143)* 30 minutes
///				  For values 168 to 196: validity period = (value - 166) * 1 day
///				  For values 197 to 244: validity period = (value - 192) * 1 week
///				  For value 245: validity period = indefinite
///
/// \return QCWWAN_ERR_BUFFER_TOO_SMALL if pMessageListSize is too small to 
///			accommodate given text message.  pMessageListSize shall return 
///			the required size.
///
///			SWI_ERR_API_IMPOSSIBLE_ENCODING if requested encoding alphabet can not
///			accommodate the given text message.  pEncodingAlphabet shall return
///			an appropriate encoding alphabet.
///
///			See other return codes
/// 
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI CDMAEncodeMOTextMsg(
	BYTE*    pMessageSize,
	BYTE*    pMessage,
	BYTE     messageId,
	CHAR*    pDestAddr,
	CHAR*    pCallbackAddr,
	ULONG    textMsgLength,
	WCHAR*   pTextMsg,
	BYTE*    pPriority,
	BYTE*    pEncodingAlphabet,
	BYTE*    pRelValidity = NULL);

///////////////////////////////////////////////////////////////////////////////
///
/// This function deletes one or more SMS messages from the device memory of 
/// an LTE device.
/// 
/// \param  [I] storageType
///             SMS message storage type
///					0x0 UIM
///					0x1 NV
///
/// \param  [I] pMessageIndex (optional pointer)
///				SMS message index
///
/// \param  [I] pMessageTag (optional pointer) 
///             SMS message tag 
///					0x00 - MT_READ
///					0x01 - MT_NOT_READ
///					0x02 - MO_SENT
///					0x03 - MO_NOT_SENT
///
/// \param  [I] pMessageMode (optional pointer) 
///             SMS message mode 
///					0x00 - CDMA
///					0x01 - GSM/WCDMA
///   
///	\return	Return code
/// 
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI LTEDeleteSMS( 
   ULONG                      storageType, 
   ULONG *                    pMessageIndex, 
   ULONG *                    pMessageTag,
   ULONG *                    pMessageMode );

///////////////////////////////////////////////////////////////////////////////
///
/// This function returns the list of SMS messages stored on an LTE device. 
/// 
/// \param  [I] storageType
///             SMS message storage type
///
/// \param  [I] pRequestedTag (optional pointer) 
///             SMS message tag pointer
///					0x00 - MT_READ
///					0x01 - MT_NOT_READ
///					0x02 - MO_SENT
///					0x03 - MO_NOT_SENT
///
/// \param  [O] pMessageListSize
///				Upon input the maximum number of elements that the message list 
///				array can contain.  Upon successful output the actual number of 
///				elements in the message list array
///
/// \param  [O] pMessageList
///             SMS message list array
///
/// \param  [I] pMessageMOde (optional pointer) 
///             SMS message mode
///					0x00 - CDMA
///					0x01 - GSM/WCDMA
///   
///	\return	Return code
/// 
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI LTEGetSMSList( 
   ULONG	storageType, 
   ULONG *	pRequestedTag,
   ULONG *	pMessageListSize, 
   BYTE *	pMessageList,
   ULONG *	pMessageMode );

///////////////////////////////////////////////////////////////////////////////
///
/// This function returns an SMS message from the device memory of an LTE device
/// 
/// \param  [I] storageType
///             SMS message storage type
///					0x0 - UIM
///					0x1 - NV
/// \param  [I] messageIndex
///				SMS message index
/// \param  [O] pMessageTag
///             SMS message tag 
///					0x00 - MT_READ
///					0x01 - MT_NOT_READ
///					0x02 - MO_SENT
///					0x03 - MO_NOT_SENT
/// \param  [O] pMessageFormat
///             SMS message format 
///					0x00 - CDMA
///					0x02 to 0x05 - Reserved
///					0x06 - GSM/WCDMA PP
/// \param  [O] pMessageSize
///				Upon input the maximum number of bytes that can be written to
///				the message array.  Upon successful output the actual number
///				of bytes written to the message array
/// \param  [O] pMessage
///             The message contents array
/// \param  [I] pMessageMode (optional pointer) 
///             SMS message mode
///					0x00 - CDMA
///					0x01 - GSM/WCDMA
///   
///	\return	Return code
/// 
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI LTEGetSMS( 
   ULONG	storageType, 
   ULONG	messageIndex, 
   ULONG *	pMessageTag,
   ULONG *	pMessageFormat,
   ULONG *	pMessageSize, 
   BYTE *	pMessage,
   ULONG *	pMessageMode );

///////////////////////////////////////////////////////////////////////////////
///
/// This function modifies the status of an SMS message saved in storage on 
/// an LTE device
/// 
/// \param  [I] storageType
///             SMS message storage type
///					0x0 - UIM
///					0x1 - NV
///
/// \param  [I] messageIndex (optional pointer) 
///             SMS message index
///
/// \param  [I] messageTag (optional pointer) 
///             SMS message tag
///					0x00 - MT_READ
///					0x01 - MT_NOT_READ
///					0x02 - MO_SENT
///					0x03 - MO_NOT_SENT
///
/// \param  [I] pMessageMOde (optional pointer) 
///             SMS message mode pointer
///					0x00 CDMA
///					0x01 GSM/WCDMA
///   
///	\return	Return code
/// 
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI LTEModifySMSStatus( 
   ULONG	storageType, 
   ULONG	messageIndex, 
   ULONG	messageTag,
   ULONG*	pMessageMode );

///////////////////////////////////////////////////////////////////////////////
///
/// This function can be used to get image information (including Image ID, 
//  Build ID and Version ID)for the image specified by the given fully qualified 
//  path. Then the Image ID and Build ID can be used for SetImagePreferen 
//  function to upgrade firmware to the flash.
/// 
/// 
/// \param  [I] pDeviceID (optional pointer)
///             The device ID as reported by Windows, default to NULL for Win CE
/// \param  [I] pDeviceKey (optional pointer)
///             The device key (unique, stored on-device), default to NULL for Win CE
/// \param  [I] pFilePath
///             Fully qualified path to image file, normallly amss.mbn and 
//              cqcn.mbn for Gobi3k, 
/// \param  [O] pImageType
///             Image type for the firmware, SMS message mode pointer
///             0x00 Modem Image
///             0x01 PRI Image
/// \param  [O] pImageID
///             Unique image ID, an unique 16 byte ID
/// \param  [O] pImageID
///             Unique image ID, an unique 16 byte ID
/// \param  [O] pVersionID
///             Vsersion ID, include carrier, radio technoledge, GPS etc. information
/// \param  [I] versionSize
///             The maximum number of characters including the NULL terminator that
///             can be copied to the version array
/// \param  [I] pVersion
///             NULL-terminated string representing the build ID of the image 
///
///	\return	Return code
/// 
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI GetImageInfo3KW( 
    WCHAR*	pDeviceID, 
    WCHAR*	pDeviceKey, 
    WCHAR*	pFilePath, 
    BYTE *	pImageType,
    BYTE *	pImageID,
    ULONG*	pVersionID,
    USHORT	versionSize,
    WCHAR*	pVersion );

///////////////////////////////////////////////////////////////////////////////
///
/// Gets information regarding the system that currently provides service 
/// to the device
/// 
/// Note: this API is not supported for Gobi 2000. 
///
/// \param  [O] pRegistrationState
///				Registration state
/// \param	[O]	pCSDomain            
///				Circuit switch domain status
/// \param	[O]	pPSDomain            
///				Packet switch domain status 
/// \param	[O] pRAN                
///				Radio access network 
/// \param	[O] pRadioIfacesSize     
///				Upon input the maximum number of elements 
///				that the radio interfaces can contain.  Upon 
///				successful output the actual number of elements 
///				in the radio interface array
/// \params [O] pRadioIfaces        
///				The radio interface array 
/// \params [O] pRoaming             
///				Roaming indicator (0xFFFFFFFF - Unknown)
/// \params [O] pMCC                 
///				Mobile country code (0xFFFF - Unknown)
/// \params [O] pMNC                 
///				Mobile network code (0xFFFF - Unknown)
/// \params [I] nameSize             
///				The maximum number of characters (including 
///				NULL terminator) that the network name array 
///				can contain
///	\params [O]	pName  
///				The network name or description represented 
///				as a NULL terminated string (empty string 
///				returned when unknown)
///	\params [O]	pSID
///				CDMA System ID
///	\params [O]	pNID
///				CDMA Network ID
///
///	\return	Return code
/// 
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiGetServingNetwork( 
	ULONG *	pRegistrationState, 
	ULONG *	pCSDomain, 
	ULONG *	pPSDomain, 
	ULONG *	pRAN, 
	BYTE *	pRadioIfacesSize, 
	BYTE *	pRadioIfaces, 
	ULONG *	pRoaming, 
	WORD *	pMCC, 
	WORD *	pMNC, 
	BYTE	nameSize, 
	CHAR *	pName, 
	WORD*	pSID,
	WORD*	pNID);

///////////////////////////////////////////////////////////////////////////////
//
/// This function returns the WiFi positioning state.
/// 
/// Note: this API is not supported for Gobi 2000. 
///
/// \param  [O] pState
///             XTRA time positioning state 
///                 0x00 - Disabled
///                 0x01 - Enabled
///                 0xFF - Not supported
///
///	\return	Return code
/// 
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI GetWiFiState( ULONG * pState );

///////////////////////////////////////////////////////////////////////////////
//
/// This function sets the WiFi positioning state.
/// 
/// Note: this API is not supported for Gobi 2000. 
///
/// \param  [I] State
///             XTRA time positioning state 
///                 0x00 - Disabled
///                 0x01 - Enabled
///
///	\return	Return code
/// 
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SetWiFiState( ULONG state );

///////////////////////////////////////////////////////////////////////////////
///
/// This function instructs the API to generate a fatal exception.
/// 
/// This function is useful for applications validating error conditions.
///
/// \param  [I] nCrashMethod
///				0 - Division by zero
///				1 - NULL pointer access
///  
/// \return Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI InvokeApiCrash(ULONG nCrashMethod);

///////////////////////////////////////////////////////////////////////////////
///
/// This structure contains TCP optimization parameters.
///
///	TcpWindowSize is modified per-interface while other values are modified
///	on a global level.  Global values do not take effect until after the OS
///	reboots.  Per-interface values are used once the AirCard is re-inserted
///	or if the mini-cards is reset.
///
///		- Suggested values for AC750:
///			- nTcpWindowSize = 19200
///			- bSackOpts = true
///			- nTcpMaxDupAcks = 1	
///				
///		- Suggested values for AC775:
///			- nTcpWindowSize = 42300
///			- bSackOpts = true
///			- nTcpMaxDupAcks = 1
///
///		- Suggested values for AC8xx and MC87xx:
///			- nTcpWindowSize = 65535
///			- bSackOpts = true
///			- nTcpMaxDupAcks = 1			
///
///	Further tests indicate that the GlobalTcpWindowSize must be greater
///	or equal to the per-interface TcpWindowSize, as the lower of the
///	two is used GlobalMaxTcpWindowSize, while it has no effect on NDIS,
///	does appear to be used by the DUN interface.
///
///	Windows Vista, Windows XP, Windows 2000, and Windows 98 and Windows CE
///	are supported for all devices.
///
/// \sa SwiGetTcpOpt
/// \sa SwiOptimizeTcp
///
///////////////////////////////////////////////////////////////////////////////
#ifndef SWI_STRUCT_DEFINED
struct SWI_STRUCT_TcpOpt
{
   /*!	TCP receive window size.  Modification will be done per-interface.
   - Suggested value for AC750 is 19200
   - Suggested value for AC775 is 42300
   - Suggested value for AC8xx is 65535
   - Suggested value for MC87xx is 65535 */
   ULONG nTcpWindowSize;

   /*! Global TCP window size */
   ULONG	nTcpWindowSizeGlobal;

   /*! Maximum global TCP window size */
   ULONG	nTcpWindowSizeGlobalMax;

   /*!	Set to true to enable Selective Acks, false otherwise.  Modification 
   will be done globally and will affect all interfaces on the OS. */
   bool bSackOpts;	

   /*! Fast re-transmission and recovery.  Modification will be done globally 
   and will affect all interfaces on the OS. */
   ULONG nTcpMaxDupAcks;

   /*! TCP RFC 1323 Options*/
   ULONG	nTcp1323Opts;

   /*! Maximum TCP connection retransmissions */
   ULONG	nTcpMaxConnectRetransmissions;
};
#define SWI_STRUCT_DEFINED
#endif

///////////////////////////////////////////////////////////////////////////////
///
/// This function is called to optimize Window's TCP stack to improve
///	wireless transfer performance with the modem.  
///
/// This request modifies Window's registry values.
///			
/// \param	[I] lpstrInterfaceID
///				NDIS Interface GUID
///
///			[I] sTcpOpt:
///				SWI_STRUCT_TcpOpt structure containing TCP optimizations
///
/// \return	See ::SWI_RCODE for additional information.
///	    
/// \sa SWI_STRUCT_TcpOpt
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiOptimizeTcp(LPCTSTR lpstrInterfaceID, SWI_STRUCT_TcpOpt sTcpOpt);

///////////////////////////////////////////////////////////////////////////////
///
/// This function is called to retrieve the Window's TCP stack optimization
/// values.    
///			
/// \param	[I] lpstrInterfaceID
///				NDIS Interface GUID
///
///			[O] sTcpOpt:	
///				Structure to store TCP optimization settings
///
/// \return	See ::SWI_RCODE for additional information.
///
/// \sa SWI_STRUCT_TcpOpt
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiGetTcpOpt(LPCTSTR lpstrInterfaceID, SWI_STRUCT_TcpOpt &sTcpOpt);

///////////////////////////////////////////////////////////////////////////////
///
/// This function returns the configuration used by the MSM GPS to perform fixes while
/// in 2 MS-Based mode 
///			
/// \param	[O] pServerAddress
///				IPv4 address of AGPS server
///
///			[O] pServerPort:	
///				Port number of AGPS server
///
///			[I] networkMode:	
///				Network mode
///					0x00 - UMTS
///					0x01 - CDMA
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI LTEGetAGPSConfig( 
   ULONG *	pServerAddress,
   ULONG *	pServerPort,
   ULONG	networkMode);

///////////////////////////////////////////////////////////////////////////////
///
/// This function sets the default configuration used by the MSM GPS to 
/// perform MS-based fixes
///     		
/// \param	[O] serverAddress
///				IPv4 address of AGPS server
///
///			[O] serverPort:	
///				Port number of AGPS server
///
///			[I] networkMode:	
///				Network mode
///					0x00 - UMTS
///					0x01 - CDMA
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI LTESetAGPSConfig( 
   ULONG	serverAddress,
   ULONG	serverPort, 
   ULONG	networkMode);

///////////////////////////////////////////////////////////////////////////////
///
/// This function enables/disables the NMEA sentence plus mode callback function
///     		
/// \param	[I] pCallback
///				Callback function (0 = disable)
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SetNMEAPlusCallback( tFNNewNMEAPlus pCallback );

///////////////////////////////////////////////////////////////////////////////
///
/// This function initializes the API for SWIOMA-DM functionality.
/// 
/// This API must be called before invoking any other SWIOMA-DM APIs.
/// SWIOMADMShutdownApi should be called when SWIOMA-DM functionality is no
/// longer required by the application.
///     		
/// \param	None
///
///	\return	Return code
/// 
/// \sa SWIOMADMShutdownApi
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SWIOMADMInitApi();

///////////////////////////////////////////////////////////////////////////////
///
/// This function cleans up SWIOMA-DM resources.
/// 
/// This API must be called when SWIOMA-DM functionality is no
/// longer required by the application.
///     		
/// \param	None
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SWIOMADMShutdownApi();

///////////////////////////////////////////////////////////////////////////////
///
/// This function starts an SWIOMA-DM session.
/// 
/// SWIOMADMInitApi must be called first to initialize the SWIOMADM service.
///     		
/// \param	[I] sessionType
///				Type of session to initiate
///
///	\return	Return code
/// 
/// \sa SWIOMADMInitApi
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SWIOMADMSessionStart( ULONG sessionType );

///////////////////////////////////////////////////////////////////////////////
///
/// This function cancels an ongoing SWIOMA-DM session
/// 
/// SWIOMADMInitApi must be called first to initialize the SWIOMADM service.
///     
/// \param	None
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SWIOMADMSessionCancel( UINT8 sessionType);

///////////////////////////////////////////////////////////////////////////////
///
/// This function returns information related to the current (or previous
/// if no session is active) SWIOMA-DM session
/// 
/// SWIOMADMInitApi must be called first to initialize the SWIOMADM service.
///     
///			
/// \param	[I] nSessionType
///				Type of session
/// 
/// \param	[O] nSessionState
///				State of session
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SWIOMADMSessionGetInfo( 
	UINT8	nSessionType,
	UINT8	nSessionState );

///////////////////////////////////////////////////////////////////////////////
///
/// This function sends the specified SWIOMA-DM selection for the current 
/// network initiated session
/// 
/// SWIOMADMInitApi must be called first to initialize the SWIOMADM service.
///     	
/// \param	[I] userInput
///				UserInput
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SWIOMADMSelection( 
	UINT8	UserInput );

///////////////////////////////////////////////////////////////////////////////
///
/// This function gets FOTA settings
/// 
/// SWIOMADMInitApi must be called first to initialize the SWIOMADM service.
///     	
/// \param	[O] enabled
///				Enabled/Disabled
/// 
/// \param	[O] fwAutoDownload
///				FOTA Automatic Download
/// 
/// \param	[O] fwAutoUpdate
///				FOTA Automatic update
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SWIOMADMGetSettings( 
	UINT32	enabled,
	UINT8	fwAutoDownload,
	UINT8	fwAutoUpdate);

///////////////////////////////////////////////////////////////////////////////
///
/// This function sets FOTA settings
/// 
/// SWIOMADMInitApi must be called first to initialize the SWIOMADM service.
///     	
/// \param	[I] fwAutoLoad
///				FOTA Automatic Download
/// 
/// \param	[I] fwAutoUpdate
///				FOTA Automatic Update
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SWIOMADMSetSettings( 
	UINT8	fwAutoLoad, 
	UINT8	fwAutoUpdate );

///////////////////////////////////////////////////////////////////////////////
///
/// This function set enables event reporting
/// 
/// SWIOMADMInitApi must be called first to initialize the SWIOMADM service.
///     	
/// \param	None
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SWIOMADMSetEventReport( );

///////////////////////////////////////////////////////////////////////////////
///
///	SWIOMA-DM network initiated FOTA callback function
/// 
/// SWIOMADMInitApi must be called first to initialize the SWIOMADM service.
///
///	\sa SetSWIOMADMFotaCallback
///
///////////////////////////////////////////////////////////////////////////////
typedef void (SWICALLBACK * tFNSWIOMADMFota)( 
	UINT8	SessionState,   
	UINT8	UserInputReq,
	UINT16	UserInputTimeout,
	UINT32	FWDownloadSize,
	UINT32	FWDownloadComplete,
	UINT16	UpdateStatus,
	UINT8	Severity,
	UINT16	VersionLength,
	BYTE*	Version,
	UINT16	NameLength, 
	BYTE*	PackageName, 
	UINT16	DescriptionLength,
	BYTE*	Description);

///////////////////////////////////////////////////////////////////////////////
///
///	SWIOMA-DM network initiated alert callback function
/// 
/// SWIOMADMInitApi must be called first to initialize the SWIOMADM service.
///
///	\sa SetSWIOMADMFotaCallback
///
///////////////////////////////////////////////////////////////////////////////
typedef void (SWICALLBACK * tFNSWIOMADMAlert)( 
	UINT8	SessionState,   
	UINT8	UserInputReq,
	UINT16	UserInputTimeout,
	UINT16	AlertMsgLength, 
	BYTE*	AlertMsg );

///////////////////////////////////////////////////////////////////////////////
///
/// This function enables/disables the OMA-DM network initiated FOTA
/// callback function
/// 
/// SWIOMADMInitApi must be called first to initialize the SWIOMADM service.
///     	
/// \param	[I] pCallback
///				Callback function (0 = disable)
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SetSWIOMADMFotaCallback( tFNSWIOMADMFota pCallback );

///////////////////////////////////////////////////////////////////////////////
///
/// This function enables/disables the OMA-DM network initiated alert
/// callback function
/// 
/// SWIOMADMInitApi must be called first to initialize the SWIOMADM service.
///     	
/// \param	[I]	pCallback
///				Callback function (0 = disable)
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SetSWIOMADMAlertCallback( tFNSWIOMADMAlert pCallback );

///////////////////////////////////////////////////////////////////////////////
///
///	These functions activate a packet data session on an LTE device
///
/// \param	[I]	pTechnology (Optional) 
///			Technology bitmap
///
/// \param	[I]	pPrimaryDNSv4 (Optional)     
///			Primary DNS IPv4 address 
///
/// \param	[I]	pSecondaryDNSv4  (Optional)  
///			Secondary DNS IPv4 address 
///
/// \param	[I]    pPrimaryDNSv6  (Optional)    
///			Primary DNS IPv6 address 
///
/// \param	[I]	pSecondaryDNSv6 (Optional)   
///				Secondary DNS IPv6 address 
///
/// \param	[I]	pPrimaryNBNSv4 (Optional)     
///				Primary NetBIOS NS IPv4 address
///
/// \param	[I]	pSecondaryNBNSv4 (Optional)  
///				Secondary NetBIOS NS IPv4 address
///
/// \param	[I]	pAPNName (Optional)          
///				Access point name 
///
/// \param	[I]	pIPAddressv4 (Optional)      
///				Preferred assigned IPv4 address
///
/// \param	[I]	pIPAddressv6 (Optional)      
///				Preferred assigned IPv6 address
///
/// \param	[I]	pAuthentication (Optional)   
///				Authentication algorithm bitmap
///
/// \param	[I]	pUsername (Optional)         
///				Username used during authentication
///
/// \param	[I]	pPassword (Optional)         
///				Password used during authentication
///
/// \param	[O]	pSessionId 
///				The assigned session ID
///
/// \param	[O]	pFailureReason    
///				Upon call failure the failure reason provided
/// 
/// \return
///			Return code
///
//////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI StartDataSessionLTE( 
   ULONG *	pTechnology, 
   ULONG *	pPrimaryDNSv4, 
   ULONG *	pSecondaryDNSv4, 
   ULONG *	pPrimaryNBNSv4, 
   ULONG *	pSecondaryNBNSv4, 
   ULONG *	pPrimaryDNSv6, 
   ULONG *	pSecondaryDNSv6,
   CHAR *	pAPNName, 
   ULONG *	pIPAddressv4, 
   ULONG *	pIPAddressv6,
   ULONG *	pAuthentication, 
   CHAR *	pUsername, 
   CHAR *	pPassword,
   ULONG *	pSessionId,
   ULONG *	pFailureReason );

//////////////////////////////////////////////////////////////////////////
///
///	This function returns the current packet data session IP address(es)
///
///	\param	[O] pIPAddressv4      
///				Assigned IPv4 address
/// 
///	\param	[O] pIPAddressv6      
///				Assigned IPv6 address
///
/// \param  [O] pIPv6prefixlen    
///				IPv6 prefix length in number of bits
///
/// \param	Return code
///
//////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI GetIPAddressLTE( 
    ULONG *		pIPAddressv4,
    USHORT *	pIPAddressv6,
    BYTE *		pIPv6prefixlen);

// Current data bearer technology callback function
typedef void (SWICALLBACK * tFNSwiCurrentDataBearer)( 
	ULONG NetworkType, 
	ULONG RatMask, 
	ULONG SoMask );

//////////////////////////////////////////////////////////////////////////
///
///	This function enables/disables the current data bearer status callback function
///
///	\param	[I] pCallback      
///				Callback function (0 = disable)
///
/// \param	Return code
///
//////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiSetCurrentDataBearerCallback( tFNSwiCurrentDataBearer pCallback );

//////////////////////////////////////////////////////////////////////////
///
///	This function returns the current data bearer technology
///
///	\param	[O] pNetworkType     
///				Current network type of data bearer
///					0x00 ?UNKNOWN
///					0x01 ?3GPP2
///					0x02 ?3GPP
/// 
///	\param	[O] pRatMask     
///				RAT mask to indicate the type of technology (RAT
///				mask value of zero indicates that this field is ignored)
///					0x00 ?DO_NOT_CARE
///				CDMA RAT mask
///					0x01 ?CDMA_1X
///					0x02 ?EVDO_REV0
///					0x04 ?EVDO_REVA
///				UMTS RAT mask
///					0x01 ?WCDMA
///					0x02 ?GPRS
///					0x04 ?HSDPA
///					0x08 ?HSUPA
///					0x10 ?EDGE
///					0x20 ?LTE
///
/// \param  [O] pSoMask    
///				SO mask to indicate the SO or type of application
///				(SO mask value of zero indicates that this field is ignored)
///					0x00 ?DO_NOT_CARE
///				CDMA 1X SO mask
///					0x01 ?CDMA_1X_IS95
///					0x02 ?CDMA_1X_IS2000
///					0x04 ?CDMA_1X_IS2000_REL_A
///				CDMA EV-DO Rev A SO mask
///					0x01 ?EVDO_REVA_DPA
///					0x02 ?EVDO_REVA_MFPA
///					0x04 ?EVDO_REVA_EMPA
///					0x08 ?EVDO_REVA_EMPA_EHRPD
///
/// \param	Return code
///
//////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiGetCurrentDataBearerTechnology( 
	ULONG*	pNetworkType,
	ULONG*	pRatMask,
	ULONG*	pSoMask);

//////////////////////////////////////////////////////////////////////////
///
///	This function switches the modem from application mode to boot & hold mode
///
///	\param	None
///
/// \param	Return code
///
//////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwitchModemToBootMode();

//////////////////////////////////////////////////////////////////////////
///
/// This function sets the specified RF SAR state.
///
/// \param  [I] RfSarState
///             RF SAR state
///                 0x0: RF_STATE_DEFAULT
///                 0x1: RF_STATE_1
///                 0x2: RF_STATE_2
///                 0x3: RF_STATE_3
///                 0x4: RF_STATE_4
///                 0x5: RF_STATE_5
///                 0x6: RF_STATE_6
///                 0x7: RF_STATE_7
///                 0x8: RF_STATE_8
///
/// \param  Return Code
///
//////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SetRfSarState( ULONG RfSarState );

//////////////////////////////////////////////////////////////////////////
///
/// This function gets the specified RF SAR state.
///
/// \param  [O] pRfSarState
///             RF SAR state
///                 0x0: RF_STATE_DEFAULT
///                 0x1: RF_STATE_1
///                 0x2: RF_STATE_2
///                 0x3: RF_STATE_3
///                 0x4: RF_STATE_4
///                 0x5: RF_STATE_5
///                 0x6: RF_STATE_6
///                 0x7: RF_STATE_7
///                 0x8: RF_STATE_8
///
/// \param  Return Code
///
//////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI GetRfSarState( ULONG * pRfSarState );

//////////////////////////////////////////////////////////////////////////
///
/// This function returns information regarding the signal strength
///
/// \param  [O] pCdmaRssi
///				Received RSSI in dBm (signed value); a value of -125 dBm
///				or lower is used to indicate No Signal.  0 (zero) indicate
///				value was not available.
/// 
/// \param	[O] pCdmaEcio
///				ECIO value representing negative 0.5 dBm increments, i.e.,
///				2 means -1 dBm (14 means -7 dBm, 63 means -31.5 dBm). 
///				0 (zero) indicates value was not available.
/// 
/// \param  [O] pHdrRssi
///				Received RSSI in dBm (signed value); a value of -125 dBm
///				or lower is used to indicate No Signal.  0 (zero) indicate
///				value was not available.
/// 
/// \param	[O] pHdrEcio
///				ECIO value representing negative 0.5 dBm increments, i.e.,
///				2 means -1 dBm (14 means -7 dBm, 63 means -31.5 dBm).
///				0 (zero) indicates value was not available.
/// 
/// \param  [O] pHdrSinr
///				SINR level – SINR is only applicable for 1xEV-DO; valid
///				levels are 0 to 8 where maximum value for
///				• 0 – SINR_LEVEL_0 is -9 dB
///				• 1 – SINR_LEVEL_1 is -6 dB
///				• 2 – SINR_LEVEL_2 is -4.5 dB
///				• 3 – SINR_LEVEL_3 is -3 dB
///				• 4 – SINR_LEVEL_4 is -2 dB
///				• 5 – SINR_LEVEL_5 is +1 dB
///				• 6 – SINR_LEVEL_6 is +3 dB
///				• 7 – SINR_LEVEL_7 is +6 dB
///				• 8 – SINR_LEVEL_8 is +9 dB
///				• 255 indicate value was not available.
/// 
/// \param	[O] pHdrIo
///				Received IO in dBm; IO is only applicable for 1xEV-DO.
///				0 (zero) indicates value was not available.
///
/// \param  [O] pGsmRssi
///				Received RSSI in dBm (signed value); a value of -125 dBm
///				or lower is used to indicate No Signal.  0 (zero) indicate
///				value was not available.
/// 
/// \param  [O] pWcdmaRssi
///				Received RSSI in dBm (signed value); a value of -125 dBm
///				or lower is used to indicate No Signal.  0 (zero) indicate
///				value was not available.
/// 
/// \param	[O] pWcdmaEcio
///				ECIO value representing negative 0.5 dBm increments, i.e.,
///				2 means -1 dBm (14 means -7 dBm, 63 means -31.5 dBm). 
///				0 (zero) indicates value was not available.
///
/// \param  [O] pLteRssi
///				Received RSSI in dBm (signed value); a value of -125 dBm
///				or lower is used to indicate No Signal.  
///				0 (zero) indicate value was not available.
/// 
/// \param	[O] pLteRsrq
///				RSRQ value in dB (signed integer value) as measured by
///				L1; valid range is -3 to -20 (-3 means -3 dB, -20 means -20 dB).
///				0 (zero) indicates value was not available.
/// 
/// \param  [O] pLteRsrp
///				Current Reference Signal Received Power (RSRP) in dBm
///				as measured by L1; valid range is -44 to -140 (-44 means
///				-44 dBm, -104 means -140 dBm).
///				0 (zero) indicate value was not available.
/// 
/// \param	[O] pLteSnr
///				SNR in dB10 scale.  250=+30dB, 0=-20dB (y = 0.2x - 20)
///
/// \param  Return Code
///
//////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiGetSignalStrengthInfo( 
	INT8*	pCdmaRssi,
	ULONG*	pCdmaEcio,
	INT8*	pHdrRssi,
	ULONG*	pHdrEcio,
	ULONG*	pHdrSinr,
	ULONG*	pHdrIo,
	INT8*	pGsmRssi,
	INT8*	pWcdmaRssi,
	ULONG*	pWcdmaEcio,
	INT8*	pLteRssi,
	INT8*	pLteRsrq,
	INT16*	pLteRsrp,
	UINT8*	pLteSnr
	);

///////////////////////////////////////////////////////////////////////////////
///
/// This function enables/disables the signal strength info callback function
///     		
/// \param	[I] pCallback
///				Callback function (0 = disable)
///
///	\return	Return code
///
///////////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiSetSignalStrengthInfoCallback( tFNSwiSignalStrengthInfo pCallback );

//////////////////////////////////////////////////////////////////////////
///
/// This function gets the APN information from a configured profile
///
/// \param  [I] nProfileType
///             Identifies the type of profile
///               0x00 – 3GPP
///               0x01 – 3GPP2
///
/// \param  [I] nProfileIndex
///             Index of the configured profile from which settings are read
///
/// \param  [I] nLength
///             Maximum number of characters (including NULL terminator)
///             that APN name array can contain.
///
/// \param  [O] pApn
///             Access point name.  NULL-terminated string.
///
/// \return Return Code
///
//////////////////////////////////////////////////////////////////////////
SWIIMPORT ULONG SWICMAPI SwiGetApn(
	BYTE nProfileType, 
	BYTE nProfileIndex, 
	BYTE nLength, 
	CHAR * pApn );


#ifdef __cplusplus
   };
#endif
/*@}*/ // End of WCM group
#endif // __SWIWWANCMAPI_H__
