-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSMIErrCode2String.m
66 lines (64 loc) · 1.96 KB
/
SMIErrCode2String.m
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
% Part of the SMITE toolbox (https://github.com/dcnieho/SMITE), but can be
% used independently. When using this file, please cite the following
% paper:
% Niehorster, D.C., & Nyström, M., (2019). SMITE: A toolbox for creating
% Psychtoolbox and Psychopy experiments with SMI eye trackers.
% doi: 10.3758/s13428-019-01226-0.
function err = SMIErrCode2String(code)
errMap = {
'RET_SUCCESS',1
'RET_NO_VALID_DATA',2
'RET_CALIBRATION_ABORTED',3
'RET_SERVER_IS_RUNNING',4
'RET_CALIBRATION_NOT_IN_PROGRESS',5
'RET_WINDOW_IS_OPEN',11
'RET_WINDOW_IS_CLOSED',12
'ERR_COULD_NOT_CONNECT',100
'ERR_NOT_CONNECTED',101
'ERR_NOT_CALIBRATED',102
'ERR_NOT_VALIDATED',103
'ERR_EYETRACKING_APPLICATION_NOT_RUNNING',104
'ERR_WRONG_COMMUNICATION_PARAMETER',105
'ERR_WRONG_DEVICE',111
'ERR_WRONG_PARAMETER',112
'ERR_WRONG_CALIBRATION_METHOD',113
'ERR_CALIBRATION_TIMEOUT',114
'ERR_TRACKING_NOT_STABLE',115
'ERR_INSUFFICIENT_BUFFER_SIZE',116
'ERR_CREATE_SOCKET',121
'ERR_CONNECT_SOCKET',122
'ERR_BIND_SOCKET',123
'ERR_DELETE_SOCKET',124
'ERR_NO_RESPONSE_FROM_IVIEWX',131
'ERR_INVALID_IVIEWX_VERSION',132
'ERR_WRONG_IVIEWX_VERSION',133
'ERR_ACCESS_TO_FILE',171
'ERR_SOCKET_CONNECTION',181
'ERR_EMPTY_DATA_BUFFER',191
'ERR_RECORDING_DATA_BUFFER',192
'ERR_FULL_DATA_BUFFER',193
'ERR_IVIEWX_IS_NOT_READY',194
'ERR_PAUSED_DATA_BUFFER',195
'ERR_IVIEWX_NOT_FOUND',201
'ERR_IVIEWX_PATH_NOT_FOUND',202
'ERR_IVIEWX_ACCESS_DENIED',203
'ERR_IVIEWX_ACCESS_INCOMPLETE',204
'ERR_IVIEWX_OUT_OF_MEMORY',205
'ERR_MULTIPLE_DEVICES',206
'ERR_CAMERA_NOT_FOUND',211
'ERR_WRONG_CAMERA',212
'ERR_WRONG_CAMERA_PORT',213
'ERR_USB2_CAMERA_PORT',214
'ERR_USB3_CAMERA_PORT',215
'ERR_COULD_NOT_OPEN_PORT',220
'ERR_COULD_NOT_CLOSE_PORT',221
'ERR_AOI_ACCESS',222
'ERR_AOI_NOT_DEFINED',223
'ERR_FEATURE_NOT_LICENSED',250
'ERR_LICENSE_EXPIRED',251
'ERR_DEPRECATED_FUNCTION',300
'ERR_INITIALIZATION',400
'ERR_FUNC_NOT_LOADED',401};
qFound = [errMap{:,2}]==code;
assert(sum(qFound)==1,'SMIErrCode2String: The error code "%d" is unknown',code)
err = errMap{qFound,1};