gupnp_control_point_browse_start

(PECL gupnp >= 0.1.0)

gupnp_control_point_browse_startCommence la recherche

Description

gupnp_control_point_browse_start ( resource $cpoint ) : bool

Commence la recherche et appel la fonction de rappel définie par l'utilisateur.

Liste de paramètres

cpoint

Un identifiant de point de contrôle, retourné par la fonction gupnp_control_point_new().

Valeurs de retour

Cette fonction retourne TRUE en cas de succès ou FALSE si une erreur survient.

Exemples

Exemple #1 Crée un nouveau contexte UPnP et commence la recherche

<?php

function device_proxy_available_cb($proxy$arg)
{
    
$info gupnp_device_info_get($proxy);

    
$type $info['device_type'];
    
$location $info['location'];

    
printf("Device available:\n");
    
printf("type:     %s\n"$type);
    
printf("location: %s\n"$location);
}

/* Crée un nouveau contexte UPnP */
$context gupnp_context_new();

if (!
$context) {
 die(
"Erreur lors de la création du contexte GUPnP\n");
}

/* Nous sommes intéresser par tout ! */
$cp gupnp_control_point_new($context"ssdp:all");

gupnp_control_point_callback_set($cp
    
GUPNP_SIGNAL_DEVICE_PROXY_AVAILABLE'device_proxy_available_cb');

/* Commence la recherche */
gupnp_control_point_browse_start($cp);

?>

Voir aussi