forked from ilyakurdyukov/spreadtrum_flash
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Wrapper.cpp
58 lines (47 loc) · 1.81 KB
/
Wrapper.cpp
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
#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) {
CBootModeOpr* obj = static_cast<CBootModeOpr*>(handle->obj);
return obj->ConnectChannel(dwPort);
}
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();
}