
/***************************************************************************
**
**    $Header:   D:/ECB2S/SRC/LOG/EPSETUP/EPSETUP.CPP   1.0.1.1.1.5   17 Apr 1997 16:21:40   ZJRD  $  
**
**    $Log:   D:/ECB2S/SRC/LOG/EPSETUP/EPSETUP.CPP  $
** 
**    Rev 1.0.1.1.1.5   17 Apr 1997 16:21:40   ZJRD
** No change.
** 
**    Rev 1.0.1.1.1.4   16 Apr 1997 11:02:14   ZJRD
** No change.
** 
**    Rev 1.0.1.1.1.3   10 Apr 1997 15:53:02   ZJRD
** 2.09F
** 
**    Rev 1.0.1.1.1.1   03 Apr 1997 15:31:50   ZJRD
** No change.
** 
**    Rev 1.0.1.1.1.0   28 Mar 1997 10:35:32   ZJRD
** easy pack sld 2.09d
** 
**    Rev 1.0.1.0   19 Mar 1997 11:45:54   ZJRD
** No change.
** 
**    Rev 1.0   12 Mar 1997 14:59:32   ZJRD
** Initial revision.
** 
**    Rev 1.7.1.0.1.2   09 Dec 1996 10:23:36   ZJRD
** EasyPack/SLD Version 2.0P
** 
**    Rev 1.7.1.0.1.0   11 Nov 1996 13:03:20   ZJRD
** EasyPack/SLD Version 2.01
** 
**    Rev 1.7.1.4   09 Sep 1996 13:32:04   ZJRD
** No change.
** 
**    Rev 1.7.1.3   05 Sep 1996 11:38:52   ZJRD
** No change.
** 
**    Rev 1.7.1.2   02 Sep 1996 10:03:30   ZJRD
** No change.
** 
**    Rev 1.7.1.1   28 Aug 1996 15:56:26   ZJRD
** No change.
** 
**    Rev 1.7.1.0   12 Aug 1996 11:03:16   ZJRD
** EasyPack/SLD Version 1.98
** 
**    Rev 1.5   05 Jun 1996 15:00:20   ZJRD
** No change.
** 
**    Rev 1.4   29 May 1996 09:41:50   ZJRD
** No change.
** 
**    Rev 1.3   16 May 1996 09:11:24   ZJRD
** No change.
** 
**    Rev 1.2   10 May 1996 09:19:24   ZJRD
** No change.
** 
**    Rev 1.1   02 May 1996 10:33:26   ZJRD
** EasyPack/SLD Version 1.92
** 
**    Rev 1.6   18 Apr 1996 13:06:32   Shirley
** No change.
** 
**    Rev 1.5   12 Apr 1996 10:45:30   Shirley
** EasyPack/SLD Version 1.90
** 
**    Rev 1.3   15 Feb 1996 09:00:48   Shirley
** No change.
** 
**    Rev 1.2   12 Feb 1996 14:12:50   Shirley
** No change.
** 
**    Rev 1.1   06 Feb 1996 15:39:02   Shirley
** No change.
** 
**    Rev 1.0   06 Feb 1996 13:53:32   Shirley
** Initial revision.
** 
**
****************************************************************************/

/////////////////////////////////////////////////////////////////////////////
//
//  File name:  EPSETUP.CPP
//
//  Description:The implement file of the class CEpsetupApp
//
//  Author:     Roger Zhang
//  Date:       02/01/96
//
//  Modification:
//
//      1. 02/01/96, Ver 0.1
//
//
//  Copyright (C) 1996 Microtek International. All rights reserved.
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "epsetup.h"

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

extern unsigned char *inputStream;  //[MAX_COMM_BUFF];
extern unsigned char *outputStream; //[512];

extern void CommDlg(void);	

BOOL bNewFrankEric(FALSE);
/////////////////////////////////////////////////////////////////////////////
// CEpsetupApp

BEGIN_MESSAGE_MAP(CEpsetupApp, CWinApp)
	//{{AFX_MSG_MAP(CEpsetupApp)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
	// Standard file based document commands
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CEpsetupApp construction

CEpsetupApp::CEpsetupApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}

CEpsetupApp::~CEpsetupApp()
{
	if(m_pTheCom)
		delete m_pTheCom;
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CEpsetupApp object

CEpsetupApp NEAR theApp;

/////////////////////////////////////////////////////////////////////////////
// CEpsetupApp initialization
extern STATUS AbiGetFwId(UCHAR *uchMajor,  UCHAR *uchMinor);
BOOL CEpsetupApp::InitInstance()
{
    ::inputStream = new unsigned char [2048];
    ::outputStream = new unsigned char[512]; 
	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

	SetDialogBkColor();        // Set dialog background color to gray
	LoadStdProfileSettings();  // Load standard INI file options (including MRU)

	if (m_lpCmdLine[0] != '\0')
	{
		// TODO: add command line processing here
	}
    
    m_pTheCom = new CWinSerialPICAgreeSetup;
    if (NULL == m_pTheCom) return FALSE;
    
    m_bCanTimer = TRUE;
    
    if (!m_pTheCom->CommInit()) {
    	AfxMessageBox("EasyPack/SLD configure failure!");
    }              
    else {
    	AfxMessageBox("EasyPack/SLD configure success!");
	} 
    
     //check the fw version;                                    
 BYTE uchMajor,uchMinor;
 if (ICE_OK != AbiGetFwId(&uchMajor,&uchMinor)) {
 	AfxMessageBox("Fail in getting FW-ID");
 } else { 
 	if(uchMinor>=0x20 || (uchMajor>=0x05 && uchMajor<=0x10)) { 
 		bNewFrankEric = TRUE;
 	} else {         
 		bNewFrankEric = FALSE;
 	}
}    
	
	delete [] ::inputStream;
	delete [] ::outputStream;

	return TRUE;
}


/////////////////////////////////////////////////////////////////////////////
// CEpsetupApp commands
