ADC Home > Reference Library > Reference > Hardware & Drivers > Bluetooth > Bluetooth Framework Reference
|
OBEXFileTransferServices |
Inherits from: | NSObject |
Declared In: |
Implements advanced OBEX operations in addition to simple PUT and GET.
All operations are asynchronous and will callback over a respective delegate method if the initial return value is successful. The initial return value usually concerns the state of this object where as the delegate return value reflects the response of the remote device.
Abort the current operation
Change to the directory above the current level if not at the root
Change the remote path
Asynchronously change to the remote root directory
Asynchronously change to the remote root directory
Connect the (unconnected) OBEXSession to a remote device for FTP operations
Connect the (unconnected) OBEXSession to a remote device for ObjectPush operations. Most of the FTP functionality of this object will be disabled.
Copy a remote file to a local path
Create a folder on the remote target
Get the remote current directory path during an FTP session
Get the delegate
Disconnect the (connected) OBEXSession from the remote device
Get the remote default VCard, if it is supported
Create a new OBEXFileTransferServices object
Get the action state of the module
Get the connected state of this module.
Remove a remote item.
Get a remote directory listing
Send data to a remote target
Put a local file to the remote target
Manually set the delegate
Create a new OBEXFileTransferServices object
abort |
Abort the current operation
- (OBEXError) abort;
kOBEXSuccess, or kOBEXGeneralError if no command is in progress. ABORT commands can only be sent on our turn, meaning we may have to timeout if the target side never responds to the command in progress. In that case this object will call back with a status of kOBEXTimeoutError and an error. Further results returned through the fileTransferServicesAbortComplete: delegate method if initially successful.
Attempts send an abort request to the remote device. Returns the OBEXFileTransferServices object to an idle state though the state of the remote device is not guaranteed.
changeCurrentFolderBackward |
Change to the directory above the current level if not at the root
- (OBEXError) changeCurrentFolderBackward;
kOBEXSuccess or kOBEXSessionBusyError initially. Further results returned through the fileTransferServicesPathChangeComplete: delegate method if initially successful.
Equivalent to 'cd ..' only if remote path is not already at root.
changeCurrentFolderForwardToPath: |
Change the remote path
- (OBEXError) changeCurrentFolderForwardToPath: (NSString*) inDirName;
inDirName
The name of the remote folder to be set as current
kOBEXSuccess, kOBEXSessionBusyError, or kOBEXBadArgumentError initially. Further results returned through the fileTransferServicesPathChangeComplete: delegate method if initially successful.
Equivalent to 'cd dirName'.
changeCurrentFolderRoot |
Asynchronously change to the remote root directory
See Also:
changeCurrentFolderToRoot
- (OBEXError) changeCurrentFolderToRoot;
kOBEXSuccess or kOBEXSessionBusyError initially. Further results returned through the fileTransferServicesPathChangeComplete: delegate method if initially successful.
Equivalent to 'cd ~/'
changeCurrentFolderToRoot |
Asynchronously change to the remote root directory
See Also:
changeCurrentFolderRoot
- (OBEXError) changeCurrentFolderToRoot;
Equivalent to 'cd ~/'
connectToFTPService |
Connect the (unconnected) OBEXSession to a remote device for FTP operations
- (OBEXError) connectToFTPService;
kOBEXSuccess, kOBEXSessionBusyError, or kOBEXSessionAlreadyConnectedError, kOBEXNoResourcesError initially. Further results returned through the fileTransferServicesConnectionComplete: delegate method if initially successful.
If the OBEXSession given to OBEXFileTransferServices on creation is not connected it can be manually connected through this method.
connectToObjectPushService |
Connect the (unconnected) OBEXSession to a remote device for ObjectPush operations. Most of the FTP functionality of this object will be disabled.
- (OBEXError) connectToObjectPushService;
kOBEXSuccess, kOBEXSessionBusyError, or kOBEXSessionAlreadyConnectedError, kOBEXNoResourcesError initially. Further results returned through the fileTransferServicesConnectionComplete: delegate method if initially successful.
If the OBEXSession given to OBEXFileTransferServices on creation is not connected it can be manually connected through this method.
copyRemoteFile:toLocalPath: |
Copy a remote file to a local path
- (OBEXError) copyRemoteFile: (NSString*) inRemoteFileName toLocalPath: (NSString*) inLocalPathAndName;
inRemoteFileName
The name of the remote file to get
inLocalPathAndName
The path and name of where the received file will go
kOBEXSuccess, kOBEXSessionBusyError, or kOBEXBadArgumentError. initially. Further results returned through the fileTransferServicesGetComplete: and fileTransferServicesGetProgress: delegate methods if initially successful.
Equivalent to 'cp remotePath/remoteFileName localPathAndName'.
createFolder: |
Create a folder on the remote target
- (OBEXError) createFolder: (NSString*) inDirName;
inDirName
The name of the folder to be created
kOBEXSuccess, kOBEXSessionBusyError, or kOBEXBadArgumentError initially. Further results returned through the fileTransferServicesCreateFolderComplete delegate method if initially successful.
Equivalent to 'mkdir dirName'.
currentPath |
Get the remote current directory path during an FTP session
- (NSString*) currentPath;
The current path being browsed over FTP
This path is changed with each path-specific command called on OBEXFileTransferServices.
delegate |
Get the delegate
- (id) delegate;
The delegate object
Get the delegate
disconnect |
Disconnect the (connected) OBEXSession from the remote device
- (OBEXError) disconnect;
kOBEXSuccess, kOBEXSessionNotConnectedError, or kOBEXSessionBusyError initially. Further results returned through the fileTransferServicesDisconnectionComplete: delegate method if initially successful.
The user can manually disconnect the OBEXSession from the remote device if they want to. OBEXFileTransferServices will disconnect the OBEXSession at release only if it was responsible for opening the connection via a connect method.
getDefaultVCard: |
Get the remote default VCard, if it is supported
- (OBEXError) getDefaultVCard:(NSString*) inLocalPathAndName;
inLocalPathAndName
The path and name of where the received file will go
kOBEXSuccess, kOBEXSessionBusyError, or kOBEXBadArgumentError initially. Further results returned through the fileTransferServicesGetComplete: and fileTransferServicesGetProgress: delegate methods if initially successful.
Some devices such as cellphones and computers support default VCards
initWithOBEXSession: |
Create a new OBEXFileTransferServices object
- (id) initWithOBEXSession:(IOBluetoothOBEXSession*)inOBEXSession;
inOBEXSession
A valid IOBluetoothOBEXSession
A newly created OBEXFileTransferServices object on success, nil on failure
This object must be constructed with a valid IOBluetoothOBEXSession. The given IOBluetoothOBEXSession does not need to be connected to the remote server. OBEXFileTransferServices can be manually connected through the provided connection methods.
isBusy |
Get the action state of the module
- (BOOL) isBusy;
Success or failure code.
OBEXFileTransferServices will be considered "busy" when an operation in taking place or has not completed. Calling abort: on this module will not automatically reset its busy state. The user will have to wait for the operation to complete or for the current operation to timeout.
isConnected |
Get the connected state of this module.
- (BOOL) isConnected;
Success or failure code.
Asks the OBEXSession that was passed to it on creation if it has an open OBEX connection
removeItem: |
Remove a remote item.
- (OBEXError) removeItem: (NSString*) inItemName;
inItemName
The name of the remote item to be removed
kOBEXSuccess, kOBEXSessionBusyError, or kOBEXBadArgumentError initially. Further results returned through the fileTransferServicesRemoveItemComplete: delegate method if initially successful.
NOTE: Not available on Apple computers for security reasons.
retrieveFolderListing |
Get a remote directory listing
- (OBEXError) retrieveFolderListing;
kOBEXSuccess or kOBEXSessionBusyError initially. Further results returned through the fileTransferServicesRetrieveFolderListingComplete: delegate method if initially successful.
Equivalent to 'ls'.
sendData:type:name: |
Send data to a remote target
- (OBEXError) sendData:(NSData*)inData type:(NSString*)inType name:(NSString*)inName;
inData
The data to be sent
inType
The type of the data to be sent that will be used in the OBEX type header, usually a mime-type. For example, use "text/x-vCard" when sending vCards. This argument is optional.
inName
The name of the file that the data can be referenced as.
kOBEXSuccess, kOBEXSessionBusyError, or kOBEXBadArgumentError initially. Further results returned through the fileTransferServicesSendComplete: and fileTransferServicesSendProgress: delegate methods if initially successful.
Use this method when you have data to send but no file to read from.
sendFile: |
Put a local file to the remote target
- (OBEXError) sendFile: (NSString*) inLocalPathAndName;
inLocalPathAndName
The name and path of the file to be sent an instance of OBEXFilePut.
kOBEXSuccess, kOBEXSessionBusyError, or kOBEXBadArgumentError initially. Further results returned through the fileTransferServicesSendComplete: and fileTransferServicesSendProgress: delegate methods if initially successful.
Equivalent to 'mv inLocalFilePath remoteCurrentPath'.
setDelegate: |
Manually set the delegate
- (void) setDelegate: (id) inDelegate;
inDelegate
An object that implements the methods defined in the OBEXFileTransferServicesDelegate category
The only way to receive OBEXFileTransferServices transfer operation updates are through using the provided delegate methods below. The return values from all transfer operations on this object are only initial values reflecting the state of this object, not the transfers as a whole. Note that prior to 10.5, the delegate was erroneously retained by the FTS object. In 10.5 and later it is not retained.
withOBEXSession: |
Create a new OBEXFileTransferServices object
+ (OBEXFileTransferServices*) withOBEXSession: (IOBluetoothOBEXSession*) inOBEXSession;
inOBEXSession
A valid IOBluetoothOBEXSession that may or may not be connected
A newly created OBEXFileTransferServices object on success, nil on failure
This object must be constructed with a valid IOBluetoothOBEXSession. The given IOBluetoothOBEXSession does not need to be connected to the remote server. This module can be manually connected through the connect() method or will automatically connect when any transfer method is called on it.
|
Last Updated: 2008-08-07