⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 versioncmd.cpp

📁 m16c flash startor 源码
💻 CPP
字号:
// VersionCmd.cpp: CVersionCmd Implementation.
//
// This software can be offered for free and used as necessary to aid 
// in your program developments.
//
// RENESAS TECHNOLOGY CORPORATION, RENESAS SOLUTIONS CORPORATION,
// and related original software developers assume no responsibility 
// for any damage or infringement of any third-party's rights, originating 
// in the use of the following software.
// Please use this software under the agreement and acceptance of these conditions. 
//
// Copyright(C)1998(2003) RENESAS TECHNOLOGY CORPORATION AND RENESAS SOLUTIONS CORPORATION
// ALL RIGHTS RESERVED
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "m16cflsh.h"
#include "VersionCmd.h"
#include "VersionDlg.h"
#include "SettingCmd.h"
#include "SaveIni.h"
#include <string.h>
// #include <iostream.h>  // for VS 6.0
#include <iostream> // for VS.NET

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction.
//////////////////////////////////////////////////////////////////////

CVersionCmd::CVersionCmd()
{

}

CVersionCmd::~CVersionCmd()
{

}

BOOL CVersionCmd::exec()
{

	// Get communication object.
	CSerialComm& comObj = GetSerialComm();

	// Get result.
	BYTE send = 0xFB;
	BYTE btVER[8];
	BYTE ctVER[8];
	ctVER[0] = 'V';
	ctVER[1] = 'E';
	ctVER[2] = 'R';
	ctVER[3] = '.';
	ctVER[4] = '2';
	ctVER[5] = '.';
	ctVER[6] = '0';
	ctVER[7] = '1';
	ctVER[8] = '\0';
	comObj.Write(&send, 1);
	if(!comObj.Read(btVER, 8))
	{
		//CommError();
		//return FALSE;
		btVER[0] = 'E';
		btVER[1] = 'R';
		btVER[2] = 'R';
		btVER[3] = 'O';
		btVER[4] = 'R';
		btVER[5] = '\0';
	}
	else
	{
		btVER[8] = '\0';
	}
    if(strcmp ( (const char *)btVER, (const char *)ctVER) >0 )
	{
		// old
// 		cout << " old \n";
		std::cout << " old \n";		// for VS.NET
	}else{
		// new
// 		cout << " new \n";
		std::cout << " new \n";    //  for VS.NET

	}

	// show Firmware Version.
	CVersionDlg dlg;
	dlg.SetVer(btVER);
	dlg.DoModal();

	return TRUE;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -