コード例 #1
0
        /// <summary>
        /// Connects to the preboard service on the specified device.
        /// </summary>
        /// <param name="device">
        /// The device to connect to.
        /// </param>
        /// <param name="service">
        /// The service descriptor returned by lockdownd_start_service.
        /// </param>
        /// <param name="client">
        /// Pointer that will point to a newly allocated
        /// preboard_client_t upon successful return. Must be freed using
        /// preboard_client_free() after use.
        /// </param>
        /// <returns>
        /// PREBOARD_E_SUCCESS on success, PREBOARD_E_INVALID_ARG when
        /// client is NULL, or an PREBOARD_E_* error code otherwise.
        /// </returns>
        public virtual PreboardError preboard_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out PreboardClientHandle client)
        {
            PreboardError returnValue;

            returnValue = PreboardNativeMethods.preboard_client_new(device, service, out client);
            client.Api  = this.Parent;
            return(returnValue);
        }
コード例 #2
0
        /// <summary>
        /// Starts a new preboard service on the specified device and connects to it.
        /// </summary>
        /// <param name="device">
        /// The device to connect to.
        /// </param>
        /// <param name="client">
        /// Pointer that will point to a newly allocated
        /// preboard_client_t upon successful return. Must be freed using
        /// preboard_client_free() after use.
        /// </param>
        /// <param name="label">
        /// The label to use for communication. Usually the program name.
        /// Pass NULL to disable sending the label in requests to lockdownd.
        /// </param>
        /// <returns>
        /// PREBOARD_E_SUCCESS on success, or a PREBOARD_E_* error
        /// code otherwise.
        /// </returns>
        public virtual PreboardError preboard_client_start_service(iDeviceHandle device, out PreboardClientHandle client, string label)
        {
            PreboardError returnValue;

            returnValue = PreboardNativeMethods.preboard_client_start_service(device, out client, label);
            client.Api  = this.Parent;
            return(returnValue);
        }
コード例 #3
0
        /// <summary>
        /// Receives a plist from the service with the specified timeout.
        /// </summary>
        /// <param name="client">
        /// The preboard client
        /// </param>
        /// <param name="plist">
        /// Pointer to a plist_t what will be set to the received plist
        /// </param>
        /// <returns>
        /// PREBOARD_E_SUCCESS on success,
        /// PREBOARD_E_INVALID_ARG when client or plist is NULL,
        /// PREBOARD_E_TIMEOUT when no data was received after the given timeout,
        /// or a PREBOARD_E_* error code on error.
        /// </returns>
        public virtual PreboardError preboard_receive_with_timeout(PreboardClientHandle client, out PlistHandle plist, uint timeoutMs)
        {
            PreboardError returnValue;

            returnValue = PreboardNativeMethods.preboard_receive_with_timeout(client, out plist, timeoutMs);
            plist.Api   = this.Parent;
            return(returnValue);
        }
コード例 #4
0
        /// <summary>
        /// Receives a plist from the service.
        /// </summary>
        /// <param name="client">
        /// The preboard client
        /// </param>
        /// <param name="plist">
        /// Pointer to a plist_t what will be set to the received plist
        /// </param>
        /// <returns>
        /// PREBOARD_E_SUCCESS on success,
        /// PREBOARD_E_INVALID_ARG when client or plist is NULL,
        /// PREBOARD_E_TIMEOUT when no data was received after 5 seconds,
        /// or a PREBOARD_E_* error code on error
        /// </returns>
        public virtual PreboardError preboard_receive(PreboardClientHandle client, out PlistHandle plist)
        {
            PreboardError returnValue;

            returnValue = PreboardNativeMethods.preboard_receive(client, out plist);
            plist.Api   = this.Parent;
            return(returnValue);
        }
コード例 #5
0
 /// <summary>
 /// Instructs the preboard service to commit a previously created stashbag.
 /// The callback or following preboard_receive* invocations will usually
 /// receive a dictionary with:
 /// { StashbagCommitComplete: true }
 /// or in case of an error:
 /// { StashbagCommitComplete: 0, Error: 1,
 /// <optional
 /// > ErrorString:
 /// <error
 /// string> }
 /// </summary>
 /// <param name="client">
 /// The preboard client to use for receiving
 /// </param>
 /// <param name="manifest">
 /// An optional manifest
 /// </param>
 /// <param name="status_cb">
 /// Callback function that will receive status and error messages
 /// Can be NULL if you want to handle receiving messages in your own code.
 /// </param>
 /// <param name="user_data">
 /// User data for callback function or NULL.
 /// </param>
 /// <returns>
 /// PREBOARD_E_SUCCESS if the command was successfully submitted,
 /// PREBOARD_E_INVALID_ARG when client is invalid,
 /// or a PREBOARD_E_* error code on error.
 /// </returns>
 public virtual PreboardError preboard_commit_stashbag(PreboardClientHandle client, PlistHandle manifest, PreboardStatusCallBack statusCallBack, System.IntPtr userData)
 {
     return(PreboardNativeMethods.preboard_commit_stashbag(client, manifest, statusCallBack, userData));
 }
コード例 #6
0
 /// <summary>
 /// Sends a plist to the service.
 /// </summary>
 /// <param name="client">
 /// The preboard client
 /// </param>
 /// <param name="plist">
 /// The plist to send
 /// </param>
 /// <returns>
 /// PREBOARD_E_SUCCESS on success,
 /// PREBOARD_E_INVALID_ARG when client or plist is NULL,
 /// or a PREBOARD_E_* error code on error
 /// </returns>
 public virtual PreboardError preboard_send(PreboardClientHandle client, PlistHandle plist)
 {
     return(PreboardNativeMethods.preboard_send(client, plist));
 }
コード例 #7
0
 /// <summary>
 /// Disconnects a preboard client from the device and frees up the
 /// preboard client data.
 /// </summary>
 /// <param name="client">
 /// The preboard client to disconnect and free.
 /// </param>
 /// <returns>
 /// PREBOARD_E_SUCCESS on success, PREBOARD_E_INVALID_ARG when
 /// client is NULL, or a PREBOARD_E_* error code otherwise.
 /// </returns>
 public virtual PreboardError preboard_client_free(System.IntPtr client)
 {
     return(PreboardNativeMethods.preboard_client_free(client));
 }