3 * OBEX library with GLib integration
5 * Copyright (C) 2011 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 #include "gobex/gobex-defs.h"
30 #include "gobex/gobex-packet.h"
33 G_OBEX_TRANSPORT_STREAM,
34 G_OBEX_TRANSPORT_PACKET,
37 typedef struct _GObex GObex;
39 typedef void (*GObexFunc) (GObex *obex, GError *err, gpointer user_data);
40 typedef void (*GObexRequestFunc) (GObex *obex, GObexPacket *req,
42 typedef void (*GObexResponseFunc) (GObex *obex, GError *err, GObexPacket *rsp,
45 gboolean g_obex_send(GObex *obex, GObexPacket *pkt, GError **err);
47 guint g_obex_send_req(GObex *obex, GObexPacket *req, int timeout,
48 GObexResponseFunc func, gpointer user_data,
50 gboolean g_obex_cancel_req(GObex *obex, guint req_id,
51 gboolean remove_callback);
53 gboolean g_obex_send_rsp(GObex *obex, guint8 rspcode, GError **err,
54 guint first_hdr_type, ...);
56 void g_obex_set_disconnect_function(GObex *obex, GObexFunc func,
58 guint g_obex_add_request_function(GObex *obex, guint8 opcode,
59 GObexRequestFunc func,
61 gboolean g_obex_remove_request_function(GObex *obex, guint id);
63 void g_obex_suspend(GObex *obex);
64 void g_obex_resume(GObex *obex);
65 gboolean g_obex_srm_active(GObex *obex);
66 void g_obex_drop_tx_queue(GObex *obex);
68 GObex *g_obex_new(GIOChannel *io, GObexTransportType transport_type,
69 gssize rx_mtu, gssize tx_mtu);
71 GObex *g_obex_ref(GObex *obex);
72 void g_obex_unref(GObex *obex);
74 /* High level client functions */
76 guint g_obex_connect(GObex *obex, GObexResponseFunc func, gpointer user_data,
77 GError **err, guint first_hdr_id, ...);
79 guint g_obex_disconnect(GObex *obex, GObexResponseFunc func, gpointer user_data,
82 guint g_obex_setpath(GObex *obex, const char *path, GObexResponseFunc func,
83 gpointer user_data, GError **err);
85 guint g_obex_mkdir(GObex *obex, const char *path, GObexResponseFunc func,
86 gpointer user_data, GError **err);
88 guint g_obex_delete(GObex *obex, const char *name, GObexResponseFunc func,
89 gpointer user_data, GError **err);
91 guint g_obex_copy(GObex *obex, const char *name, const char *dest,
92 GObexResponseFunc func, gpointer user_data,
95 guint g_obex_move(GObex *obex, const char *name, const char *dest,
96 GObexResponseFunc func, gpointer user_data,
99 guint g_obex_abort(GObex *obex, GObexResponseFunc func, gpointer user_data,
102 /* Transfer related high-level functions */
104 guint g_obex_put_req(GObex *obex, GObexDataProducer data_func,
105 GObexFunc complete_func, gpointer user_data,
106 GError **err, guint first_hdr_id, ...);
108 guint g_obex_put_req_pkt(GObex *obex, GObexPacket *req,
109 GObexDataProducer data_func, GObexFunc complete_func,
110 gpointer user_data, GError **err);
112 guint g_obex_get_req(GObex *obex, GObexDataConsumer data_func,
113 GObexFunc complete_func, gpointer user_data,
114 GError **err, guint first_hdr_id, ...);
116 guint g_obex_get_req_pkt(GObex *obex, GObexPacket *req,
117 GObexDataConsumer data_func, GObexFunc complete_func,
118 gpointer user_data, GError **err);
120 guint g_obex_put_rsp(GObex *obex, GObexPacket *req,
121 GObexDataConsumer data_func, GObexFunc complete_func,
122 gpointer user_data, GError **err,
123 guint first_hdr_id, ...);
125 guint g_obex_get_rsp(GObex *obex, GObexDataProducer data_func,
126 GObexFunc complete_func, gpointer user_data,
127 GError **err, guint first_hdr_id, ...);
129 guint g_obex_get_rsp_pkt(GObex *obex, GObexPacket *rsp,
130 GObexDataProducer data_func, GObexFunc complete_func,
131 gpointer user_data, GError **err);
133 gboolean g_obex_cancel_transfer(guint id, GObexFunc complete_func,
136 const char *g_obex_strerror(guint8 err_code);
137 guint8 g_obex_errno_to_rsp(int err);
138 #ifdef TIZEN_FEATURE_BLUEZ_MODIFY
139 void g_obex_io_shutdown(GObex *obex);
142 #endif /* __GOBEX_H */