/*****************************************************************************
 * Copyright (C) Gemalto M2M GmbH
 *****************************************************************************
 * Project: 3G-RIL-Driver
 *****************************************************************************
 * Author : Wireless Modules PD SW1
 *****************************************************************************
 * $Workfile: Y:/z_ms-d/src/working/Quinn/RilDrv/sim_access.h $
 * $Revision: /main/ms-d/3 $
 *     $Date: 2012-02-14 14:58:00 $
 *   $Author: ctna0256 $
 *****************************************************************************
 * Target:
 *  Microsoft Windows Mobile 6.x
 *****************************************************************************
 * Description:
 *  Cinterion 3G RIL
 *****************************************************************************
 *
 * $Log: Y:/z_ms-d/src/working/Quinn/RilDrv/sim_access.h$ 
 * 
 * /main/ms-d/3   2012-02-14 14:58:00   ctna0256 
 * Improved comments
 *
 * /main/ms-d/2   2012-02-09 16:44:17   ctna0256
 * Check for missed SMS with AT+CRSM on EHS5, small bug fixes
 *
 * /main/ms-d/1   2012-02-03 13:58:25   ctna0256
 * Phonebook and SIM access now in separate files
 *
 *
 *
*/

//////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2012 Gemalto M2M GmbH
//
// Version: 1.0
// Date:    dummy
//
//////////////////////////////////////////////////////////////////////////////

// Used by: g_nSIMType
enum SIMTYPE {
    SIMTYPE_UNKNOWN,
    SIMTYPE_NOT_INSERTED,
    SIMTYPE_2G_SIM,
    SIMTYPE_3G_SIM
};

// Holds type of currently active SIM card (2G/3G)
extern SIMTYPE g_nSIMType;


HRESULT RILDrv_SendSimCmd(DWORD dwParam, const BYTE* lpbCommand, DWORD dwSize);
HRESULT RILDrv_SendRestrictedSimCmd(DWORD dwParam, DWORD dwCommand, const RILSIMCMDPARAMETERS* lpParameters,
                                    const BYTE* lpbData, DWORD dwSize);
HRESULT RILDrv_GetSimRecordStatus(DWORD dwParam, DWORD dwFileID);
HRESULT RILDrv_GetSimToolkitProfile(DWORD dwParam);
HRESULT RILDrv_SetSimToolkitProfile(DWORD dwParam, const BYTE* lpbProfile, DWORD dwSize);
#ifdef RILDRV_CE6
HRESULT RILDrv_SendSimToolkitEnvelopeCmd(DWORD dwParam, const BYTE* lpbCommand, DWORD dwSize);
#endif
HRESULT RILDrv_SendSimToolkitCmdResponse(DWORD dwParam, const RILSIMTOOLKITRSP* pRsp, LPBYTE pDetails, const DWORD dwDetailSize);
HRESULT RILDrv_SendSimToolkitEventDownload(DWORD dwParam, const DWORD dwEvent, LPBYTE pData, const DWORD dwDataSize);
HRESULT RILDrv_TerminateSimToolkitSession(DWORD dwParam, DWORD dwCause);

DWORD WINAPI ReadECCFilesThread(LPVOID pVoid);
BOOL  IsForbiddenSIMFile(DWORD dwSIMFile);
char Nibble2Digit(BYTE bNibble);
BOOL IsElementarySimFile(DWORD dwFileID);

HRESULT ParseSendRestrictedSimCmd(LPCSTR szRsp, void*& pBlob, UINT& cbBlob, LPVOID pParam);
HRESULT ParseNumbersOfRecordsFromSimRecordStatus2G(LPCSTR szRsp, void*& pBlob, UINT& cbBlob, LPVOID pParam);
HRESULT ParseNumbersOfRecordsFromSimRecordStatus3G(LPCSTR szRsp, void*& pBlob, UINT& cbBlob, LPVOID pParam);
HRESULT ParseGetSimRecordStatus(LPCSTR szRsp, void*& pBlob, UINT& cbBlob, LPVOID pParam);
HRESULT ParseSimGetResponseInternal(LPCSTR szRsp, void*& pBlob, UINT& cbBlob, LPVOID pParam);

