## GSSDPResourceGroup

GSSDPResourceGroup — Class for controlling resource announcement.

## Synopsis

    struct              GSSDPResourceGroup;
    GSSDPResourceGroup * gssdp_resource_group_new           (GSSDPClient *client);
    GSSDPClient *       gssdp_resource_group_get_client     (GSSDPResourceGroup *resource_group);
    void                gssdp_resource_group_set_max_age    (GSSDPResourceGroup *resource_group,
                                                             guint max_age);
    guint               gssdp_resource_group_get_max_age    (GSSDPResourceGroup *resource_group);
    void                gssdp_resource_group_set_available  (GSSDPResourceGroup *resource_group,
                                                             gboolean available);
    gboolean            gssdp_resource_group_get_available  (GSSDPResourceGroup *resource_group);
    void                gssdp_resource_group_set_message_delay
                                                            (GSSDPResourceGroup *resource_group,
                                                             guint message_delay);
    guint               gssdp_resource_group_get_message_delay
                                                            (GSSDPResourceGroup *resource_group);
    guint               gssdp_resource_group_add_resource   (GSSDPResourceGroup *resource_group,
                                                             const char *target,
                                                             const char *usn,
                                                             GList *locations);
    guint               gssdp_resource_group_add_resource_simple
                                                            (GSSDPResourceGroup *resource_group,
                                                             const char *target,
                                                             const char *usn,
                                                             const char *location);
    void                gssdp_resource_group_remove_resource
                                                            (GSSDPResourceGroup *resource_group,
                                                             guint resource_id);

## Object Hierarchy

      GObject
       +----GSSDPResourceGroup

## Properties

      "available"                gboolean              : Read / Write
      "client"                   GSSDPClient*          : Read / Write / Construct Only
      "max-age"                  guint                 : Read / Write
      "message-delay"            guint                 : Read / Write

## Description

A GSSDPResourceGroup is a group of SSDP resources whose availability can be controlled as one. This is useful when one needs to announce a single service as multiple SSDP resources (UPnP does this for example).

## Details

### struct GSSDPResourceGroup

    struct GSSDPResourceGroup;

### gssdp_resource_group_new ()

    GSSDPResourceGroup * gssdp_resource_group_new           (GSSDPClient *client);

`client` : | The GSSDPClient to associate with
Returns : | A new GSSDPResourceGroup object.

### gssdp_resource_group_get_client ()

    GSSDPClient *       gssdp_resource_group_get_client     (GSSDPResourceGroup *resource_group);

`resource_group` : | A GSSDPResourceGroup
Returns : | The GSSDPClient `resource_group` is associated with. [transfer none]

### gssdp_resource_group_set_max_age ()

    void                gssdp_resource_group_set_max_age    (GSSDPResourceGroup *resource_group,
                                                             guint max_age);

Sets the number of seconds advertisements are valid to `max_age`.

`resource_group` : | A GSSDPResourceGroup
`max_age` : | The number of seconds advertisements are valid

### gssdp_resource_group_get_max_age ()

    guint               gssdp_resource_group_get_max_age    (GSSDPResourceGroup *resource_group);

`resource_group` : | A GSSDPResourceGroup
Returns : | The number of seconds advertisements are valid.

### gssdp_resource_group_set_available ()

    void                gssdp_resource_group_set_available  (GSSDPResourceGroup *resource_group,
                                                             gboolean available);

Sets `resource_group`s availability to `available`. Changing `resource_group`s availability causes it to announce its new state to listening SSDP clients.

`resource_group` : | A GSSDPResourceGroup
`available` : | TRUE if `resource_group` should be available (advertised)

### gssdp_resource_group_get_available ()

    gboolean            gssdp_resource_group_get_available  (GSSDPResourceGroup *resource_group);

`resource_group` : | A GSSDPResourceGroup
Returns : | TRUE if `resource_group` is available (advertised).

### gssdp_resource_group_set_message_delay ()

    void                gssdp_resource_group_set_message_delay
                                                            (GSSDPResourceGroup *resource_group,
                                                             guint message_delay);

Sets the minimum time between each SSDP message.

`resource_group` : | A GSSDPResourceGroup
`message_delay` : | The message delay in ms.

### gssdp_resource_group_get_message_delay ()

    guint               gssdp_resource_group_get_message_delay
                                                            (GSSDPResourceGroup *resource_group);

`resource_group` : | A GSSDPResourceGroup
Returns : | the minimum time between each SSDP message in ms.

### gssdp_resource_group_add_resource ()

    guint               gssdp_resource_group_add_resource   (GSSDPResourceGroup *resource_group,
                                                             const char *target,
                                                             const char *usn,
                                                             GList *locations);

Adds a resource with target `target`, USN `usn`, and locations `locations` to `resource_group`.

`resource_group` : | An `GSSDPResourceGroup`
`target` : | The resource's target
`usn` : | The resource's USN
`locations` : | A GList of the resource's locations. [element-type utf8]
Returns : | The ID of the added resource.

### gssdp_resource_group_add_resource_simple ()

    guint               gssdp_resource_group_add_resource_simple
                                                            (GSSDPResourceGroup *resource_group,
                                                             const char *target,
                                                             const char *usn,
                                                             const char *location);

Adds a resource with target `target`, USN `usn`, and location `location` to `resource_group`.

`resource_group` : | An `GSSDPResourceGroup`
`target` : | The resource's target
`usn` : | The resource's USN
`location` : | The resource's location
Returns : | The ID of the added resource.

### gssdp_resource_group_remove_resource ()

    void                gssdp_resource_group_remove_resource
                                                            (GSSDPResourceGroup *resource_group,
                                                             guint resource_id);

Removes the resource with ID `resource_id` from `resource_group`.

`resource_group` : | An `GSSDPResourceGroup`
`resource_id` : | The ID of the resource to remove

## Property Details

### The `"available"` property

      "available"                gboolean              : Read / Write

Whether this group of resources is available or not.

Default value: FALSE

### The `"client"` property

      "client"                   GSSDPClient*          : Read / Write / Construct Only

The GSSDPClient to use.

### The `"max-age"` property

      "max-age"                  guint                 : Read / Write

The number of seconds our advertisements are valid.

Default value: 1800

### The `"message-delay"` property

      "message-delay"            guint                 : Read / Write

The minimum number of milliseconds between SSDP messages. The default is 120 based on DLNA specification.

Default value: 120