forked from TomKing062/spreadtrum_flash
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWrapper.cpp
More file actions
63 lines (51 loc) · 1.94 KB
/
Wrapper.cpp
File metadata and controls
63 lines (51 loc) · 1.94 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
#include "BMPlatform.h"
#include "Wrapper.h"
ClassHandle *createClass() {
ClassHandle *handle = new ClassHandle;
handle->obj = new CBootModeOpr();
return handle;
}
void destroyClass(ClassHandle *handle) {
delete static_cast<CBootModeOpr *>(handle->obj);
delete handle;
}
BOOL call_Initialize(ClassHandle *handle) {
CBootModeOpr *obj = static_cast<CBootModeOpr *>(handle->obj);
return obj->Initialize();
}
void call_Uninitialize(ClassHandle *handle) {
CBootModeOpr *obj = static_cast<CBootModeOpr *>(handle->obj);
obj->Uninitialize();
}
int call_Read(ClassHandle *handle, UCHAR *m_RecvData, int max_len, int dwTimeout) {
CBootModeOpr *obj = static_cast<CBootModeOpr *>(handle->obj);
return obj->Read(m_RecvData, max_len, dwTimeout);
}
int call_Write(ClassHandle *handle, UCHAR *lpData, int iDataSize) {
CBootModeOpr *obj = static_cast<CBootModeOpr *>(handle->obj);
return obj->Write(lpData, iDataSize);
}
BOOL call_ConnectChannel(ClassHandle *handle, DWORD dwPort, ULONG ulMsgId, DWORD Receiver) {
CBootModeOpr *obj = static_cast<CBootModeOpr *>(handle->obj);
return obj->ConnectChannel(dwPort, ulMsgId, Receiver);
}
BOOL call_DisconnectChannel(ClassHandle *handle) {
CBootModeOpr *obj = static_cast<CBootModeOpr *>(handle->obj);
return obj->DisconnectChannel();
}
BOOL call_GetProperty(ClassHandle *handle, LONG lFlags, DWORD dwPropertyID, LPVOID pValue) {
CBootModeOpr *obj = static_cast<CBootModeOpr *>(handle->obj);
return obj->GetProperty(lFlags, dwPropertyID, pValue);
}
BOOL call_SetProperty(ClassHandle *handle, LONG lFlags, DWORD dwPropertyID, LPCVOID pValue) {
CBootModeOpr *obj = static_cast<CBootModeOpr *>(handle->obj);
return obj->SetProperty(lFlags, dwPropertyID, pValue);
}
void call_Clear(ClassHandle *handle) {
CBootModeOpr *obj = static_cast<CBootModeOpr *>(handle->obj);
obj->Clear();
}
void call_FreeMem(ClassHandle *handle, LPVOID pMemBlock) {
CBootModeOpr *obj = static_cast<CBootModeOpr *>(handle->obj);
obj->FreeMem(pMemBlock);
}