BlueFlashTool.h 3.11 KB
// BlueFlashTool.h : main header file for the BLUEFLASHTOOL application
//

#if !defined(AFX_BLUEFLASHTOOL_H__4BF81738_BBD5_4BEA_BCA8_BB0255AFF8C2__INCLUDED_)
#define AFX_BLUEFLASHTOOL_H__4BF81738_BBD5_4BEA_BCA8_BB0255AFF8C2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif

#include "resource.h"		// main symbols
#include "IniFile.h"



/////////////////////////////////////////////////////////////////////////////
// CBlueFlashToolApp:
// See BlueFlashTool.cpp for the implementation of this class
//



//#define __TOPWELL_EDIT_SN_ENABLE__

#define MAX_PATH          260
#define WM_UPDATEPOS		WM_USER + 1000
// 设备数目,  最大不能超过25个
#define MAX_TOPWELL_DEVICE_NUM          12
#define BLUE_UART_INPUTBUFFER_SIZE          512

typedef enum
{
	BLUE_TYPE_EAR,
	BLUE_TYPE_USB,
	BLUE_TYPE_MAX
}BLUE_DEVICE_TYPE;


typedef enum
{
	BLUE_THREAD_STOP,
	BLUE_THREAD_DOING,
	BLUE_THREAD_MAX
}BLUE_THREAD_STATE;



#ifdef __TOPWELL_EDIT_SN_ENABLE__
typedef struct
{
	char topwell_for_search[20];
	char project_version[128] ;
	char bt_name[64];
	char optek_link_group[3];  
}topwell_SN_write_struct;
#endif




typedef struct
{
	int aBandrate;
	char bcheck;
	char cdatabit;
	char dstopbit;
	char estreambit;	
}com_config_struct;
typedef struct
{
	short ary_myComPort[BLUE_TYPE_MAX][MAX_TOPWELL_DEVICE_NUM];
	#ifdef __TOPWELL_EDIT_SN_ENABLE__
	CString FilePathUsb[MAX_TOPWELL_DEVICE_NUM];
	CString FilePathEar[MAX_TOPWELL_DEVICE_NUM];
	#else
	int firstID_binfile;
	int lastID_binfile;
	int LastEarBin;
	int LastUsbBin;
	#endif
	short int_myComPortDebug;
	com_config_struct com_config;
	#ifdef __TOPWELL_EDIT_SN_ENABLE__
	BOOL if_same_sn;
	CString SN_head;
	int SN_start;
	int SN_end;
	int SN_cur;
	BOOL if_same_btname;
	CString btname_head;
	int btname_start;
	int btname_end;
	int btname_cur;
	#endif	
}app_main_data_struct;

extern app_main_data_struct g_AppMainData;
extern CIniFile g_globalini;
BOOL QuerySingleSerialPortEx(int nPort);
void QuerySerialPortStatusEx(CWordArray& cStrAryExistPort,
		CWordArray& cStrAryNoneOpenedPort,
		CWordArray& cStrAryAlreadyOpenedPort,
		CWordArray& cStrAryNotExistPort,
		int nStartPort,int nLastPort);
bool IsExistFile(CString strAbsolutefilePath);
CString GetCurrPath();


class CBlueFlashToolApp : public CWinApp
{
public:
	CBlueFlashToolApp();
	bool LoadConfigs(void);
	bool SaveConfigs(void);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBlueFlashToolApp)
	public:
	virtual BOOL InitInstance();
	//}}AFX_VIRTUAL

// Implementation

	//{{AFX_MSG(CBlueFlashToolApp)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
	// 加载程序默认配置
};

extern CBlueFlashToolApp *g_pmainapp;
/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_BLUEFLASHTOOL_H__4BF81738_BBD5_4BEA_BCA8_BB0255AFF8C2__INCLUDED_)