#include "gobex-packet.h"
+#define FINAL_BIT 0x80
+
struct _GObexPacket {
guint8 opcode;
gboolean final;
return NULL;
}
- final = (opcode & G_OBEX_PACKET_FINAL) ? TRUE : FALSE;
- opcode &= ~G_OBEX_PACKET_FINAL;
+ final = (opcode & FINAL_BIT) ? TRUE : FALSE;
+ opcode &= ~FINAL_BIT;
pkt = g_obex_packet_new(opcode, final);
buf[0] = pkt->opcode;
if (pkt->final)
- buf[0] |= G_OBEX_PACKET_FINAL;
+ buf[0] |= FINAL_BIT;
u16 = g_htons(pkt_len);
memcpy(&buf[1], &u16, sizeof(u16));
#define G_OBEX_OP_SESSION 0x07
#define G_OBEX_OP_ABORT 0x7f
-#define G_OBEX_PACKET_FINAL 0x80
-
typedef struct _GObexPacket GObexPacket;
GObexHeader *g_obex_packet_get_header(GObexPacket *pkt, guint8 id);
#define G_OBEX_MINIMUM_MTU 255
#define G_OBEX_MAXIMUM_MTU 65535
+#define FINAL_BIT 0x80
+
struct _GObex {
gint ref_count;
GIOChannel *io;
guint8 opcode = g_obex_packet_get_operation(p->pkt, NULL);
header_offset = req_header_offset(opcode);
} else {
- guint8 opcode = obex->rx_buf[0] & ~G_OBEX_PACKET_FINAL;
+ guint8 opcode = obex->rx_buf[0] & ~FINAL_BIT;
header_offset = rsp_header_offset(opcode);
}