Repository navigation
Expand file tree
/
Copy pathExport.cpp
More file actions
174 lines (136 loc) · 3.73 KB
/
Copy pathExport.cpp
File metadata and controls
174 lines (136 loc) · 3.73 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#include <cstdint>
#include <cstddef>
#include "SceTypes.hpp"
#include "prx/libc/include/General.hpp"
#include <chrono>
#include <string>
#include <thread>
namespace {
constexpr std::int32_t SCE_USBD_ERROR_INVALID_ARG = static_cast<std::int32_t>(0x80240002);
struct UsbdTimeval {
std::int64_t seconds;
std::int64_t microseconds;
};
void* g_emptyDeviceList[1] = {nullptr};
}
extern "C" {
std::int32_t APS5_VABI sceUsbdInit() {
return 0;
}
void APS5_VABI sceUsbdExit() {
}
std::int64_t APS5_VABI sceUsbdGetDeviceList(void*** list) {
if (list == nullptr) return SCE_USBD_ERROR_INVALID_ARG;
*list = g_emptyDeviceList;
return 0;
}
void APS5_VABI sceUsbdFreeDeviceList(void** list, std::int32_t unrefDevices) {
(void)unrefDevices;
if (list != nullptr && list != g_emptyDeviceList) throw std::runtime_error(std::string(__func__) + ": list was not returned by sceUsbdGetDeviceList");
}
std::int32_t APS5_VABI sceUsbdHandleEventsTimeout(const UsbdTimeval* timeout) {
if (timeout == nullptr || timeout->seconds < 0 || timeout->microseconds < 0 || timeout->microseconds >= 1000000) return SCE_USBD_ERROR_INVALID_ARG;
std::this_thread::sleep_for(std::chrono::seconds(timeout->seconds) + std::chrono::microseconds(timeout->microseconds));
return 0;
}
int APS5_VABI sceUsbdAllocTransfer() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdAttachKernelDriver() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdCancelTransfer() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdCheckConnected() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdClaimInterface() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdClose() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdControlTransfer() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdEventHandlingOk() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdFillInterruptTransfer() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdFreeConfigDescriptor() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdFreeTransfer() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdGetActiveConfigDescriptor() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdGetBusNumber() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdGetConfigDescriptor() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdGetDeviceAddress() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdGetDeviceDescriptor() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdGetStringDescriptor() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdKernelDriverActive() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdOpen() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdRefDevice() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdReleaseInterface() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdResetDevice() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdSetConfiguration() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdSubmitTransfer() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceUsbdUnrefDevice() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
}