[gssdp] client: Add property for preferred UDA version
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gssdp] client: Add property for preferred UDA version
- Date: Sat, 1 Dec 2018 19:55:43 +0000 (UTC)
commit 1a02da53486f2a94ffd03bb95a7f200d276dcbdc
Author: Jens Georg <mail jensge org>
Date: Sat Dec 1 20:52:00 2018 +0100
client: Add property for preferred UDA version
libgssdp/gssdp-client.c | 29 +++++++++++++++++++++++++++++
libgssdp/gssdp-client.h | 13 +++++++++++++
libgssdp/meson.build | 21 +++++++++++++--------
3 files changed, 55 insertions(+), 8 deletions(-)
---
diff --git a/libgssdp/gssdp-client.c b/libgssdp/gssdp-client.c
index 7ec9284..8a57483 100644
--- a/libgssdp/gssdp-client.c
+++ b/libgssdp/gssdp-client.c
@@ -42,6 +42,7 @@
#include "gssdp-client.h"
#include "gssdp-client-private.h"
+#include "gssdp-enums.h"
#include "gssdp-error.h"
#include "gssdp-socket-source.h"
#include "gssdp-protocol.h"
@@ -84,6 +85,7 @@ gssdp_client_initable_iface_init (gpointer g_iface,
struct _GSSDPClientPrivate {
char *server_id;
+ GSSDPUDAVersion uda_version;
GHashTable *user_agent_cache;
guint socket_ttl;
@@ -126,6 +128,7 @@ enum {
PROP_SOCKET_TTL,
PROP_MSEARCH_PORT,
PROP_ADDRESS_FAMILY,
+ PROP_UDA_VERSION,
};
enum {
@@ -317,6 +320,9 @@ gssdp_client_get_property (GObject *object,
case PROP_ADDRESS_FAMILY:
g_value_set_enum (value, priv->device.address_family);
break;
+ case PROP_UDA_VERSION:
+ g_value_set_enum (value, priv->uda_version);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -367,6 +373,9 @@ gssdp_client_set_property (GObject *object,
case PROP_ADDRESS_FAMILY:
priv->device.address_family = g_value_get_enum (value);
break;
+ case PROP_UDA_VERSION:
+ priv->uda_version = g_value_get_enum (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -603,6 +612,26 @@ gssdp_client_class_init (GSSDPClientClass *klass)
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
+ /**
+ * GSSDPClient:uda-version:
+ *
+ * The UPnP version the client adheres to.
+ *
+ * Since: 1.1.1
+ */
+ g_object_class_install_property
+ (object_class,
+ PROP_UDA_VERSION,
+ g_param_spec_enum
+ ("uda-version",
+ "UDA version",
+ "UPnP Device Architecture version on this client",
+ GSSDP_TYPE_UDA_VERSION,
+ GSSDP_UDA_VERSION_1_0,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
/**
* GSSDPClient::message-received: (skip)
* @client: The #GSSDPClient that received the message.
diff --git a/libgssdp/gssdp-client.h b/libgssdp/gssdp-client.h
index e4da9af..c552735 100644
--- a/libgssdp/gssdp-client.h
+++ b/libgssdp/gssdp-client.h
@@ -34,6 +34,19 @@ G_DECLARE_DERIVABLE_TYPE (GSSDPClient, gssdp_client, GSSDP, CLIENT, GObject)
typedef struct _GSSDPClient GSSDPClient;
typedef struct _GSSDPClientClass GSSDPClientClass;
+/**
+ * GSSDPUDAVersion:
+ * @GSSDP_UDA_VERSION_UNSPECIFIED: When creating a client, use the default version
+ * @GSSDP_UDA_VERSION_1_0: Use Version 1.0 of the UDA specification (UPnP/1.0)
+ * @GSSDP_UDA_VERSION_1_1: Use Version 1.1 of the UDA specification (UPnP/1.1)
+ */
+typedef enum /*< prefix=GSSDP_UDA_ >*/
+{
+ GSSDP_UDA_VERSION_UNSPECIFIED,
+ GSSDP_UDA_VERSION_1_0,
+ GSSDP_UDA_VERSION_1_1,
+} GSSDPUDAVersion;
+
struct _GSSDPClientClass {
GObjectClass parent_class;
diff --git a/libgssdp/meson.build b/libgssdp/meson.build
index 713951a..aa66def 100644
--- a/libgssdp/meson.build
+++ b/libgssdp/meson.build
@@ -1,11 +1,16 @@
-enums = gnome.mkenums('gssdp-enums', sources : 'gssdp-error.h',
- identifier_prefix : 'GSSDP',
- symbol_prefix : 'gssdp',
- c_template : 'gssdp-enums.c.template',
- h_template : 'gssdp-enums.h.template',
- install_header : true,
- install_dir : join_paths(get_option('includedir'), 'gssdp-1.2/libgssdp')
- )
+enums = gnome.mkenums(
+ 'gssdp-enums',
+ sources : [
+ 'gssdp-error.h',
+ 'gssdp-client.h'
+ ],
+ identifier_prefix : 'GSSDP',
+ symbol_prefix : 'gssdp',
+ c_template : 'gssdp-enums.c.template',
+ h_template : 'gssdp-enums.h.template',
+ install_header : true,
+ install_dir : join_paths(get_option('includedir'), 'gssdp-1.2/libgssdp')
+)
headers = files(
'gssdp-client.h',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]