function status_changed_cb($variable, $value, $arg) { printf("Status has been changed\n"); printf("\tvariable name: %s\n", $variable); printf("\tvalue: %s\n", (int) $value); printf("\n"); gupnp_control_point_browse_stop($arg['cp']); }
function gupnp_device_proxy_available_cb($proxy, $arg) { /* Get device info */ $info = gupnp_device_info_get($proxy); if ($info['friendly_name'] == 'MediaTomb') { printf("Device is available:\n"); foreach ($info as $key => $value) { printf("\t%-30s: %s\n", $key, $value); } printf("\n"); gupnp_control_point_browse_stop($arg['cp_device']); $arg_service = array('udn' => $info['udn'], 'cp_service' => $arg['cp_service']); $cb_service = "gupnp_service_proxy_available_cb"; gupnp_control_point_callback_set($arg['cp_service'], GUPNP_SIGNAL_SERVICE_PROXY_AVAILABLE, $cb_service, $arg_service); gupnp_control_point_browse_start($arg['cp_service']); } }
function tvcontrol_device_proxy_unavailable_cb($proxy, $arg) { printf("Device is no longer available\n"); gupnp_control_point_browse_stop($arg['cp']); }