/*****************************************************************************
 * Copyright (C) Gemalto M2M GmbH
 *****************************************************************************
 * Project: IMC-RIL-Driver
 *****************************************************************************
 * Author : Wireless Modules RD SW A2
 *****************************************************************************
 * $Workfile: Y:/z_ms-d/src/working/Quinn/RilDrv/rilmain.h $
 * $Revision: /main/ms-d/11 $
 *     $Date: 2013-02-14 15:18:09 $
 *   $Author: pmackent $
 *****************************************************************************
 * Target:
 *  Microsoft Windows Mobile 5.0
 *****************************************************************************
 * Description:
 *  Gemalto IMC RIL
 *****************************************************************************
 *
 * $Log: Y:/z_ms-d/src/working/Quinn/RilDrv/rilmain.h$ 
 * 
 * /main/ms-d/11   2013-02-14 15:18:09   pmackent 
 * Fix build error on advanced notifications build option
 *
 * /main/ms-d/10   2011-05-30 09:36:19   ctna0256
 * Ignore wrong CREG:0 after CREG:3 (IPIS100073002)
 *
 * /main/ms-d/9   2010-08-25 13:03:42   ctna0256
 * USB driver 1.1.2.0 is now minimum requirement
 *
 * /main/ms-d/8   2009-01-14 11:52:32   ctna0450
 * Consider possible absence of mux driver in driver version check
 *
 * /main/ms-d/7   2009-01-14 10:50:11   ctna0450
 * Removed special handling for consecutive WaitCommEvent() calls because mux ports are properly instancable now
 *
 * /main/ms-d/6   2008-08-22 10:27:29   ctna0256
 * Set Cinterion copyright text
 *
 * /main/ms-d/5   2008-08-21 09:35:22   ctna0256
 * Prepared for new disclaimer handling
 *
 * /main/ms-d/4   2007-12-11 16:22:21   mp49210
 * Read debug options from registry at attach of rilgsm.dll
 *
 * /main/ms-d/3   2006-11-14 16:59:50   wm36264
 * Tidy up more unused stuff
 *
 * /main/ms-d/2   2006-11-14 14:39:54   wm36264
 * Disposed unused CRilEventLog
 *
 * /main/ms-d/1   2006-10-25 16:51:54   wm36264
 * First transformation from classic RIL
 *
*/

//////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2008 Gemalto M2M GmbH
// Copyright (C) 2006-2008 Siemens AG
// Copyright (C) 2003 Intrinsyc Europe Ltd.
//
// Version: 1.0
// Date:    dummy
//
//////////////////////////////////////////////////////////////////////////////

/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995-1999  Microsoft Corporation
--*/

#pragma once

// Max length of AT commands and responses
#ifdef RIL_ENABLE_SIMTK
#define MAX_ATCMD_LEN           1016
#else // RIL_ENABLE_SIMTK
#define MAX_ATCMD_LEN            816
#endif // RIL_ENABLE_SIMTK

// The min. required mux and usb driver versions
#define MIN_REQUIRED_MUX_VERSION    0x01030100
#define MIN_REQUIRED_USB_VERSION    0x01010200

// Globals
extern CRITICAL_SECTION g_csClosing;
extern HANDLE g_hCriticalErrorEvent;
extern HANDLE g_hNewDialOrHangupEvent;
extern DWORD g_dwReadyState;
extern DWORD g_dwRegStatus;
extern BOOL g_fRegStatus3detected;
extern DWORD g_dwGPRSRegStatus;
extern HANDLE hInstance;

// Functions
HRESULT RILDrv_GetNextNotification(DWORD dwParam, RILDRVNOTIFICATION* lpRilDrvNotification);
HRESULT RILDrv_GetSerialPortStatistics(DWORD dwParam, RILSERIALPORTSTATS* lpSerialPortStats);
HRESULT RILDrv_SetPowerState(DWORD dwParam, CEDEVICE_POWER_STATE PowerState);
CRilInstanceHandle* const ExtractHandle(const DWORD dwParam, BOOL bOverrideEmergency = FALSE);

void SignalCriticalError(void);
void ReadDebugOptions(void);

