{
GSList *l;
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
for (l = pkt->headers; l != NULL; l = g_slist_next(l)) {
GObexHeader *hdr = l->data;
{
GObexHeader *body;
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
body = g_obex_packet_get_header(pkt, G_OBEX_HDR_BODY);
if (body != NULL)
return body;
guint8 g_obex_packet_get_operation(GObexPacket *pkt, gboolean *final)
{
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
if (final)
*final = pkt->final;
gboolean g_obex_packet_prepend_header(GObexPacket *pkt, GObexHeader *header)
{
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
pkt->headers = g_slist_prepend(pkt->headers, header);
pkt->hlen += g_obex_header_get_length(header);
gboolean g_obex_packet_add_header(GObexPacket *pkt, GObexHeader *header)
{
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
pkt->headers = g_slist_append(pkt->headers, header);
pkt->hlen += g_obex_header_get_length(header);
gboolean g_obex_packet_add_body(GObexPacket *pkt, GObexDataProducer func,
gpointer user_data)
{
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
if (pkt->get_body != NULL)
return FALSE;
{
GObexHeader *hdr;
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
hdr = g_obex_header_new_unicode(id, str);
if (hdr == NULL)
return FALSE;
{
GObexHeader *hdr;
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
hdr = g_obex_header_new_bytes(id, data, len);
if (hdr == NULL)
return FALSE;
{
GObexHeader *hdr;
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
hdr = g_obex_header_new_uint8(id, val);
if (hdr == NULL)
return FALSE;
{
GObexHeader *hdr;
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
hdr = g_obex_header_new_uint32(id, val);
if (hdr == NULL)
return FALSE;
const void *g_obex_packet_get_data(GObexPacket *pkt, gsize *len)
{
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
if (pkt->data_len == 0) {
*len = 0;
return NULL;
gboolean g_obex_packet_set_data(GObexPacket *pkt, const void *data, gsize len,
GObexDataPolicy data_policy)
{
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
if (pkt->data.buf || pkt->data.buf_ref)
return FALSE;
{
GObexPacket *pkt;
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", opcode);
+
pkt = g_new0(GObexPacket, 1);
pkt->opcode = opcode;
GObexPacket *pkt;
va_list args;
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", opcode);
+
va_start(args, first_hdr_id);
pkt = g_obex_packet_new_valist(opcode, final, first_hdr_id, args);
va_end(args);
void g_obex_packet_free(GObexPacket *pkt)
{
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
switch (pkt->data_policy) {
case G_OBEX_DATA_INHERIT:
case G_OBEX_DATA_COPY:
{
const guint8 *buf = data;
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
while (len > 0) {
GObexHeader *header;
gsize parsed;
GObexPacket *pkt;
gboolean final;
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "");
+
if (data_policy == G_OBEX_DATA_INHERIT) {
g_set_error(err, G_OBEX_ERROR, G_OBEX_ERROR_INVALID_ARGS,
"Invalid data policy");
guint16 u16;
gssize ret;
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
if (len < 3)
return -ENOBUFS;
guint16 u16;
GSList *l;
+ g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode);
+
if (3 + pkt->data_len + pkt->hlen > len)
return -ENOBUFS;