-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCFileAppLayer.h
More file actions
57 lines (50 loc) · 1.65 KB
/
CFileAppLayer.h
File metadata and controls
57 lines (50 loc) · 1.65 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
#pragma once
#if !defined(AFX_FILELAYER_H__D67222B3_1B00_4C77_84A4_CEF6D572E181__INCLUDED_)
#define AFX_FILELAYER_H__D67222B3_1B00_4C77_84A4_CEF6D572E181__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "BaseLayer.h"
#include <iostream>
#include <fstream>
#include <stdexcept>
#include <Windows.h>
class CFileAppLayer
: public CBaseLayer
{
CString FilePath;
CFile WriteFile;
CProgressCtrl* p_Progress;
private:
inline void ResetHeader();
BOOL bSEND;
CString GetFilepath();
public:
CFileAppLayer(char* pName);
virtual ~CFileAppLayer();
unsigned char filename[512];
typedef struct _FILE_APP
{
unsigned long fapp_totlen; // 총 길이
unsigned short fapp_type; // 데이터 타입
unsigned char fapp_msg_type; // 메시지 종류
unsigned char unused; // 사용 안함
unsigned long fapp_seq_num; // fragmentation 순서
unsigned char fapp_data[FAPP_DATA_SIZE];
} FILE_APP, * LPFILE_APP;
BOOL Send(unsigned char* frame, int size);
BOOL Receive(unsigned char* ppayload);
void SetFilepath(CString Path);
static UINT F_Sendthr(LPVOID Filepath);
void SetProgressCtrl(CProgressCtrl* p);
static BOOL DoFragmentation_f(CFileAppLayer* FileApplayer,HANDLE hfile,DWORD Filesize);
static UINT FileThread(LPVOID pParam);
protected:
FILE_APP m_sHeader;
enum {
DATA_TYPE_BEGIN = 0x00,
DATA_TYPE_CONT = 0x01,
DATA_TYPE_END = 0x02
};
};
#endif // !defined(AFX_FILELAYER_H__D67222B3_1B00_4C77_84A4_CEF6D572E181__INCLUDED_)