Exemplo n.º 1
0
static void
device_list_device_add(Eupnp_Device_Info *d)
{
    IGD_Device *device;

    device = malloc(sizeof(IGD_Device));

    if (!device)
    {
        ERR("Failed to create a new device list item.");
        return;
    }

    device->device = eupnp_device_info_ref(d);
    device->item = elm_list_item_append(li,
                                        d->friendly_name ? d->friendly_name : "Unnamed device",
                                        NULL, // Icon
                                        NULL,
                                        list_item_activate,
                                        device);
    elm_list_item_show(device->item);
    elm_list_go(li);

    INF("Appending device %s to list!", d->udn);
    device_list = eina_list_append(device_list, device);
}
Exemplo n.º 2
0
/**
 * Subscribed function for DEVICE_FOUND events.
 *
 * Starts the process of fetching
 */
static Eina_Bool
_on_device_found(void *user_data, Eupnp_Event_Type type, void *event_data)
{
   if (eupnp_event_bus_type_has_subscriber(EUPNP_EVENT_DEVICE_READY))
     {
	DBG("Detected subscribers for DEVICE_READY, performing fetch().");
	Eupnp_Device_Info *device_info = event_data;
	eupnp_device_info_fetch(eupnp_device_info_ref(device_info));
	eupnp_device_info_unref(device_info);
     }
   else
     {
	DBG("No subscribers for DEVICE_READY, ignoring internal DEVICE_INFO hook.");
     }

   return EINA_TRUE;
}