/*
 * libsyncml - A syncml protocol implementation
 * Copyright (C) 2005  Armin Bauer <armin.bauer@opensync.org>
 * Copyright (C) 2008-2009  Michael Bell <michael.bell@opensync.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 *
 */

#ifndef _OBEX_CLIENT_INTERNALS_H_
#define _OBEX_CLIENT_INTERNALS_H_

#include "obex_bluetooth.h"
#include <openobex/obex.h>

#ifndef WIN32
#include <termios.h>
#include <sys/ioctl.h>
#endif

#define STREAM_CHUNK 4096

typedef enum {
	SML_OBEX_VENDOR_UNKNOWN = 0,
	SML_OBEX_VENDOR_SAMSUNG = 1,
} SmlTransportObexVendorType;

typedef enum {
	SML_TRANSPORT_OBEX_DATASTORE_UNKNOWN = 0,
	SML_TRANSPORT_OBEX_DATASTORE_CONTACT = 1,
	SML_TRANSPORT_OBEX_DATASTORE_EVENT = 2,
	SML_TRANSPORT_OBEX_DATASTORE_NOTE = 3,
	SML_TRANSPORT_OBEX_DATASTORE_TODO = 4,
} SmlTransportObexDatastoreType;

typedef struct SmlTransportObexClientEnv {
	SmlTransportConnectionType type;
	SmlTransport *tsp;
	obex_t *obexhandle;
	guint32 connection_id;
	gchar *path;
	guint port;
	gchar *irda_service;
	gchar *at_command;
	gchar *manufacturer;
	gchar *model;
	GList *datastores;

	gint fd;
	gchar *databuf;
	gint *databuflen;
#ifndef WIN32
	struct termios oldtio;
#endif
	gboolean busy;
	gboolean error;
	SmlMimeType mimetype;
	SmlTransportState state;
} SmlTransportObexClientEnv;

gboolean smlTransportObexClientNew (SmlTransport *tsp, GError **error);

#endif //_OBEX_CLIENT_INTERNALS_H_
