TwclCustomObexClient.Put(string,string,string,TStream,TwclObexAppParams) Method

Sends one object from the client to the server.

Namespace: wclObex
protected
 function Put(const Name: string; const Mime: string;
 const Description: string; const Stream: TStream;
 const AppParams: TwclObexAppParams): Integer;

Parameters

Name
Type: string

The object's name. If the parameter is an empty string the Name is ignored.

Mime
Type: string

The object's MIME type. If the parameter is an empty string the Mime is ignored.

Description
Type: string

The object's description. If the parameter is an empty string the Description is ignored.

Stream
Type: TStream

The object's data stream. If the parameter is nil it forces to delete the object with the name specified by the Name parameter or with MIME type specified by the Mime parameter. If the Stream parameter is an empty stream (it is not nil and the Stream size is 0) it forces a server to create an empty object with the given Name or MIME.

AppParams
Type: TwclObexAppParams

The application parameters raw bytes.

Return Value

Type: Integer

If the function succeed the return value is wclErrors.WCL_E_SUCCESS. Otherwise the method returns one of the WCL error codes.

The method starts sending an object (or other operation described above) to a OBEX server. When sending is completed the OnPutComplete event fires with the operation result.

If an application passes a valid Stream object to the method the object must be valid until OnPutComplete event fires. An application can destroy the stream object passed as the Stream parameter only after OnPutComplete event fired.

During execution of the Put operation the OnProgress event may (or may not) fire indicating the operation progress.