/*****************************************************************************
 * Copyright (C) Gemalto M2M GmbH
 *****************************************************************************
 * Project: IMC-RIL-Driver
 *****************************************************************************
 * Author : Wireless Modules RD SW A2
 *****************************************************************************
 * $Workfile: Y:/z_ms-d/src/working/Quinn/RilDrv/ModuleInitCmds.cpp $
 * $Revision: /main/ms-d/27 $
 *     $Date: 2013-05-21 15:51:35 $
 *   $Author: pmackent $
 *****************************************************************************
 * Target:
 *  Microsoft Windows Mobile 5.0
 *****************************************************************************
 * Description:
 *  Gemalto IMC RIL
 *****************************************************************************
 *
 * $Log: Y:/z_ms-d/src/working/Quinn/RilDrv/ModuleInitCmds.cpp$ 
 * 
 * /main/ms-d/27   2013-05-21 15:51:35   pmackent 
 * Add BGS5 as known module for testing purposes
 *
 * /main/ms-d/26   2013-03-04 13:19:38   pmackent
 * Adaptions for EHS5 1.300
 *
 * /main/ms-d/25   2012-11-23 16:49:25   pmackent
 * Added missing init commands for PVS8 and AHS3
 *
 * /main/ms-d/24   2012-04-18 13:46:58   ctna0256
 * Introducing PVS8
 * Implementing CDMA-SMS
 * Various CDMA enhancements
 *
 * /main/ms-d/23   2012-02-24 14:20:50   ctna0256
 * Extra initialization for data port on EHS5
 *
 * /main/ms-d/22   2012-01-31 16:38:33   ctna0256
 * Added support for EHS5
 *
 * /main/ms-d/21   2012-01-04 15:36:48   ctna0256
 * Outsource XML configuration to external application.
 * Improve CDMA configuration mode.
 *
 * /main/ms-d/20   2012-01-03 15:46:36   ctna0256
 * Introduce PXS8
 *
 * /main/ms-d/19   2011-03-17 10:07:39   ctna0256
 * Abort dial attempt for emergency calls after timeout (IPIS100070746)
 *
 * /main/ms-d/18   2010-05-28 14:23:45   ctna0256
 * Introducing PH8
 *
 * /main/ms-d/17   2010-05-05 13:13:45   ctna0256
 * Support EU3 (for Pre-PH8 testing)
 *
 * /main/ms-d/16   2010-02-01 10:22:06   ctna0256
 * Moved SCKS setting to pre-PIN initialization
 *
 * /main/ms-d/15   2008-08-22 10:24:18   ctna0256
 * Set Cinterion copyright text
 *
 * /main/ms-d/14   2008-08-21 09:34:40   ctna0256
 * Prepared for new disclaimer handling
 *
 * /main/ms-d/13   2008-01-18 09:50:46   mp49210
 * Use DTR setting to ensure end of online mode
 *
 * /main/ms-d/12   2007-10-11 16:15:18   mp49210
 * Earlier initialization of CMEE
 *
 * /main/ms-d/11   2007-08-02 11:21:36   mp49210
 * Introduction of HC28
 *
 * /main/ms-d/10   2007-03-30 11:58:36   mp49210
 * Remove unnecessary comment
 *
 * /main/ms-d/9   2007-02-26 16:05:35   mp49210
 * Activate AT+CREG=2 location update information
 *
 * /main/ms-d/8   2007-01-03 17:04:22   mp49210
 * Replace +CIEV: sounder with +CIEV: audio
 *
 * /main/ms-d/7   2006-12-20 11:30:38   mp49210
 * Introduction of AT^SCKS
 *
 * /main/ms-d/6   2006-12-18 11:16:32   wm36264
 * Added correct modem signal control commands
 *
 * /main/ms-d/5   2006-11-17 09:35:04   mp49210
 * Most init commands are working now
 *
 * /main/ms-d/4   2006-11-09 14:24:44   mp49210
 * Quinn specific feature: selction of 2G / 3G network
 *
 * /main/ms-d/3   2006-11-03 08:25:55   mp49210
 * Removed AT/Q3
 *
 * /main/ms-d/2   2006-11-02 14:55:34   mp49210
 * Updated init sequence for current module capabilities
 *
 * /main/ms-d/1   2006-10-25 16:53:49   wm36264
 * First transformation from classic RIL
 *
*/

