BlueFlashTool.h
3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// 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 64
typedef enum
{
BLUE_TYPE_EAR,
BLUE_TYPE_USB,
BLUE_TYPE_MAX
}BLUE_DEVICE_TYPE;
typedef enum
{
BLUE_THREAD_STOP,
BLUE_THREAD_READY,
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_)