mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-16 16:54:38 +08:00
gobex/header: Add g_obex_header_new_tag function
This function can be used to set tag using GObexApparam as argument but for arbritary headers.
This commit is contained in:
parent
c7fece8847
commit
ab22fce6bb
@ -425,7 +425,7 @@ GObexHeader *g_obex_header_new_bytes(guint8 id, const void *data, gsize len)
|
||||
return header;
|
||||
}
|
||||
|
||||
GObexHeader *g_obex_header_new_apparam(GObexApparam *apparam)
|
||||
GObexHeader *g_obex_header_new_tag(guint8 id, GObexApparam *apparam)
|
||||
{
|
||||
guint8 buf[1024];
|
||||
gssize len;
|
||||
@ -434,7 +434,12 @@ GObexHeader *g_obex_header_new_apparam(GObexApparam *apparam)
|
||||
if (len < 0)
|
||||
return NULL;
|
||||
|
||||
return g_obex_header_new_bytes(G_OBEX_HDR_APPARAM, buf, len);
|
||||
return g_obex_header_new_bytes(id, buf, len);
|
||||
}
|
||||
|
||||
GObexHeader *g_obex_header_new_apparam(GObexApparam *apparam)
|
||||
{
|
||||
return g_obex_header_new_tag(G_OBEX_HDR_APPARAM, apparam);
|
||||
}
|
||||
|
||||
GObexHeader *g_obex_header_new_uint8(guint8 id, guint8 val)
|
||||
|
@ -85,6 +85,7 @@ 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_tag(guint8 id, GObexApparam *apparam);
|
||||
GObexHeader *g_obex_header_new_apparam(GObexApparam *apparam);
|
||||
|
||||
GSList *g_obex_header_create_list(guint8 first_hdr_id, va_list args,
|
||||
|
Loading…
Reference in New Issue
Block a user