return TRUE;
}
+GObexApparam *g_obex_header_get_apparam(GObexHeader *header)
+{
+ gboolean ret;
+ const guint8 *val;
+ gsize len;
+
+ ret = g_obex_header_get_bytes(header, &val, &len);
+ if (!ret)
+ return NULL;
+
+ return g_obex_apparam_decode(val, len);
+}
+
gboolean g_obex_header_get_uint8(GObexHeader *header, guint8 *val)
{
g_obex_debug(G_OBEX_DEBUG_HEADER, "header 0x%02x",
return header;
}
+GObexHeader *g_obex_header_new_apparam(GObexApparam *apparam)
+{
+ guint8 buf[1024];
+ gssize len;
+
+ len = g_obex_apparam_encode(apparam, buf, sizeof(buf));
+ if (len < 0)
+ return NULL;
+
+ return g_obex_header_new_bytes(G_OBEX_HDR_APPARAM, buf, len);
+}
+
GObexHeader *g_obex_header_new_uint8(guint8 id, guint8 val)
{
GObexHeader *header;
#include <glib.h>
#include <gobex/gobex-defs.h>
+#include <gobex/gobex-apparam.h>
/* Header ID's */
#define G_OBEX_HDR_INVALID 0x00
gsize *len);
gboolean g_obex_header_get_uint8(GObexHeader *header, guint8 *val);
gboolean g_obex_header_get_uint32(GObexHeader *header, guint32 *val);
+GObexApparam *g_obex_header_get_apparam(GObexHeader *header);
GObexHeader *g_obex_header_new_unicode(guint8 id, const char *str);
GObexHeader *g_obex_header_new_bytes(guint8 id, const void *data, gsize len);
GObexHeader *g_obex_header_new_uint8(guint8 id, guint8 val);
GObexHeader *g_obex_header_new_uint32(guint8 id, guint32 val);
+GObexHeader *g_obex_header_new_apparam(GObexApparam *apparam);
GSList *g_obex_header_create_list(guint8 first_hdr_id, va_list args,
gsize *total_len);