//////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2008 Gemalto M2M GmbH
// Copyright (C) 2006-2008 Siemens AG
//
// Version: 1.0
// Date:    dummy
//
//////////////////////////////////////////////////////////////////////////////

#include "precomp.h"

//////////////////////////////////////////////////////////////////////////////
//
// This file contains all arrays with the AT commands for module
// initialization.
// The first entry in each array corresponding to MODEMTYPE_UNKNOWN defines
// the default initialization. Use NULL instead of initialization strings for
// modules where the default intialization shall be used.
//
//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////
//
//  V e r y    f i r s t    p o r t    i n t i a l i z a t i o n
//
//////////////////////////////////////////////////////////////////////////////

#define NUMBER_OF_PREINIT_CMDS      (sizeof(g_szPreInitString) / sizeof(g_szPreInitString[0]))

const char* g_szPreInitString[] = { "ATE0;+CMEE=1\r" };

//////////////////////////////////////////////////////////////////////////////
//
//  P r e    -    P I N   I n t i a l i z a t i o n
//
//////////////////////////////////////////////////////////////////////////////

#define NUMBER_OF_PREPIN_ENTRIES      2

INITSTRING_DATA g_rgisdModuleInit[NUMBER_OF_SUPPORTED_MODEMTYPES][NUMBER_OF_PREPIN_ENTRIES] = {
  { // Default initialization (URCs call and audio are needed for emergency calls before PIN)
	{ "E0V1;+CSCS=\"UCS2\"", CMDOPT_INIT, HCCMD_STANDARD },
	{ "+CMEE=1", CMDOPT_INIT | CMDOPT_GENERALINIT, HCCMD_STANDARD },
  }, // End of Default initialization
  { // HC25 initialization
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
  }, // End of HC25 initialization
  { // HC28 initialization
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
  }, // End of HC25 initialization
  { // EU3 initialization
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
  }, // End of EU3 initialization
  { // PH8 initialization
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
  }, // End of PH8 initialization
  { // PXS8 initialization
    { "E0V1", CMDOPT_INIT, HCCMD_STANDARD },
    { "^SIND=audio,1;^SIND=call,1", CMDOPT_INIT | CMDOPT_GENERALINIT, HCCMD_STANDARD },
  }, // End of PXS8 initialization
  { // PVS8 initialization
    { "E0V1", CMDOPT_INIT, HCCMD_STANDARD },
    { "^SIND=audio,1;^SIND=call,1", CMDOPT_INIT | CMDOPT_GENERALINIT, HCCMD_STANDARD },
  }, // End of PVS8 initialization
  { // EHS5 initialization
    { "E0V1;+CSCS=\"UCS2\"", CMDOPT_INIT, HCCMD_STANDARD },
    { "+CMEE=1", CMDOPT_INIT | CMDOPT_GENERALINIT, HCCMD_STANDARD },
  }, // End of EHS5 initialization
  { // BGS5 initialization
    { "E0V1;+CSCS=\"UCS2\"", CMDOPT_INIT, HCCMD_STANDARD },
    { "+CMEE=1", CMDOPT_INIT | CMDOPT_GENERALINIT, HCCMD_STANDARD },
  }, // End of BGS5 initialization
  { // AHS3 initialization
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
  }, // End of AHS3 initialization
  { // EHS8 initialization
    { "E0V1;+CSCS=\"UCS2\"", CMDOPT_INIT, HCCMD_STANDARD },
    { "+CMEE=1", CMDOPT_INIT | CMDOPT_GENERALINIT, HCCMD_STANDARD },
  }, // End of EHS8 initialization
  { // PDS5 initialization
    { "E0V1;+CSCS=\"UCS2\"", CMDOPT_INIT, HCCMD_STANDARD },
    { "+CMEE=1", CMDOPT_INIT | CMDOPT_GENERALINIT, HCCMD_STANDARD },
  }, // End of PDS5 initialization
  { // PDS8 initialization
    { "E0V1;+CSCS=\"UCS2\"", CMDOPT_INIT, HCCMD_STANDARD },
    { "+CMEE=1", CMDOPT_INIT | CMDOPT_GENERALINIT, HCCMD_STANDARD },
  }, // End of PDS8 initialization
};

