libimobiledevice  1.2.0
Macros | Typedefs | Enumerations | Functions
webinspector.h File Reference

WebKit Remote Debugging. More...

Macros

#define WEBINSPECTOR_SERVICE_NAME   "com.apple.webinspector"
 

Typedefs

typedef struct
webinspector_client_private 
webinspector_client_private
 
typedef
webinspector_client_private * 
webinspector_client_t
 The client handle. More...
 

Enumerations

enum  webinspector_error_t {
  WEBINSPECTOR_E_SUCCESS = 0,
  WEBINSPECTOR_E_INVALID_ARG = -1,
  WEBINSPECTOR_E_PLIST_ERROR = -2,
  WEBINSPECTOR_E_MUX_ERROR = -3,
  WEBINSPECTOR_E_SSL_ERROR = -4,
  WEBINSPECTOR_E_UNKNOWN_ERROR = -256
}
 Error Codes.
 

Functions

webinspector_error_t webinspector_client_new (idevice_t device, lockdownd_service_descriptor_t service, webinspector_client_t *client)
 Connects to the webinspector service on the specified device. More...
 
webinspector_error_t webinspector_client_start_service (idevice_t device, webinspector_client_t *client, const char *label)
 Starts a new webinspector service on the specified device and connects to it. More...
 
webinspector_error_t webinspector_client_free (webinspector_client_t client)
 Disconnects a webinspector client from the device and frees up the webinspector client data. More...
 
webinspector_error_t webinspector_send (webinspector_client_t client, plist_t plist)
 Sends a plist to the service. More...
 
webinspector_error_t webinspector_receive (webinspector_client_t client, plist_t *plist)
 Receives a plist from the service. More...
 
webinspector_error_t webinspector_receive_with_timeout (webinspector_client_t client, plist_t *plist, uint32_t timeout_ms)
 Receives a plist using the given webinspector client. More...
 

Detailed Description

WebKit Remote Debugging.

Typedef Documentation

typedef webinspector_client_private* webinspector_client_t

The client handle.

Function Documentation

webinspector_error_t webinspector_client_free ( webinspector_client_t  client)

Disconnects a webinspector client from the device and frees up the webinspector client data.

Parameters
clientThe webinspector client to disconnect and free.
Returns
WEBINSPECTOR_E_SUCCESS on success, WEBINSPECTOR_E_INVALID_ARG when client is NULL, or an WEBINSPECTOR_E_* error code otherwise.
webinspector_error_t webinspector_client_new ( idevice_t  device,
lockdownd_service_descriptor_t  service,
webinspector_client_t client 
)

Connects to the webinspector service on the specified device.

Parameters
deviceThe device to connect to.
serviceThe service descriptor returned by lockdownd_start_service.
clientPointer that will point to a newly allocated webinspector_client_t upon successful return. Must be freed using webinspector_client_free() after use.
Returns
WEBINSPECTOR_E_SUCCESS on success, WEBINSPECTOR_E_INVALID_ARG when client is NULL, or an WEBINSPECTOR_E_* error code otherwise.
webinspector_error_t webinspector_client_start_service ( idevice_t  device,
webinspector_client_t client,
const char *  label 
)

Starts a new webinspector service on the specified device and connects to it.

Parameters
deviceThe device to connect to.
clientPointer that will point to a newly allocated webinspector_client_t upon successful return. Must be freed using webinspector_client_free() after use.
labelThe label to use for communication. Usually the program name. Pass NULL to disable sending the label in requests to lockdownd.
Returns
WEBINSPECTOR_E_SUCCESS on success, or an WEBINSPECTOR_E_* error code otherwise.
webinspector_error_t webinspector_receive ( webinspector_client_t  client,
plist_t *  plist 
)

Receives a plist from the service.

Parameters
clientThe webinspector client
plistThe plist to store the received data
Returns
DIAGNOSTICS_RELAY_E_SUCCESS on success, DIAGNOSTICS_RELAY_E_INVALID_ARG when client or plist is NULL
webinspector_error_t webinspector_receive_with_timeout ( webinspector_client_t  client,
plist_t *  plist,
uint32_t  timeout_ms 
)

Receives a plist using the given webinspector client.

Parameters
clientThe webinspector client to use for receiving
plistpointer to a plist_t that will point to the received plist upon successful return
timeoutMaximum time in milliseconds to wait for data.
Returns
WEBINSPECTOR_E_SUCCESS on success, WEBINSPECTOR_E_INVALID_ARG when client or *plist is NULL, WEBINSPECTOR_E_PLIST_ERROR when the received data cannot be converted to a plist, WEBINSPECTOR_E_MUX_ERROR when a communication error occurs, or WEBINSPECTOR_E_UNKNOWN_ERROR when an unspecified error occurs.
webinspector_error_t webinspector_send ( webinspector_client_t  client,
plist_t  plist 
)

Sends a plist to the service.

Parameters
clientThe webinspector client
plistThe plist to send
Returns
DIAGNOSTICS_RELAY_E_SUCCESS on success, DIAGNOSTICS_RELAY_E_INVALID_ARG when client or plist is NULL