OBEXSessionConnect

Function OBEXSessionConnect 

Source
pub unsafe extern "C-unwind" fn OBEXSessionConnect(
    in_session_ref: OBEXSessionRef,
    in_flags: OBEXFlags,
    in_max_packet_length: OBEXMaxPacketLength,
    in_optional_headers: *mut c_void,
    in_optional_headers_length: usize,
    in_callback: OBEXSessionEventCallback,
    in_user_ref_con: *mut c_void,
) -> OBEXError
👎Deprecated
Available on crate feature OBEX only.
Expand description

Establishes an OBEX connection to the target device for the session. If a transport connection is not open yet, it will be opened if possible.

Parameter inSessionRef: A valid session reference.

Parameter inFlags: Flags, as defined in the OBEX spec for this command.

Parameter inMaxPacketLength: Maximum packet length you wish to allow. May be negiotiated with host to be less or more than you specify.

Parameter inOptionalHeaders: Ptr to optional headers you can supply to the command. DO NOT dispose of this pointer until you callback is called with a success.

Parameter inOptionalHeadersLength: Size of data at the specified ptr.

Parameter inCallback: A valid callback. Will be called for progress, errors and completion.

Parameter inUserRefCon: Optional parameter; can contain anything you wish. Will be returned in your callback just as you passed it.

Returns: An error code value. 0 if successful.

As all commands for OBEX sessions, this command is asynchronous only. A NULL callback parameter will result in an error. If you have already established an OBEX connection and you call this again you will get an ‘kOBEXSessionAlreadyConnectedError’ as a result.

** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6) ** You should transition your code to Objective-C equivalents. ** This API may be removed any time in the future.