//////////////////////////////////////////////////////////////////////////////
//
//  P o s t    -    P I N    I n t i a l i z a t i o n
//
//////////////////////////////////////////////////////////////////////////////

#define NUMBER_OF_POSTPIN_ENTRIES     3

INITSTRING_DATA g_szUnlockedInitString[NUMBER_OF_SUPPORTED_MODEMTYPES][NUMBER_OF_POSTPIN_ENTRIES] = {
  { // Default initialization
    { "ATE0V1Q0X4&C1&D2\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0X4&C1&D2\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of Default initialization
  { // HC25 initialization
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
  }, // End of HC25 initialization
  { // HC28 initialization
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
  }, // End of HC28 initialization
  { // EU3 initialization
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
  }, // End of EU3 initialization
  { // PH8 initialization
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
  }, // End of PH8 initialization
  { // PXS8 initialization
    { "ATE0V1Q0X4&C1&D2&S1\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "AT+CREG=2;^SREG=1;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
    { NULL, 0, HCCMD_INVALID },
  }, // End of PXS8 initialization
  { // PVS8 initialization
    { "ATE0V1Q0X4&C1&D2&S1\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "AT^SREG=1;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
    { NULL, 0, HCCMD_INVALID },
  }, // End of PVS8 initialization
  { // EHS5 initialization
    { "ATE0V1Q0X4&C1&D2\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0X4&C1&D2\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of EHS5 initialization
  { // BGS5 initialization
    { "ATE0V1Q0X4&C1&D2\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0X4&C1&D2\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of BGS5 initialization
  { // AHS3 initialization
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
    { NULL, 0, HCCMD_INVALID },
  }, // End of AHS3 initialization
  { // EHS8 initialization
    { "ATE0V1Q0X4&C1&D2\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0X4&C1&D2\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of EHS8 initialization
  { // PDS5 initialization
    { "ATE0V1Q0X4&C1&D2\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0X4&C1&D2\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of PDS5 initialization
  { // PDS8 initialization
    { "ATE0V1Q0X4&C1&D2\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0X4&C1&D2\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of PDS8 initialization
  { // ELS6 initialization
    { "ATE0V1Q0&C1&D2\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0&C1&D2\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of ELS6 initialization
  { // ELS6 initialization
    { "ATE0V1Q0&C1&D2\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0&C1&D2\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of ELS6 initialization
  { // ELS6 initialization
    { "ATE0V1Q0&C1&D2\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0&C1&D2\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of ELS6 initialization
  { // ELS6 initialization
    { "ATE0V1Q0&C1&D2\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0&C1&D2\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of ELS6 initialization
  { // PLS62 initialization
    { "ATE0V1Q0&C1&D2\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0&C1&D2\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of PLS62 initialization
  { // ELS81_E initialization ATE0V1Q0&C1&D2
    { "ATE0V1Q0\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of ELS81_E initialization
  { // ELS81_US initialization
    { "ATE0V1Q0\r", CMDOPT_NONE, HCCMD_STANDARD },
    { "ATE0V1Q0\r", CMDOPT_NONE, HCCMD_DATAPORT_ONLY},
    { "AT+CREG=2;+CMGF=0\r", CMDOPT_NONE, HCCMD_STANDARD },
  }, // End of ELS81_US initialization
};

