gupnp_control_point_browse_start

(PECL gupnp >= 0.1.0)

gupnp_control_point_browse_startCommence la recherche

Description

bool gupnp_control_point_browse_start ( resource $cpoint )

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

  1. <?php
  2.  
  3. function device_proxy_available_cb($proxy, $arg)
  4. {
  5. $info = gupnp_device_info_get($proxy);
  6.  
  7. $type = $info['device_type'];
  8. $location = $info['location'];
  9.  
  10. printf("Device available:\n");
  11. printf("type: %s\n", $type);
  12. printf("location: %s\n", $location);
  13. }
  14.  
  15. /* Crée un nouveau contexte UPnP */
  16. $context = gupnp_context_new();
  17.  
  18. if (!$context) {
  19. die("Erreur lors de la création du contexte GUPnP\n");
  20. }
  21.  
  22. /* Nous sommes intéresser par tout ! */
  23. $cp = gupnp_control_point_new($context, "ssdp:all");
  24.  
  25. gupnp_control_point_callback_set($cp,
  26. GUPNP_SIGNAL_DEVICE_PROXY_AVAILABLE, 'device_proxy_available_cb');
  27.  
  28. /* Commence la recherche */
  29. gupnp_control_point_browse_start($cp);
  30.  
  31. ?>

Voir aussi

LoadingChargement en cours