Top |
Functions
Description
GSSDPResourceBrowser handles resource discovery. After creating a browser and activating it, the ::resource-available and ::resource-unavailable signals will be emitted whenever the availability of a resource matching the specified discovery target changes. A discovery request is sent out automatically when activating the browser.
Functions
gssdp_resource_browser_new ()
GSSDPResourceBrowser * gssdp_resource_browser_new (GSSDPClient *client
,const char *target
);
target
is a generic string the resource browser listens for on the SSDP
bus. There are several possible targets such as
"ssdp:all" for everything
"upnp:rootdevice" for UPnP device entry points, not caring about the device type
The UUID of a specific device
Device types such as "urn:schemas-upnp-org:device:MediaServer:1"
Service types such as "urn:schemas-upnp-org:service:ContentDirectory:1"
gssdp_resource_browser_get_client ()
GSSDPClient *
gssdp_resource_browser_get_client (GSSDPResourceBrowser *resource_browser
);
gssdp_resource_browser_set_target ()
void gssdp_resource_browser_set_target (GSSDPResourceBrowser *resource_browser
,const char *target
);
Sets the browser target of resource_browser
to target
.
gssdp_resource_browser_get_target ()
const char *
gssdp_resource_browser_get_target (GSSDPResourceBrowser *resource_browser
);
gssdp_resource_browser_set_mx ()
void gssdp_resource_browser_set_mx (GSSDPResourceBrowser *resource_browser
,gushort mx
);
Sets the used MX value of resource_browser
to mx
.
gssdp_resource_browser_get_mx ()
gushort
gssdp_resource_browser_get_mx (GSSDPResourceBrowser *resource_browser
);
gssdp_resource_browser_set_active ()
void gssdp_resource_browser_set_active (GSSDPResourceBrowser *resource_browser
,gboolean active
);
(De)activates resource_browser
.
gssdp_resource_browser_get_active ()
gboolean
gssdp_resource_browser_get_active (GSSDPResourceBrowser *resource_browser
);
gssdp_resource_browser_rescan ()
gboolean
gssdp_resource_browser_rescan (GSSDPResourceBrowser *resource_browser
);
Begins discovery if resource_browser
is active and no discovery is
performed. Otherwise does nothing.
Property Details
The “active”
property
“active” gboolean
Whether this browser is active or not.
Flags: Read / Write
Default value: FALSE
The “client”
property
“client” GSSDPClient *
The GSSDPClient to use.
Flags: Read / Write / Construct Only
The “mx”
property
“mx” guint
The maximum number of seconds in which to request other parties to respond.
Flags: Read / Write
Allowed values: [1,65535]
Default value: 3
The “target”
property
“target” gchar *
The discovery target.
Flags: Read / Write
Default value: NULL
Signal Details
The “resource-available”
signal
void user_function (GSSDPResourceBrowser *resource_browser, gchar *usn, gpointer locations, gpointer user_data)
The ::resource-available signal is emitted whenever a new resource has become available.
Parameters
resource_browser |
The GSSDPResourceBrowser that received the signal |
|
usn |
The USN of the discovered resource |
|
locations |
A GList of strings describing the locations of the discovered resource. |
[type GList*][transfer none][element-type utf8] |
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
The “resource-unavailable”
signal
void user_function (GSSDPResourceBrowser *resource_browser, gchar *usn, gpointer user_data)
The ::resource-unavailable signal is emitted whenever a resource is not available any more.
Parameters
resource_browser |
The GSSDPResourceBrowser that received the signal |
|
usn |
The USN of the resource |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last