summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2015-06-14 14:06:13 +0200
committerJens Georg <mail@jensge.org>2015-06-14 14:06:13 +0200
commit899118659c76e692df1f90b981e5faac485c1eb6 (patch)
tree6a9d5415d757519edba1fa43cb2e3bde918befa7 /src
parentde0d3e726e0bc16ce22a6fa543c8c23b903779c2 (diff)
downloadgupnp-tools-899118659c76e692df1f90b981e5faac485c1eb6.tar.gz
network-light: Use UUID function from GUPnP
Signed-off-by: Jens Georg <mail@jensge.org>
Diffstat (limited to 'src')
-rw-r--r--src/network-light/upnp.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/network-light/upnp.c b/src/network-light/upnp.c
index f1c93bf..ca55de6 100644
--- a/src/network-light/upnp.c
+++ b/src/network-light/upnp.c
@@ -26,12 +26,6 @@
#include <locale.h>
#include <string.h>
#include <gmodule.h>
-#ifndef G_OS_WIN32
-#include <uuid/uuid.h>
-#else
-#include <rpc.h>
-typedef UUID uuid_t;
-#endif
#include <glib/gstdio.h>
#include "gui.h"
@@ -59,7 +53,7 @@ static GList *dimming_proxies;
static GUPnPXMLDoc *doc;
static char *desc_location;
-static char uuid[37];
+static char *uuid;
void
on_get_status (GUPnPService *service,
@@ -386,23 +380,10 @@ xml_util_get_element (xmlNode *node,
static void init_uuid (void)
{
- uuid_t uuid_context;
xmlNode *uuid_node;
char *udn;
-#ifndef G_OS_WIN32
- uuid_generate (uuid_context);
- uuid_unparse (uuid_context, uuid);
-#else
- {
- gchar *tmp_uuid;
- UuidCreate(&uuid_context);
- UuidToString(&uuid_context, &tmp_uuid);
- memcpy(uuid, tmp_uuid, 36);
- RpcStringFree(&tmp_uuid);
- }
-#endif
-
+ uuid = gupnp_get_uuid ();
uuid_node = xml_util_get_element ((xmlNode *) doc->doc,
"root",
"device",
@@ -778,5 +759,7 @@ deinit_upnp (void)
if (g_remove (desc_location) != 0)
g_warning ("error removing %s\n", desc_location);
g_free (desc_location);
+ g_free (uuid);
+ uuid = NULL;
}