2011-06-21 01:32:02 +08:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* OBEX library with GLib integration
|
|
|
|
*
|
|
|
|
* Copyright (C) 2011 Intel Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GOBEX_H
|
|
|
|
#define __GOBEX_H
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
2011-06-29 04:32:53 +08:00
|
|
|
#include <gobex/gobex-packet.h>
|
2011-06-26 06:02:48 +08:00
|
|
|
|
2011-06-27 21:54:59 +08:00
|
|
|
typedef enum {
|
|
|
|
G_OBEX_TRANSPORT_STREAM,
|
|
|
|
G_OBEX_TRANSPORT_PACKET,
|
|
|
|
} GObexTransportType;
|
|
|
|
|
2011-06-21 01:32:02 +08:00
|
|
|
typedef struct _GObex GObex;
|
2011-06-21 19:48:54 +08:00
|
|
|
|
2011-07-01 16:25:20 +08:00
|
|
|
typedef void (*GObexRequestFunc) (GObex *obex, GObexPacket *req,
|
|
|
|
gpointer user_data);
|
|
|
|
typedef void (*GObexDisconnectFunc) (GObex *obex, GError *err,
|
2011-06-27 16:06:48 +08:00
|
|
|
gpointer user_data);
|
2011-06-27 21:17:04 +08:00
|
|
|
typedef void (*GObexResponseFunc) (GObex *obex, GError *err, GObexPacket *rsp,
|
|
|
|
gpointer user_data);
|
2011-06-27 16:06:48 +08:00
|
|
|
|
2011-06-29 19:33:04 +08:00
|
|
|
gboolean g_obex_send(GObex *obex, GObexPacket *pkt, GError **err);
|
2011-06-27 16:06:48 +08:00
|
|
|
|
2011-06-29 23:30:18 +08:00
|
|
|
guint g_obex_send_req(GObex *obex, GObexPacket *req, gint timeout,
|
|
|
|
GObexResponseFunc func, gpointer user_data,
|
|
|
|
GError **err);
|
2011-06-30 05:26:19 +08:00
|
|
|
gboolean g_obex_cancel_req(GObex *obex, guint req_id,
|
|
|
|
gboolean remove_callback);
|
2011-06-27 21:17:04 +08:00
|
|
|
|
2011-07-01 16:25:20 +08:00
|
|
|
void g_obex_set_request_function(GObex *obex, GObexRequestFunc func,
|
|
|
|
gpointer user_data);
|
|
|
|
void g_obex_set_disconnect_function(GObex *obex, GObexDisconnectFunc func,
|
2011-06-29 17:20:42 +08:00
|
|
|
gpointer user_data);
|
|
|
|
|
2011-06-27 21:54:59 +08:00
|
|
|
GObex *g_obex_new(GIOChannel *io, GObexTransportType transport_type);
|
2011-06-21 01:32:02 +08:00
|
|
|
|
|
|
|
GObex *g_obex_ref(GObex *obex);
|
|
|
|
void g_obex_unref(GObex *obex);
|
|
|
|
|
|
|
|
#endif /* __GOBEX_H */
|