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

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

// Some special SIM files, for detailed information refer to GSM 11.11.
#define SIM_EF_SPN      0x6F05
#define SIM_EF_ECC      0x6FB7
#define SIM_EF_FDN      0x6F3B
#define SIM_EF_EXT2     0x6F4B

//
// Phonebook storage locations
//
static const LPCSTR g_rgszPBLocations[] =
{
    "",             // RIL_PBLOC_UNKNOWN
    "EN",           // RIL_PBLOC_SIMEMERGENCY
    "FD",           // RIL_PBLOC_SIMFIXDIALING
    "LD",           // RIL_PBLOC_SIMLASTDIALING
    "ON",           // RIL_PBLOC_OWNNUMBERS
    "SM",           // RIL_PBLOC_SIMPHONEBOOK
};
#define NUM_PBLOCS     (sizeof(g_rgszPBLocations) / sizeof(LPCSTR))

#define MISC_CMDBUF_LENGTH_PB    (MAX_ATCMD_LEN)
// We do not need these calculations: any string from or to the AT interface will not exceed MAX_ATCMD_LEN character
//#define MISC_CMDBUF_LENGTH_PB    (MAX_PATH + MAXLENGTH_ADDRESS + MAXLENGTH_PHONEBOOKTEXT)
//#define MISC_CMDBUF_LENGTH_COST  (2 * MAX_PATH + 3 * MAXLENGTH_PASSWORD + MAXLENGTH_CURRENCY)
#define MISC_ALLOC_NUMBER        16

extern DWORD g_dwCurrentPhoneBook;

HRESULT RILDrv_GetPhonebookOptions(DWORD dwParam);
HRESULT RILDrv_SetPhonebookOptions(DWORD dwParam, const RILPHONEBOOKINFO* lpPhonebookInfo);
HRESULT RILDrv_ReadPhonebookEntries(DWORD dwParam, DWORD dwStartIndex, DWORD dwEndIndex);
HRESULT RILDrv_WritePhonebookEntry(DWORD dwParam, const RILPHONEBOOKENTRY* lpEntry);
HRESULT RILDrv_DeletePhonebookEntry(DWORD dwParam, DWORD dwIndex);

HRESULT ParseGetPhonebookOptions(LPCSTR szRsp, void*& pBlob, UINT& cbBlob, LPVOID pParam);

void ClearFDPBCache(void);

HRESULT ParseGetPhonebookOptions(LPCSTR szRsp, void*& pBlob, UINT& cbBlob, LPVOID pParam);

