source: prextra/@ftp/dataMode.m @ 140

Last change on this file since 140 was 113, checked in by bduin, 8 years ago
File size: 984 bytes
Line 
1function dataConnectionMode = dataMode(h)
2% dataMode Change to active mode
3%   dataMode(FTP) returns the current connection status.
4%   Possible return strings are:
5%       'ACTIVE_LOCAL_DATA_CONNECTION_MODE'
6%       'ACTIVE_REMOTE_DATA_CONNECTION_MODE'
7%       'PASSIVE_LOCAL_DATA_CONNECTION_MODE'
8%       'PASSIVE_REMOTE_DATA_CONNECTION_MODE'
9
10% Idin Motedayen-Aval
11% December 2004
12
13% Make sure we're still connected.
14connect(h)
15
16if (nargin ~= 1)
17    error('Incorrect number of arguments.')
18end
19
20modeNumber = h.jobject.getDataConnectionMode;
21
22switch modeNumber
23    case 0
24        dataConnectionMode = 'ACTIVE_LOCAL_DATA_CONNECTION_MODE';
25    case 1
26        dataConnectionMode = 'ACTIVE_REMOTE_DATA_CONNECTION_MODE';
27    case 2
28        dataConnectionMode = 'PASSIVE_LOCAL_DATA_CONNECTION_MODE';
29    case 3
30        dataConnectionMode = 'PASSIVE_REMOTE_DATA_CONNECTION_MODE';
31    otherwise
32        error ('Invalid data connection mode returned.');
33end
Note: See TracBrowser for help on using the repository browser.