Hendrik Sattler | 27 Jul 2011 18:53
Picon

Summary of all current patches

Hi,

this is a list of all the patches pending on my side. It also include Iain's
patches to make it easier.

 <at> Johan:
You can find all of these patches in my gitorious repository in the "testing"
branch and I really recommend pull from there! (git am has its issues when
files with DOS-style line-endings are involved). I will not be available almost
all of August, so can be get this in before then?

Patches 1-11 and 50 are strictly needed.

Patches 22-46 are the rework of the state machine. The intention is to utilize
non-blocking sockets and remove a lot of internal hacks (e.g. the current abort
and resume code).

With small adaptions, there is nothing that prevents an application being able
to support v1.5 and v2.0.

HS

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 03/52] Fix up bt_addr_t definition

From: Iain Hibbert <plunky <at> netbsd.org>

We need to detect the presence of "Bluetooth Device Address" type
in order to provide the BtOBEX_ function prototypes, which needs
to be from a header included prior to <openobex/obex.h>
---
 include/openobex/obex.h |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/include/openobex/obex.h b/include/openobex/obex.h
index 1e9e0d7..6dda861 100644
--- a/include/openobex/obex.h
+++ b/include/openobex/obex.h
 <at>  <at>  -131,18 +131,25  <at>  <at>  OPENOBEX_SYMBOL(int) IrOBEX_TransportConnect(obex_t *self, const char *service);
  * Bluetooth OBEX API
  */
 #if !defined(bt_addr_t)
-#  if defined(SOL_RFCOMM)
-#    if defined(_WIN32) /* Windows */
-#      define bt_addr_t BTH_ADDR
-#    else /* Linux, FreeBSD, NetBSD */
-#      define bt_addr_t bdaddr_t
+#  if defined(_WIN32)
+#    if defined(BTH_ADDR_NULL)
+#      define bt_addr_t	BTH_ADDR
+#    endif
+#  elif defined(__FreeBSD__)
+#    if defined(NG_HCI_BDADDR_ANY)
+#      define bt_addr_t	bdaddr_t
+#    endif
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 05/52] Don't use BEFORE for include path

From: Iain Hibbert <plunky <at> netbsd.org>

---
 lib/CMakeLists.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 0110db4..6efa6d0 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
 <at>  <at>  -106,7 +106,7  <at>  <at>  if ( OPENOBEX_USB )
   list ( APPEND openobex_LIBRARIES
     ${LibUSB_LIBRARIES}
   )
-  include_directories ( BEFORE SYSTEM ${LibUSB_INCLUDE_DIRS} )
+  include_directories ( SYSTEM ${LibUSB_INCLUDE_DIRS} )
   if ( LibUSB_VERSION_1.0 )
     list ( APPEND SOURCES
       usb1obex.c
--

-- 
1.7.5.4

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 01/52] Use bt_addr_t type consistently for BtOBEX_ functions

From: Iain Hibbert <plunky <at> netbsd.org>

---
 lib/obex.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/obex.c b/lib/obex.c
index 165fcb8..5e5fb31 100644
--- a/lib/obex.c
+++ b/lib/obex.c
 <at>  <at>  -1058,7 +1058,7  <at>  <at>  int CALLAPI IrOBEX_TransportConnect(obex_t *self, const char *service)
 	An easier server function to use for Bluetooth (Bluetooth OBEX) only.
  */
 LIB_SYMBOL
-int CALLAPI BtOBEX_ServerRegister(obex_t *self, bdaddr_t *src, uint8_t channel)
+int CALLAPI BtOBEX_ServerRegister(obex_t *self, bt_addr_t *src, uint8_t channel)
 {
 	DEBUG(3, "\n");

 <at>  <at>  -1085,8 +1085,8  <at>  <at>  int CALLAPI BtOBEX_ServerRegister(obex_t *self, bdaddr_t *src, uint8_t channel)
 	An easier connect function to use for Bluetooth (Bluetooth OBEX) only.
  */
 LIB_SYMBOL
-int CALLAPI BtOBEX_TransportConnect(obex_t *self, bdaddr_t *src,
-					bdaddr_t *dst, uint8_t channel)
+int CALLAPI BtOBEX_TransportConnect(obex_t *self, bt_addr_t *src,
+					bt_addr_t *dst, uint8_t channel)
 {
 	DEBUG(4, "\n");

(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 02/52] Use const for bt_addr_t in BtOBEX_ functions

From: Iain Hibbert <plunky <at> netbsd.org>

(For NetBSD at least, the BDADDR_ANY that is passed to
these functions is defined as a const)
---
 include/openobex/obex.h |    4 ++--
 lib/obex.c              |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/openobex/obex.h b/include/openobex/obex.h
index f948113..1e9e0d7 100644
--- a/include/openobex/obex.h
+++ b/include/openobex/obex.h
 <at>  <at>  -141,8 +141,8  <at>  <at>  OPENOBEX_SYMBOL(int) IrOBEX_TransportConnect(obex_t *self, const char *service);
 #    define bt_addr_t unsigned long
 #  endif
 #endif
-OPENOBEX_SYMBOL(int) BtOBEX_ServerRegister(obex_t *self, bt_addr_t *src, uint8_t channel);
-OPENOBEX_SYMBOL(int) BtOBEX_TransportConnect(obex_t *self, bt_addr_t *src, bt_addr_t *dst,
uint8_t channel);
+OPENOBEX_SYMBOL(int) BtOBEX_ServerRegister(obex_t *self, const bt_addr_t *src, uint8_t channel);
+OPENOBEX_SYMBOL(int) BtOBEX_TransportConnect(obex_t *self, const bt_addr_t *src, const bt_addr_t
*dst, uint8_t channel);

 /*
  * OBEX File API
diff --git a/lib/obex.c b/lib/obex.c
index 5e5fb31..874cfcd 100644
--- a/lib/obex.c
+++ b/lib/obex.c
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 04/52] Remove spurious ;

From: Iain Hibbert <plunky <at> netbsd.org>

---
 lib/customtrans.c |    2 +-
 lib/inobex.c      |    2 +-
 lib/irobex.c      |    2 +-
 lib/obex_object.c |    2 +-
 lib/usb1obex.c    |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/customtrans.c b/lib/customtrans.c
index 0040550..20e264c 100644
--- a/lib/customtrans.c
+++ b/lib/customtrans.c
 <at>  <at>  -115,4 +115,4  <at>  <at>  int custom_register(obex_t *self, const obex_ctrans_t *in)
 void custom_get_ops(struct obex_transport_ops* ops)
 {
 	ops->clone = &custom_clone;
-};
+}
diff --git a/lib/inobex.c b/lib/inobex.c
index d7a450a..4ae2b61 100644
--- a/lib/inobex.c
+++ b/lib/inobex.c
 <at>  <at>  -410,4 +410,4  <at>  <at>  void inobex_get_ops(struct obex_transport_ops* ops)
 	ops->server.disconnect = &inobex_disconnect_server;
 	ops->client.connect = &inobex_connect_request;
 	ops->client.disconnect = &inobex_disconnect_request;
-};
+}
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 07/52] Add function buf_empty() and use it to fix send bug

If non-blocking file descriptors or sockets are used, it can happen that
incomplete message get sent.
---
 lib/databuffer.c |    7 +++++++
 lib/databuffer.h |    1 +
 lib/obex_main.c  |    2 +-
 3 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/lib/databuffer.c b/lib/databuffer.c
index 1c43324..72bd4ca 100644
--- a/lib/databuffer.c
+++ b/lib/databuffer.c
 <at>  <at>  -113,6 +113,13  <at>  <at>  size_t buf_total_size(const buf_t *p)
 	return p->head_avail + p->data_avail + p->tail_avail + p->data_size;
 }

+int buf_empty(const buf_t *p)
+{
+	if (!p)
+		return 1;
+	return (p->data_size == 0);
+}
+
 void buf_resize(buf_t *p, size_t new_size)
 {
 	uint8_t *tmp;
diff --git a/lib/databuffer.h b/lib/databuffer.h
index f55a056..2ef8204 100644
--- a/lib/databuffer.h
+++ b/lib/databuffer.h
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 06/52] Fix spelling mistake

From: Iain Hibbert <plunky <at> netbsd.org>

---
 CMakeModules/FindBluetooth.cmake |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeModules/FindBluetooth.cmake b/CMakeModules/FindBluetooth.cmake
index a62032d..9d82a84 100644
--- a/CMakeModules/FindBluetooth.cmake
+++ b/CMakeModules/FindBluetooth.cmake
 <at>  <at>  -73,7 +73,7  <at>  <at>  elseif ( CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" )
   mark_as_advanced ( Bluetooth_LIBRARIES )

   if ( Bluetooth_INCLUDE_DIRS )
-    set ( CMAKE_REQUIRED_INCLUDES ${Bluetooth_INLUDE_DIRS} )
+    set ( CMAKE_REQUIRED_INCLUDES ${Bluetooth_INCLUDE_DIRS} )
     CHECK_C_SOURCE_COMPILES (
       "#include <bluetooth.h>
        int main () {
 <at>  <at>  -102,7 +102,7  <at>  <at>  elseif ( CMAKE_SYSTEM_NAME STREQUAL "NetBSD" )
   mark_as_advanced ( Bluetooth_LIBRARIES )

   if ( Bluetooth_INCLUDE_DIRS )
-    set ( CMAKE_REQUIRED_INCLUDES ${Bluetooth_INLUDE_DIRS} )
+    set ( CMAKE_REQUIRED_INCLUDES ${Bluetooth_INCLUDE_DIRS} )
     CHECK_C_SOURCE_COMPILES (
       "#include <bluetooth.h>
        int main () {
--

-- 
1.7.5.4
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 09/52] Fix behaviour of STREAM send functionality

---
 lib/obex_object.c |   35 ++++++++++++++++-------------------
 1 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/lib/obex_object.c b/lib/obex_object.c
index 2773789..3fcd10a 100644
--- a/lib/obex_object.c
+++ b/lib/obex_object.c
 <at>  <at>  -307,7 +307,7  <at>  <at>  static int send_stream(obex_t *self,
 	actual = sizeof(*hdr);

 	do {
-		if (object->s_len == 0) {
+		if (object->s_len == 0 && !object->s_stop) {
 			/* Ask app for more data if no more */
 			object->s_offset = 0;
 			object->s_buf = NULL;
 <at>  <at>  -315,20 +315,9  <at>  <at>  static int send_stream(obex_t *self,
 								0, FALSE);
 			DEBUG(4, "s_len=%d, s_stop = %d\n",
 						object->s_len, object->s_stop);
-			/* End of stream ?*/
-			if (object->s_stop)
-				break;
-
-			/* User suspended and didn't provide any new data */
-			if (object->suspend && object->s_buf == NULL)
-				break;
-
-			/* Error ?*/
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 08/52] Fix BODY_END header and its debug message

---
 lib/obex_object.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/obex_object.c b/lib/obex_object.c
index 395c5ff..2773789 100644
--- a/lib/obex_object.c
+++ b/lib/obex_object.c
 <at>  <at>  -412,12 +412,14  <at>  <at>  static int send_body(obex_object_t *object, struct obex_header_element *h,
 		/* We have completely filled the tx-buffer */
 		actual = tx_left;
 	} else {
-		DEBUG(4, "Add BODY_END header\n");
-
-		if (slist_has_more(object->tx_headerq))
-			hdr->hi = OBEX_HDR_BODY_END;
-		else
+		if (slist_has_more(object->tx_headerq)) {
+			DEBUG(4, "Add BODY header\n");
 			hdr->hi = OBEX_HDR_BODY;
+		} else {
+			DEBUG(4, "Add BODY_END header\n");
+			hdr->hi = OBEX_HDR_BODY_END;
+		}
+
 		hdr->hl = htons((uint16_t)(h->buf->data_size + sizeof(*hdr)));
 		buf_insert_end(txmsg, h->buf->data, h->buf->data_size);
 		actual = h->buf->data_size;
--

-- 
1.7.5.4
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 49/52] Remove unused defines

---
 lib/fdobex.c         |    3 ---
 lib/obex_transport.c |    3 ---
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/lib/fdobex.c b/lib/fdobex.c
index e057562..356b5a9 100644
--- a/lib/fdobex.c
+++ b/lib/fdobex.c
 <at>  <at>  -28,9 +28,6  <at>  <at> 
 #include <unistd.h>
 #if defined(_WIN32)
 #include <io.h>
-#ifndef ETIMEDOUT
-#define ETIMEDOUT WSAETIMEDOUT
-#endif
 #endif

 static int fdobex_init(obex_t *self)
diff --git a/lib/obex_transport.c b/lib/obex_transport.c
index 1c03baa..b25539e 100644
--- a/lib/obex_transport.c
+++ b/lib/obex_transport.c
 <at>  <at>  -35,9 +35,6  <at>  <at> 

 #if defined(_WIN32)
 #include <io.h>
-#ifndef ETIMEDOUT
-#define ETIMEDOUT WSAETIMEDOUT
-#endif
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 33/52] Use GNUInstallDirs.cmake

The cmake build files used some self-named variables or fixed value. Replace
them by the new GNUInstallDirs.cmake that introduces variables as defined for
GNU autotools.
---
 CMakeLists.txt                |   21 +++++----------------
 apps/CMakeLists.txt           |    2 +-
 apps/ircp/CMakeLists.txt      |    2 +-
 apps/obex_test/CMakeLists.txt |    2 +-
 doc/CMakeLists.txt            |    6 +++---
 lib/CMakeLists.txt            |    8 ++++----
 udev/CMakeLists.txt           |    8 ++++----
 7 files changed, 19 insertions(+), 30 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5a2bde4..fe1d8d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
 <at>  <at>  -1,4 +1,4  <at>  <at> 
-cmake_minimum_required ( VERSION 2.6.3 FATAL_ERROR )
+cmake_minimum_required ( VERSION 2.8.5 FATAL_ERROR )

 project ( openobex C )

 <at>  <at>  -31,6 +31,7  <at>  <at>  if ( NOT CMAKE_BUILD_TYPE )
 endif ( NOT CMAKE_BUILD_TYPE )

 include ( MaintainerMode )
+include ( GNUInstallDirs )

 #
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 38/52] Rename OBEX_HandleInput

The substates create situations where this function name doesn't fit anymore.
To avoid confusion, it is renamed to OBEX_Work(). The timeout argument is
now in milliseconds, the previous argument was in seconds which may be not
fine enough.
---
 doc/openobex.coverpage        |    2 +-
 include/openobex/obex.h       |    3 ++-
 include/openobex/obex_const.h |    2 +-
 lib/fdobex.c                  |   10 ++++++++--
 lib/obex.c                    |    6 +++---
 lib/obex.sym                  |    2 +-
 lib/obex_main.c               |    2 +-
 lib/obex_main.h               |    2 +-
 lib/obex_transport.c          |   12 +++++++++---
 lib/obex_transport.h          |    4 ++--
 lib/usb1obex.c                |    6 +++---
 lib/usbobex.c                 |    6 +++---
 12 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/doc/openobex.coverpage b/doc/openobex.coverpage
index 1f7715b..d90075f 100644
--- a/doc/openobex.coverpage
+++ b/doc/openobex.coverpage
 <at>  <at>  -35,7 +35,7  <at>  <at>  First of all you must create an OBEX instance by calling #OBEX_New.
 In this call you specify what transport you want to use, an event callback, and optional flags.
 #OBEX_New will return a handle which shall be passed to almost all other functions.

-To let the parser do some work you must call #OBEX_HandleInput.
+To let the parser do some work you must call #OBEX_Work.
 It will block for at-most the specified timeout for read and write actions.
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 31/52] Add new STATE_ABORT

The old way of aborting objects does not work anymore, neither with SRM nor
with the new possibilities of incomplete writes, as that may break the
synchronisation between server and client.
This patch integrates the abort action right within the affected states.
---
 lib/defines.h     |    1 +
 lib/obex_client.c |  126 ++++++++++++++++++++++++++++++++++++++++-------------
 lib/obex_main.c   |   35 ++-------------
 lib/obex_server.c |   91 +++++++++++++++++++++++++++++++++-----
 4 files changed, 179 insertions(+), 74 deletions(-)

diff --git a/lib/defines.h b/lib/defines.h
index eb2257b..5935930 100644
--- a/lib/defines.h
+++ b/lib/defines.h
 <at>  <at>  -27,6 +27,7  <at>  <at>  enum obex_state {
 	STATE_IDLE,
 	STATE_SEND,
 	STATE_REC,
+	STATE_ABORT,
 };

 enum obex_substate {
diff --git a/lib/obex_client.c b/lib/obex_client.c
index c8dc843..efaf9f3 100644
--- a/lib/obex_client.c
+++ b/lib/obex_client.c
 <at>  <at>  -49,6 +49,61  <at>  <at>  static __inline uint16_t msg_get_len(const buf_t *msg)
 		return 0;
 }
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 42/52] Add new option '-f' to obex_test

---
 apps/obex_test/obex_test.c        |   85 ++++++++++++++++++++++++-------------
 apps/obex_test/obex_test_client.c |    6 ---
 2 files changed, 55 insertions(+), 36 deletions(-)

diff --git a/apps/obex_test/obex_test.c b/apps/obex_test/obex_test.c
index 8142d4b..96e16fa 100644
--- a/apps/obex_test/obex_test.c
+++ b/apps/obex_test/obex_test.c
 <at>  <at>  -166,6 +166,8  <at>  <at>  int main (int argc, char *argv[])
 	int tcpobex = FALSE;
 	obex_t *handle = NULL;
 	struct context global_context = {0};
+	unsigned int flags = 0;
+	int i = 1;

 #ifdef HAVE_BLUETOOTH
 	int btobex = 0;
 <at>  <at>  -187,6 +189,7  <at>  <at>  int main (int argc, char *argv[])
 			"Usage: obex_test [options]\n"
 			"\n"
 			"Options:\n"
+			"    -f [flags]        Set some flags: n=non-blocking\n"
 #ifdef HAVE_CABLE_OBEX
 			"    -s [tty]          Use cable transport (Sony-Ericsson phones/DCU-11 cable)\n"
 			"    -r [tty]          Use cable transport for R320\n"
 <at>  <at>  -206,31 +209,51  <at>  <at>  int main (int argc, char *argv[])
 		return 0;
 	}

(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 46/52] Fix abort behaviour

---
 lib/obex_client.c |   27 ++++++++++++++-------------
 lib/obex_object.c |    8 --------
 lib/obex_server.c |   21 ++++++++++++---------
 3 files changed, 26 insertions(+), 30 deletions(-)

diff --git a/lib/obex_client.c b/lib/obex_client.c
index 0282886..9d07c29 100644
--- a/lib/obex_client.c
+++ b/lib/obex_client.c
 <at>  <at>  -338,21 +338,22  <at>  <at>  static int obex_client_send(obex_t *self)
 		 * PUT).
 		 * No headeroffset needed because 'connect' is single
 		 * packet (or we deny it). */
-		ret = -1;
-		if (self->object->opcode == OBEX_CMD_CONNECT)
-			ret = obex_object_receive(self, msg);
-		if (ret < 0) {
-			obex_deliver_event(self, OBEX_EV_PARSEERR,
+		if (!self->object->abort) {
+			ret = -1;
+			if (self->object->opcode != OBEX_CMD_CONNECT)
+				ret = obex_object_receive(self, msg);
+			if (ret < 0) {
+				obex_deliver_event(self, OBEX_EV_PARSEERR,
 						 self->object->opcode, 0, TRUE);
-			self->mode = OBEX_MODE_SERVER;
-			self->state = STATE_IDLE;
-			return -1;
+				self->mode = OBEX_MODE_SERVER;
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 24/52] Remove the checked obex_object member

The member can be replaced by a rather static usage of a new parameter to
obex_server_recv().
---
 lib/obex_object.h |    1 -
 lib/obex_server.c |   10 ++++------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/lib/obex_object.h b/lib/obex_object.h
index eef3458..5bcbe0b 100644
--- a/lib/obex_object.h
+++ b/lib/obex_object.h
 <at>  <at>  -71,7 +71,6  <at>  <at>  struct obex_object {
 	int totallen;			/* Size of all headers */
 	int abort;			/* Request shall be aborted */

-	int checked;			/* OBEX_EV_REQCHECK has been signaled */
 	enum obex_rsp_mode rsp_mode;	/* OBEX_RSP_MODE_* */

 	int suspend;			/* Temporarily stop transfering object */
diff --git a/lib/obex_server.c b/lib/obex_server.c
index 1902e4f..401a98d 100644
--- a/lib/obex_server.c
+++ b/lib/obex_server.c
 <at>  <at>  -137,7 +137,7  <at>  <at>  int obex_server_send(obex_t *self, buf_t *msg, int cmd, uint16_t len)
 	return 0;
 }

-static int obex_server_recv(obex_t *self, buf_t *msg, int final,
+static int obex_server_recv(obex_t *self, buf_t *msg, int first, int final,
 							int cmd, uint16_t len)
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 41/52] Convert all apps to new API

---
 apps/ircp/ircp_client.c           |   10 ++++++----
 apps/ircp/ircp_server.c           |   11 ++++++-----
 apps/irobex_palm3.c               |    4 ++--
 apps/irxfer.c                     |    4 ++--
 apps/lib/obex_put_common.c        |    5 +++--
 apps/lib/obex_put_common.h        |    4 ++--
 apps/obex_find.c                  |    7 ++++---
 apps/obex_tcp.c                   |    4 ++--
 apps/obex_test/obex_test.c        |   19 ++++++++++---------
 apps/obex_test/obex_test_client.c |    2 +-
 apps/obex_test/obex_test_server.c |    2 +-
 udev/obex-check-device.c          |    7 ++++---
 12 files changed, 43 insertions(+), 36 deletions(-)

diff --git a/apps/ircp/ircp_client.c b/apps/ircp/ircp_client.c
index 9035c2c..ed49096 100644
--- a/apps/ircp/ircp_client.c
+++ b/apps/ircp/ircp_client.c
 <at>  <at>  -87,7 +87,9  <at>  <at>  static int cli_fillstream(ircp_client_t *cli, obex_object_t *object)
 //
 // Incoming event from OpenOBEX.
 //
-static void cli_obex_event(obex_t *handle, obex_object_t *object, int mode, int event, int obex_cmd,
int obex_rsp)
+static void cli_obex_event(obex_t *handle, obex_object_t *object,
+			   enum obex_mode mode, enum obex_event event,
+			   uint8_t obex_cmd, uint8_t obex_rsp)
 {
 	ircp_client_t *cli;
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 13/52] Add Bluetooth L2CAP tranport

Note that the transport only works on Linux. Although it also compiles on
Windows, the operating system itself does not support it. FreeBSD and NetBSD do
not seem to support ERTM, yet. The code for the last two is not compile-tested.
---
 include/openobex/obex.h       |    4 +-
 include/openobex/obex_const.h |    3 +-
 lib/CMakeLists.txt            |    1 +
 lib/Makefile.am               |    3 +-
 lib/bluez_compat.h            |   18 +++-
 lib/btobex.c                  |   24 +++-
 lib/btobex.h                  |   11 ++-
 lib/btobex_l2cap.c            |  315 +++++++++++++++++++++++++++++++++++++++++
 lib/obex.c                    |   16 ++-
 lib/obex_main.c               |   20 +++
 lib/obex_main.h               |    1 +
 lib/obex_transport.c          |    4 +
 12 files changed, 403 insertions(+), 17 deletions(-)
 create mode 100644 lib/btobex_l2cap.c

diff --git a/include/openobex/obex.h b/include/openobex/obex.h
index 6dda861..6bf91d4 100644
--- a/include/openobex/obex.h
+++ b/include/openobex/obex.h
 <at>  <at>  -147,8 +147,8  <at>  <at>  OPENOBEX_SYMBOL(int) IrOBEX_TransportConnect(obex_t *self, const char *service);
 #endif

 #if defined(bt_addr_t)
-OPENOBEX_SYMBOL(int) BtOBEX_ServerRegister(obex_t *self, const bt_addr_t *src, uint8_t channel);
-OPENOBEX_SYMBOL(int) BtOBEX_TransportConnect(obex_t *self, const bt_addr_t *src, const bt_addr_t
*dst, uint8_t channel);
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 37/52] Add new event callback with stricter types

To be backward compatible, the old obex_event_t callback type is still
supported but the documentation only refers to the new type and its functions.
---
 doc/openobex.coverpage  |   20 +----
 include/openobex/obex.h |   44 ++++++++++--
 lib/obex.c              |  185 ++++++++++++++++++++++-------------------------
 lib/obex.sym            |    3 +
 lib/obex_main.c         |  111 +++++++++++++++++++++++++++-
 lib/obex_main.h         |    6 ++-
 6 files changed, 246 insertions(+), 123 deletions(-)

diff --git a/doc/openobex.coverpage b/doc/openobex.coverpage
index 1f75eb4..1f7715b 100644
--- a/doc/openobex.coverpage
+++ b/doc/openobex.coverpage
 <at>  <at>  -31,9 +31,9  <at>  <at>  You might also find the OpenOBEX test applications useful.

 To be able to use the OpenOBEX API you must include the files openobex/obex_const.h and openobex/obex.h.

-First of all you must create an OBEX instance by calling #OBEX_Init.
+First of all you must create an OBEX instance by calling #OBEX_New.
 In this call you specify what transport you want to use, an event callback, and optional flags.
-#OBEX_Init will return a handle which shall be passed to almost all other functions.
+#OBEX_New will return a handle which shall be passed to almost all other functions.

 To let the parser do some work you must call #OBEX_HandleInput.
 It will block for at-most the specified timeout for read and write actions.
 <at>  <at>  -41,19 +41,7  <at>  <at>  You can call #OBEX_GetFD if you want to do select() yourself (this may not work

 	\subsection callback_sec The event callback
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 10/52] Fix reading user input in obex_test

---
 apps/obex_test/obex_test.c        |   12 ++++---
 apps/obex_test/obex_test_client.c |   61 ++++++++++++++++++++++--------------
 2 files changed, 44 insertions(+), 29 deletions(-)

diff --git a/apps/obex_test/obex_test.c b/apps/obex_test/obex_test.c
index 4200f9b..350d808 100644
--- a/apps/obex_test/obex_test.c
+++ b/apps/obex_test/obex_test.c
 <at>  <at>  -153,8 +153,8  <at>  <at>  static int inet_connect(obex_t *handle)
 //
 int main (int argc, char *argv[])
 {
-	char cmd[10];
-	int num, end = 0;
+	char cmd[3];
+	int end = 0;
 	int cobex = FALSE, tcpobex = FALSE, btobex = FALSE, r320 = FALSE, usbobex = FALSE;
 	obex_t *handle;
 #ifdef HAVE_BLUETOOTH
 <at>  <at>  -350,10 +350,12  <at>  <at>  int main (int argc, char *argv[])

 	while (!end) {
 		printf("> ");
-		num = scanf("%s", cmd);
-		if (num == EOF)
+		fflush(stdout);
+		(void)fgets(cmd, sizeof(cmd), stdin);
+		if (cmd[0] == 0) /* EOF */
 			break;
(Continue reading)

Johan Hedberg | 29 Jul 2011 10:07
Picon
Gravatar

Re: [PATCH 10/52] Fix reading user input in obex_test

Hi Hendrik,

On Wed, Jul 27, 2011, Hendrik Sattler wrote:
> ---
>  apps/obex_test/obex_test.c        |   12 ++++---
>  apps/obex_test/obex_test_client.c |   61 ++++++++++++++++++++++--------------
>  2 files changed, 44 insertions(+), 29 deletions(-)

Patches 1-9 have been applied, but this one has issues (though in
general these two c-files are a total mess as far as coding style and
whitespace is concerned).

> diff --git a/apps/obex_test/obex_test.c b/apps/obex_test/obex_test.c
> index 4200f9b..350d808 100644
> --- a/apps/obex_test/obex_test.c
> +++ b/apps/obex_test/obex_test.c
>  <at>  <at>  -153,8 +153,8  <at>  <at>  static int inet_connect(obex_t *handle)
>  //
>  int main (int argc, char *argv[])
>  {
> -	char cmd[10];
> -	int num, end = 0;
> +	char cmd[3];
> +	int end = 0;
>  	int cobex = FALSE, tcpobex = FALSE, btobex = FALSE, r320 = FALSE, usbobex = FALSE;
>  	obex_t *handle;
>  #ifdef HAVE_BLUETOOTH
>  <at>  <at>  -350,10 +350,12  <at>  <at>  int main (int argc, char *argv[])
>  
>  	while (!end) {
(Continue reading)

Hendrik Sattler | 31 Jul 2011 22:29
Picon

[PATCH v2] Fix reading user input in obex_test

V2:
    - add function read_input() and uses it to print the prompt and read the
      user input

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
Hendrik Sattler | 31 Jul 2011 22:29
Picon

[PATCH] Fix reading user input in obex_test

---
 apps/obex_test/obex_test.c        |   26 ++++++++++++++++-----
 apps/obex_test/obex_test.h        |    1 +
 apps/obex_test/obex_test_client.c |   44 +++++++++++++-----------------------
 3 files changed, 37 insertions(+), 34 deletions(-)

diff --git a/apps/obex_test/obex_test.c b/apps/obex_test/obex_test.c
index 4200f9b..9336e2a 100644
--- a/apps/obex_test/obex_test.c
+++ b/apps/obex_test/obex_test.c
 <at>  <at>  -49,6 +49,7  <at>  <at>  bdaddr_t bluez_compat_bdaddr_any = { BTH_ADDR_NULL };
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+#include <stdarg.h>

 #ifndef in_addr_t
 #define in_addr_t unsigned long
 <at>  <at>  -107,6 +108,21  <at>  <at>  static void obex_event(obex_t *handle, obex_object_t *object, int mode,
 	}
 }

+int read_input(char *answer, size_t size, const char *question, ...)
+{
+	va_list ap;
+	va_start(ap, question);
+	vfprintf(stdout, question, ap);
+	va_end(ap);
+
+	fflush(stdout);
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 12/52] Prepare for the addition of the Bluetooth L2CAP transport

---
 lib/bluez_compat.h   |    2 +-
 lib/btobex.c         |   45 +++++++++++++++++++++++++++------------------
 lib/btobex.h         |    6 +++++-
 lib/obex_transport.h |    2 +-
 4 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/lib/bluez_compat.h b/lib/bluez_compat.h
index 3f36cd7..c8b046c 100644
--- a/lib/bluez_compat.h
+++ b/lib/bluez_compat.h
 <at>  <at>  -36,7 +36,7  <at>  <at> 
 #define rc_bdaddr   btAddr
 #define rc_channel  port
 #define PF_BLUETOOTH   PF_BTH
-#define AF_BLUETOOTH   PF_BLUETOOTH
+#define AF_BLUETOOTH   AF_BTH
 #define BTPROTO_RFCOMM BTHPROTO_RFCOMM
 /* TODO: should be const */
 extern bdaddr_t bluez_compat_bdaddr_any;
diff --git a/lib/btobex.c b/lib/btobex.c
index 749fefb..810ce91 100644
--- a/lib/btobex.c
+++ b/lib/btobex.c
 <at>  <at>  -32,10 +32,7  <at>  <at> 
 /* Linux/FreeBSD/NetBSD case */

 #include <string.h>
-#include <unistd.h>
-#include <stdio.h>		/* perror */
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 52/52] Release version 2.0

---
 CMakeLists.txt |    4 ++--
 ChangeLog      |   17 +++++++++++++++++
 UPGRADING.txt  |   28 ++++++++++++++++++++++++++++
 configure.ac   |    2 +-
 4 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 UPGRADING.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fe1d8d5..6a98870 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
 <at>  <at>  -5,8 +5,8  <at>  <at>  project ( openobex C )
 #
 # The project version
 #
-set ( VERSION_MAJOR 1 )
-set ( VERSION_MINOR 6 )
+set ( VERSION_MAJOR 2 )
+set ( VERSION_MINOR 0 )
 set ( VERSION_PATCH 0 )
 set ( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}" )
 if ( VERSION_PATCH GREATER 0 )
diff --git a/ChangeLog b/ChangeLog
index fccdd41..517d347 100644
--- a/ChangeLog
+++ b/ChangeLog
 <at>  <at>  -1,3 +1,20  <at>  <at> 
+ver 2.0:
+	Add support for Obex-over-L2CAP (experimental)
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 16/52] Remove unused code in glib/

We never actually shipped the result from glib/ to be easily compilable, it has
no known dependencies.
---
 .gitignore                  |    6 -
 CMakeLists.txt              |   22 +-
 CMakeModules/FindGlib.cmake |   94 ----
 Makefile.am                 |    8 +-
 acinclude.m4                |   14 -
 configure.ac                |    3 +-
 glib/CMakeLists.txt         |  139 ------
 glib/Makefile.am            |   42 --
 glib/obex-client.c          |  589 -------------------------
 glib/obex-client.h          |  163 -------
 glib/obex-debug.h           |   28 --
 glib/obex-error.c           |  226 ----------
 glib/obex-error.h           |   31 --
 glib/obex-lowlevel.c        | 1014 -------------------------------------------
 glib/obex-lowlevel.h        |   50 ---
 glib/obex-marshal.list      |    1 -
 glib/test-client.c          |  237 ----------
 glib/test-lowlevel.c        |  104 -----
 openobex-glib.pc.in         |   12 -
 19 files changed, 8 insertions(+), 2775 deletions(-)
 delete mode 100644 CMakeModules/FindGlib.cmake
 delete mode 100644 glib/CMakeLists.txt
 delete mode 100644 glib/Makefile.am
 delete mode 100644 glib/obex-client.c
 delete mode 100644 glib/obex-client.h
 delete mode 100644 glib/obex-debug.h
 delete mode 100644 glib/obex-error.c
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 20/52] Update install instructions

---
 INSTALL.txt       |   10 +++-----
 INSTALL_Win32.txt |   54 ++++++++++++++++++++++++++--------------------------
 2 files changed, 31 insertions(+), 33 deletions(-)

diff --git a/INSTALL.txt b/INSTALL.txt
index 25b4fcd..88f7b38 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
 <at>  <at>  -1,16 +1,15  <at>  <at> 
 How to compile OpenObex
 =======================

-
 The compilation of OpenObex is done using CMake.
 The following OBEX transports are available:
  * Bluetooth (not all systems, see below)
  * Irda (not all systems, see below)
  * TCP
+ * USB
  * Custom transport
  * File descriptor

-
 The following operating systems are supported:
  * Linux [Bluetooth, Irda]
  * FreeBSD [Bluetooth]
 <at>  <at>  -32,7 +31,6  <at>  <at>  system, please see INSTALL_Win32.txt.
 [2]: at http://www.cmake.org

(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 22/52] Split sending object in three steps

There are now three steps for sending an object: a prepare step where a new
TX message is written to the TX buffer, a transmit step where the object
is transmitted and the decision step on wether the whole object is finished.
The goal is to allow sending incomplete message buffers on non-blocking sockets.
---
 lib/obex_main.c   |   30 +++++++---
 lib/obex_main.h   |    4 +-
 lib/obex_object.c |  154 +++++++++++++++++++++++++++++++++++++----------------
 lib/obex_object.h |    5 ++
 4 files changed, 136 insertions(+), 57 deletions(-)

diff --git a/lib/obex_main.c b/lib/obex_main.c
index 1d39cd8..884c9e3 100644
--- a/lib/obex_main.c
+++ b/lib/obex_main.c
 <at>  <at>  -210,23 +210,20  <at>  <at>  void obex_response_request(obex_t *self, uint8_t opcode)
 	obex_return_if_fail(self != NULL);

 	msg = buf_reuse(self->tx_msg);
-
-	obex_data_request(self, msg, opcode | OBEX_FINAL);
+	obex_data_request_prepare(self, msg, opcode | OBEX_FINAL);
+	obex_data_request(self, msg);
 }

 /*
- * Function obex_data_request (self, opcode, cmd)
+ * Function obex_data_request_prepare (self, opcode, cmd)
  *
- *    Send response or command code along with optional headers/data.
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 18/52] Remove duplicate information from README

We don't need install instruction in the (usually installed by distributions)
README file, that's what the INSTALL* files are for. The copyright information
in this file is non-sense, it belongs to the source files.
---
 README |   21 ---------------------
 1 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/README b/README
index ddbe0ab..e46e521 100644
--- a/README
+++ b/README
 <at>  <at>  -1,27 +1,6  <at>  <at> 
 OpenOBEX - Free implementation of the Object Exchange protocol
 **************************************************************
 
-Copyright (C) 1998-2000  Dag Brattli <dagb <at> cs.uit.no>
-Copyright (C) 1999-2000  Pontus Fuchs <pontus.fuchs <at> tactel.se>
-Copyright (C) 2001-2002  Jean Tourrilhes <jt <at> hpl.hp.com>
-Copyright (C) 2002-2008  Marcel Holtmann <marcel <at> holtmann.org>
-
-
-Compilation and installation
-============================
-
-In order to compile OpenOBEX you need following software packages:
-	- GCC compiler
-
-To configure run:
-	./configure --prefix=/usr
- 
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 27/52] Split and use substate in obex_client_send()

---
 lib/obex.c        |    8 +-
 lib/obex_client.c |  207 ++++++++++++++++++++++++++++++++--------------------
 lib/obex_client.h |    2 -
 lib/obex_main.c   |   36 +++++-----
 4 files changed, 148 insertions(+), 105 deletions(-)

diff --git a/lib/obex.c b/lib/obex.c
index e56ef74..991f06f 100644
--- a/lib/obex.c
+++ b/lib/obex.c
 <at>  <at>  -44,7 +44,6  <at>  <at> 
 #include "obex_main.h"
 #include "obex_object.h"
 #include "obex_connect.h"
-#include "obex_client.h"
 #include "databuffer.h"

 #include "fdobex.h"
 <at>  <at>  -511,10 +510,10  <at>  <at>  int CALLAPI OBEX_GetFD(obex_t *self)
 }

 /**
-	Start a request (as client).
+	Schedule a request (as client).
 	\param self OBEX handle
 	\param object Object containing request
-	\return -1 or negative error code on error
+	\return -1 on error, 0 on success.
  */
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 40/52] Make old API items dependent on OPENOBEX_DEPRECATED

---
 include/openobex/obex.h |    2 ++
 lib/obex_incl.h         |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/openobex/obex.h b/include/openobex/obex.h
index 096d5a2..e773c12 100644
--- a/include/openobex/obex.h
+++ b/include/openobex/obex.h
 <at>  <at>  -65,6 +65,7  <at>  <at>  typedef struct obex_object obex_object_t;
 /*
  *  OBEX API (deprecated)
  */
+#if defined(OPENOBEX_DEPRECATED)
 /** The user event callback.
  *  \deprecated Use #obex_event_cb_t and its functions instead.
  *  \param handle the obex handle
 <at>  <at>  -85,6 +86,7  <at>  <at>  OPENOBEX_SYMBOL(void)     OBEX_SetUserCallBack(obex_t *self,
 OPENOBEX_SYMBOL(obex_t *) OBEX_ServerAccept(obex_t *server,
 					    obex_event_t eventcb, void * data);
 #define OBEX_HandleInput(self, timeout) OBEX_Work((self), ((timeout)*1000L))
+#endif

 /*
  *  OBEX API
diff --git a/lib/obex_incl.h b/lib/obex_incl.h
index ae95e59..dbca28e 100644
--- a/lib/obex_incl.h
+++ b/lib/obex_incl.h
 <at>  <at>  -6,6 +6,10  <at>  <at> 
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 30/52] Remove now unused members from obex_object_t

---
 lib/obex_object.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/lib/obex_object.h b/lib/obex_object.h
index 31a7d80..914b405 100644
--- a/lib/obex_object.h
+++ b/lib/obex_object.h
 <at>  <at>  -74,8 +74,6  <at>  <at>  struct obex_object {
 	enum obex_rsp_mode rsp_mode;	/* OBEX_RSP_MODE_* */

 	int suspend;			/* Temporarily stop transfering object */
-	int continue_received;		/* CONTINUE received after sending last command */
-	int first_packet_sent;		/* Whether we've sent the first packet */

 	const uint8_t *s_buf;		/* Pointer to streaming data */
 	unsigned int s_len;		/* Length of stream-data */
--

-- 
1.7.5.4

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 45/52] Move obex_response_request() to the only file it is used in

Additionally, it adds a small wrapper function for BAD_REQUEST which can be
used quite often. Still, this is the only case where an incomplete write/send
is not possible but adding more states for this seems overkill. After all its
only 3 bytes to send.
The abort cases are now using the STATE_ABORT with a small wrapper.
---
 lib/obex_main.c   |   21 ----------
 lib/obex_main.h   |    1 -
 lib/obex_server.c |  114 +++++++++++++++++++++++++---------------------------
 3 files changed, 55 insertions(+), 81 deletions(-)

diff --git a/lib/obex_main.c b/lib/obex_main.c
index 5a7864c..c62386c 100644
--- a/lib/obex_main.c
+++ b/lib/obex_main.c
 <at>  <at>  -304,27 +304,6  <at>  <at>  void obex_deliver_event(obex_t *self, int event, int cmd, int rsp, int del)
 }

 /*
- * Function obex_response_request (self, opcode)
- *
- *    Send a response to peer device
- *
- */
-void obex_response_request(obex_t *self, uint8_t opcode)
-{
-	buf_t *msg;
-
-	obex_return_if_fail(self != NULL);
-
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 25/52] Add definition for sub-states

This additional level of the state machine is used by the states SEND and REC
and will help to remove some work-arounds that are currently only there because
this additional level is missing.
---
 lib/defines.h   |    6 ++++++
 lib/obex_main.h |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/lib/defines.h b/lib/defines.h
index 4169911..eb2257b 100644
--- a/lib/defines.h
+++ b/lib/defines.h
 <at>  <at>  -29,6 +29,12  <at>  <at>  enum obex_state {
 	STATE_REC,
 };

+enum obex_substate {
+	SUBSTATE_RECEIVE_RX,
+	SUBSTATE_PREPARE_TX,
+	SUBSTATE_TRANSMIT_TX,
+};
+
 #define OBEX_SRM_FLAG_WAIT_LOCAL  (1 << 0)
 #define OBEX_SRM_FLAG_WAIT_REMOTE (1 << 1)

diff --git a/lib/obex_main.h b/lib/obex_main.h
index 8a3e975..24d37c5 100644
--- a/lib/obex_main.h
+++ b/lib/obex_main.h
 <at>  <at>  -41,6 +41,7  <at>  <at>  struct obex {
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 32/52] Add new OBEX_FL_NONBLOCK

---
 include/openobex/obex_const.h |    1 +
 lib/CMakeLists.txt            |    1 +
 lib/Makefile.am               |    2 +-
 lib/btobex.c                  |   12 ++++++++-
 lib/fdobex.c                  |   58 +++++++++++++++++++++++++++++-----------
 lib/inobex.c                  |   12 ++++++++
 lib/irobex.c                  |   21 ++++++++++-----
 lib/nonblock.h                |   43 ++++++++++++++++++++++++++++++
 lib/obex.c                    |    1 +
 lib/obex_main.c               |   19 +++++++++----
 lib/obex_transport.c          |   51 ++++++++++++++++++++++++++----------
 11 files changed, 176 insertions(+), 45 deletions(-)
 create mode 100644 lib/nonblock.h

diff --git a/include/openobex/obex_const.h b/include/openobex/obex_const.h
index b4bad7f..8276aae 100644
--- a/include/openobex/obex_const.h
+++ b/include/openobex/obex_const.h
 <at>  <at>  -167,6 +167,7  <at>  <at>  typedef union {
 #define OBEX_FL_FILTERHINT	(1 <<  2) /* Filter devices based on hint bit */
 #define OBEX_FL_FILTERIAS	(1 <<  3) /* Filter devices based on IAS entry */
 #define OBEX_FL_CLOEXEC		(1 <<  4) /* Set CLOEXEC flag on file descriptors */
+#define OBEX_FL_NONBLOCK	(1 <<  5) /* Set the NONBLOCK flag on file descriptors */ 

 /* For OBEX_ObjectAddHeader */
 #define OBEX_FL_FIT_ONE_PACKET	0x01	/* This header must fit in one packet */
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index f404529..eacc1dd 100644
--- a/lib/CMakeLists.txt
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 47/52] Remove unused function

---
 lib/obex_object.c |   36 ------------------------------------
 lib/obex_object.h |    2 --
 2 files changed, 0 insertions(+), 38 deletions(-)

diff --git a/lib/obex_object.c b/lib/obex_object.c
index 00c75ee..78a15c5 100644
--- a/lib/obex_object.c
+++ b/lib/obex_object.c
 <at>  <at>  -634,42 +634,6  <at>  <at>  int obex_object_send_transmit(obex_t *self, obex_object_t *object)
 }

 /*
- * Function obex_object_send()
- *
- *    Send away an object packet.
- *    Returns:
- *       1 complete
- *       0 incomplete but no error
- *      -1 error
- */
-int obex_object_send(obex_t *self, obex_object_t *object, int allowfinalcmd,
-		     int forcefinalbit)
-{
-	int ret;
-
-	/* Return finished if aborted */
-	if (object->abort) {
-		(void)buf_reuse(self->tx_msg);
-		return 1;
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 19/52] Add missing copyright and license plates

---
 lib/bluez_compat.h |    2 +-
 lib/cloexec.h      |   20 ++++++++++++++++++++
 lib/customtrans.c  |   22 ++++++++++++++++++++++
 lib/customtrans.h  |   21 +++++++++++++++++++++
 lib/fdobex.c       |   22 ++++++++++++++++++++++
 lib/fdobex.h       |   21 +++++++++++++++++++++
 6 files changed, 107 insertions(+), 1 deletions(-)

diff --git a/lib/bluez_compat.h b/lib/bluez_compat.h
index b4dae25..092d370 100644
--- a/lib/bluez_compat.h
+++ b/lib/bluez_compat.h
 <at>  <at>  -3,7 +3,7  <at>  <at> 
 	Provides the Bluez API on other platforms.
 	OpenOBEX library - Free implementation of the Object Exchange protocol.

-	Copyright (c) 2007 Hendrik Sattler, All Rights Reserved.
+	Copyright (c) 2007-2011 Hendrik Sattler, All Rights Reserved.

 	OpenOBEX is free software; you can redistribute it and/or modify
 	it under the terms of the GNU Lesser General Public License as
diff --git a/lib/cloexec.h b/lib/cloexec.h
index 1c5c396..f2a77c0 100644
--- a/lib/cloexec.h
+++ b/lib/cloexec.h
 <at>  <at>  -1,3 +1,23  <at>  <at> 
+/**
+	\file cloexec.h
+	close-on-exec wrapper functions.
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 28/52] Split and use substate in obex_server

---
 lib/obex_main.c   |   44 +---------
 lib/obex_server.c |  259 +++++++++++++++++++++++++++++++++++++---------------
 lib/obex_server.h |    2 -
 3 files changed, 187 insertions(+), 118 deletions(-)

diff --git a/lib/obex_main.c b/lib/obex_main.c
index d3f0612..bc55661 100644
--- a/lib/obex_main.c
+++ b/lib/obex_main.c
 <at>  <at>  -281,36 +281,12  <at>  <at>  int obex_work(obex_t *self, int timeout)
 {
 	int ret;

-	/* Waiting for an incoming packet will not work for single response mode
-	 * as the client is not supposed to send any when we (as server) are
-	 * sending the response.
-	 * For request reception, this is handled above */
-	if (self->mode == MODE_SRV &&
-			self->object &&
-			self->object->rsp_mode != OBEX_RSP_MODE_NORMAL &&
-			self->state == STATE_SEND &&
-			!(self->srm_flags & OBEX_SRM_FLAG_WAIT_LOCAL)) {
-		/* Still, we need to do a zero-wait check for an ABORT
-		 * and for connection errors. */
-		ret = obex_transport_handle_input(self, 0);
-		if (ret == 0) /* timeout: no error, no input */
-			ret = obex_server_send(self, NULL, self->object->cmd, 0);
-		if (ret < 0)
-			return -1;
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 17/52] Remove auto-generated autotools INSTALL file

The ./bootstrap (or autoreconf -i) will automatically copy the file to its
place but there is no need to keep that in the repository (it is not the one
that's shipped in releases anyway).
---
 .gitignore |    1 +
 INSTALL    |  236 ------------------------------------------------------------
 2 files changed, 1 insertions(+), 236 deletions(-)
 delete mode 100644 INSTALL

diff --git a/.gitignore b/.gitignore
index 2e6307f..5bd619f 100644
--- a/.gitignore
+++ b/.gitignore
 <at>  <at>  -5,6 +5,7  <at>  <at> 
 *.so
 .deps
 .libs
+INSTALL
 Makefile
 Makefile.in
 aclocal.m4
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 56b077d..0000000
--- a/INSTALL
+++ /dev/null
 <at>  <at>  -1,236 +0,0  <at>  <at> 
-Installation Instructions
-*************************
-
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 51/52] Adapt CMake configuration for OBEX_DEBUG and OBEX_DUMP

---
 lib/CMakeLists.txt |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 186cdfa..aaec1ec 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
 <at>  <at>  -66,22 +66,22  <at>  <at>  if ( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
   add_definitions ( -D_GNU_SOURCE )
 endif ( CMAKE_SYSTEM_NAME STREQUAL "Linux" )

-option ( ENABLE_DEBUG_MESSAGES "Enables debug messages printed during runtime" )
-if ( ENABLE_DEBUG_MESSAGES )
-  set ( DEBUG_LEVEL 1 CACHE STRING "Amount of debug message (1-4)" )
-  list ( APPEND openobex_COMPILE_DEFINITIONS OBEX_DEBUG=${DEBUG_LEVEL} )
-  if ( NOT CMAKE_SYSTEM_NAME STREQUAL "Windows" )
-     option ( DEBUG_USE_SYSLOG "Use SysLog facility instead of stderr for debug messages" )
-  endif ( NOT CMAKE_SYSTEM_NAME STREQUAL "Windows" )
-  if ( DEBUG_USE_SYSLOG )
-    list ( APPEND openobex_COMPILE_DEFINITIONS OBEX_SYSLOG )
-  endif ( DEBUG_USE_SYSLOG )
-endif ( ENABLE_DEBUG_MESSAGES )
-
-option ( ENABLE_DUMP_MESSAGES "Enables dumping of data" )
-if ( ENABLE_DUMP_MESSAGES )
-  list ( APPEND openobex_COMPILE_DEFINITIONS OBEX_DUMP=3 )
-endif ( ENABLE_DUMP_MESSAGES )
+if ( NOT OBEX_DEBUG )
+  set ( OBEX_DEBUG 0 CACHE STRING "Amount of debug message (1-4)" )
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 39/52] Fix documentation about what needs to be included

---
 doc/openobex.coverpage |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/doc/openobex.coverpage b/doc/openobex.coverpage
index d90075f..941fb2a 100644
--- a/doc/openobex.coverpage
+++ b/doc/openobex.coverpage
 <at>  <at>  -29,7 +29,7  <at>  <at>  You might also find the OpenOBEX test applications useful.

 	\subsection preparations_sec Preparations

-To be able to use the OpenOBEX API you must include the files openobex/obex_const.h and openobex/obex.h.
+To be able to use the OpenOBEX API you must include the files openobex/obex_const.h or openobex/obex.h.

 First of all you must create an OBEX instance by calling #OBEX_New.
 In this call you specify what transport you want to use, an event callback, and optional flags.
--

-- 
1.7.5.4

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 14/52] Cleanup of obex_test

Change obex_test so that only the compiled-in parts are visible. Prepare the
bluetooth part for addition of L2CAP usage.
---
 apps/obex_test/obex_test.c |  247 ++++++++++++++++++++++++--------------------
 1 files changed, 136 insertions(+), 111 deletions(-)

diff --git a/apps/obex_test/obex_test.c b/apps/obex_test/obex_test.c
index 350d808..7527a51 100644
--- a/apps/obex_test/obex_test.c
+++ b/apps/obex_test/obex_test.c
 <at>  <at>  -27,6 +27,11  <at>  <at> 
 #include "../lib/bluez_compat.h"
 #ifdef _WIN32
 bdaddr_t bluez_compat_bdaddr_any = { BTH_ADDR_NULL };
+int str2ba(const char *str, bdaddr_t *ba) {
+	//TODO
+	*ba = *BDADDR_ANY;
+	return 0;
+}
 #endif
 #endif

 <at>  <at>  -36,9 +41,11  <at>  <at>  bdaddr_t bluez_compat_bdaddr_any = { BTH_ADDR_NULL };
 #include "obex_test_client.h"
 #include "obex_test_server.h"

-#ifndef _WIN32
+#if defined(_WIN32)
+#undef HAVE_CABLE_OBEX
+#else
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 36/52] Convert OBEX_TRANS_* to an enum

---
 include/openobex/obex_const.h |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/include/openobex/obex_const.h b/include/openobex/obex_const.h
index 18d698a..cdcd823 100644
--- a/include/openobex/obex_const.h
+++ b/include/openobex/obex_const.h
 <at>  <at>  -193,14 +193,16  <at>  <at>  enum obex_event {
 #define OBEX_FL_STREAM_DATAEND	0x08	/* Body stream last data */
 #define OBEX_FL_SUSPEND		0x10	/* Suspend after sending this header */

-/* Transports */
-#define OBEX_TRANS_IRDA		1
-#define OBEX_TRANS_INET		2
-#define OBEX_TRANS_CUSTOM	3
-#define OBEX_TRANS_BLUETOOTH	4 /* Bluetooth RFCOMM */
-#define OBEX_TRANS_FD		5
-#define OBEX_TRANS_USB		6
-#define OBEX_TRANS_BT_L2CAP	7 /* Bluetooth L2CAP */
+/** Possible transports */
+enum obex_transport_type {
+	OBEX_TRANS_IRDA = 1,      /**≤ Infrared */
+	OBEX_TRANS_INET = 2,      /**≤ TCP over IPv4/v6 */
+	OBEX_TRANS_CUSTOM = 3,    /**≤ Custom transport with callbacks */
+	OBEX_TRANS_BLUETOOTH = 4, /**≤ Bluetooth RFCOMM */
+	OBEX_TRANS_FD = 5,        /**≤ file descriptors */
+	OBEX_TRANS_USB = 6,       /**≤ USB CDC OBEX */
+	OBEX_TRANS_BT_L2CAP = 7,  /**≤ Bluetooth L2CAP */
+};
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 34/52] Use only one set of obex_mode defines

This also makes the public type an enum (like it was for the internal type) but
the names for the values stay the same.
---
 include/openobex/obex_const.h |    7 +++++--
 lib/defines.h                 |    5 -----
 lib/obex.c                    |    6 +++---
 lib/obex_client.c             |   12 ++++++------
 lib/obex_main.c               |    9 +++------
 lib/obex_object.c             |    2 +-
 6 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/include/openobex/obex_const.h b/include/openobex/obex_const.h
index 8276aae..ff147df 100644
--- a/include/openobex/obex_const.h
+++ b/include/openobex/obex_const.h
 <at>  <at>  -145,8 +145,11  <at>  <at>  typedef union {
 	//obex_bluetooth_intf_t bt; // to be added
 } obex_interface_t;

-#define OBEX_MODE_CLIENT	0
-#define OBEX_MODE_SERVER	1
+/** Possible modes */
+enum obex_mode {
+	OBEX_MODE_CLIENT = 0, /**≤ client mode */
+	OBEX_MODE_SERVER = 1, /**≤ server mode */
+};

 /* Possible events */
 #define OBEX_EV_PROGRESS	0	/* Progress has been made */
diff --git a/lib/defines.h b/lib/defines.h
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 43/52] Fix space problems in obex_test

---
 apps/obex_test/obex_test.c |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/apps/obex_test/obex_test.c b/apps/obex_test/obex_test.c
index 96e16fa..184a70b 100644
--- a/apps/obex_test/obex_test.c
+++ b/apps/obex_test/obex_test.c
 <at>  <at>  -118,28 +118,25  <at>  <at>  static void obex_event(obex_t *handle, obex_object_t *object,
 #if 0
 /*
  * Function get_peer_addr (name, peer)
- *
- *    
- *
  */
-static int get_peer_addr(char *name, struct sockaddr_in *peer) 
+static int get_peer_addr(char *name, struct sockaddr_in *peer)
 {
 	struct hostent *host;
 	in_addr_t inaddr;
-        
+
 	/* Is the address in dotted decimal? */
 	if ((inaddr = inet_addr(name)) != INADDR_NONE) {
 		memcpy((char *) &peer->sin_addr, (char *) &inaddr,
-		      sizeof(inaddr));  
+		      sizeof(inaddr));
 	}
 	else {
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 50/52] Make MSVC 7.1 compile again

---
 lib/obex_incl.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/lib/obex_incl.h b/lib/obex_incl.h
index dbca28e..d1b5446 100644
--- a/lib/obex_incl.h
+++ b/lib/obex_incl.h
 <at>  <at>  -10,6 +10,11  <at>  <at> 
 /* This add the deprecated API items */
 #define OPENOBEX_DEPRECATED 1

+/* Visual Studio C++ Compiler 7.1 does not know about Bluetooth */
+#if defined(_MSC_VER) && _MSC_VER < 1400
+#define bt_addr_t void
+#endif
+
 #include <openobex/obex.h>

 #endif
--

-- 
1.7.5.4

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 11/52] Fix: set MODE_SRV/STATE_IDLE _after_ sending event

This is needed for obex_test to actually work.
---
 lib/obex_client.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/obex_client.c b/lib/obex_client.c
index 5107d62..0199fbf 100644
--- a/lib/obex_client.c
+++ b/lib/obex_client.c
 <at>  <at>  -61,10 +61,10  <at>  <at>  static int obex_client_recv(obex_t *self, buf_t *msg, int rsp)
 		/* Response of a CMD_CONNECT needs some special treatment.*/
 		DEBUG(2, "We expect a connect-rsp\n");
 		if (obex_parse_connect_header(self, msg) < 0) {
-			self->mode = MODE_SRV;
-			self->state = STATE_IDLE;
 			obex_deliver_event(self, OBEX_EV_PARSEERR,
 						self->object->opcode, 0, TRUE);
+			self->mode = MODE_SRV;
+			self->state = STATE_IDLE;
 			return -1;
 		}
 		self->object->headeroffset=4;
 <at>  <at>  -82,10 +82,10  <at>  <at>  static int obex_client_recv(obex_t *self, buf_t *msg, int rsp)
 	/* Receive any headers */
 	ret = obex_object_receive(self, msg);
 	if (ret < 0) {
-		self->mode = MODE_SRV;
-		self->state = STATE_IDLE;
 		obex_deliver_event(self, OBEX_EV_PARSEERR,
 						self->object->opcode, 0, TRUE);
(Continue reading)

Johan Hedberg | 29 Jul 2011 10:08
Picon
Gravatar

Re: [PATCH 11/52] Fix: set MODE_SRV/STATE_IDLE _after_ sending event

Hi,

On Wed, Jul 27, 2011, Hendrik Sattler wrote:
> This is needed for obex_test to actually work.
> ---
>  lib/obex_client.c |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)

This patch has been applied.

Johan

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 29/52] Cleanup obex_object_resume()

Now that the multi-level state machine is used, the resume function can be
simplified a lot. To actually continue now, you have to call the
OBEX_HandleInput() function.
---
 lib/obex.c        |    2 +-
 lib/obex_object.c |   43 ++++++-------------------------------------
 lib/obex_object.h |    2 +-
 3 files changed, 8 insertions(+), 39 deletions(-)

diff --git a/lib/obex.c b/lib/obex.c
index 991f06f..277dbf2 100644
--- a/lib/obex.c
+++ b/lib/obex.c
 <at>  <at>  -574,7 +574,7  <at>  <at>  LIB_SYMBOL
 int CALLAPI OBEX_ResumeRequest(obex_t *self)
 {
 	obex_return_val_if_fail(self->object != NULL, -1);
-	return obex_object_resume(self, self->object);
+	return obex_object_resume(self->object);
 }

 /**
diff --git a/lib/obex_object.c b/lib/obex_object.c
index f888a2d..f0b4b7f 100644
--- a/lib/obex_object.c
+++ b/lib/obex_object.c
 <at>  <at>  -1146,49 +1146,18  <at>  <at>  int obex_object_readstream(obex_t *self, obex_object_t *object,

 int obex_object_suspend(obex_object_t *object)
 {
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 26/52] Split and use substate in obex_client_recv()

---
 lib/obex_client.c |  101 +++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 72 insertions(+), 29 deletions(-)

diff --git a/lib/obex_client.c b/lib/obex_client.c
index e17528a..fd9962b 100644
--- a/lib/obex_client.c
+++ b/lib/obex_client.c
 <at>  <at>  -49,12 +49,63  <at>  <at>  static __inline uint16_t msg_get_len(const buf_t *msg)
 		return 0;
 }

-static int obex_client_recv(obex_t *self, buf_t *msg, int rsp)
+static int obex_client_recv_transmit_tx(obex_t *self)
+{
+	int ret = 0;
+	int rsp = OBEX_RSP_CONTINUE;
+
+	DEBUG(4, "STATE: RECV/TRANSMIT_TX\n");
+
+	ret = obex_object_send_transmit(self, self->object);
+	if (ret == -1) {
+		obex_deliver_event(self, OBEX_EV_LINKERR,
+				   self->object->opcode, rsp, TRUE);
+		self->state = STATE_IDLE;
+
+	} else if (ret == 1) {
+		obex_deliver_event(self, OBEX_EV_PROGRESS,
+				   self->object->opcode, rsp, FALSE);
+		self->substate = SUBSTATE_RECEIVE_RX;
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 48/52] Fix function documentation

---
 lib/obex_object.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/obex_object.c b/lib/obex_object.c
index 78a15c5..f3f5672 100644
--- a/lib/obex_object.c
+++ b/lib/obex_object.c
 <at>  <at>  -744,9 +744,9  <at>  <at>  static void obex_object_receive_stream(obex_t *self, uint8_t hi,
 }

 /*
- * Function obex_object_receive_body()
+ * Function obex_object_receive_buffered()
  *
- *    Handle receiving of body
+ *    Handle receiving of buffered body
  *
  */
 static int obex_object_receive_buffered(obex_t *self, uint8_t hi,
--

-- 
1.7.5.4

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 23/52] Split obex_data_indication

One step is triggered the transport handle_input function: this one fills the
rx_msg buffer. It also used to read from that rx_msg buffer right again and
trigger the state machine. This patch decouples the second part and is needed
for further splitting into substates.
---
 lib/obex.c           |    2 +-
 lib/obex_client.c    |   13 +++++++--
 lib/obex_client.h    |    2 +-
 lib/obex_main.c      |   73 ++++++++++++++++++++++++++++++++-----------------
 lib/obex_main.h      |    2 +
 lib/obex_server.c    |   18 +++++++++---
 lib/obex_server.h    |    2 +-
 lib/obex_transport.c |    2 +-
 8 files changed, 78 insertions(+), 36 deletions(-)

diff --git a/lib/obex.c b/lib/obex.c
index bf2b71b..e56ef74 100644
--- a/lib/obex.c
+++ b/lib/obex.c
 <at>  <at>  -535,7 +535,7  <at>  <at>  int CALLAPI OBEX_Request(obex_t *self, obex_object_t *object)
 	self->mode = MODE_CLI;
         self->state = STATE_SEND;

-	return obex_client(self, NULL, 0);
+	return obex_client_send(self, NULL, 0);
 }

 /**
diff --git a/lib/obex_client.c b/lib/obex_client.c
index 0199fbf..e17528a 100644
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 15/52] Allow usage of L2CAP transport with obex_test

---
 apps/obex_test/obex_test.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/apps/obex_test/obex_test.c b/apps/obex_test/obex_test.c
index 7527a51..4b9b0b2 100644
--- a/apps/obex_test/obex_test.c
+++ b/apps/obex_test/obex_test.c
 <at>  <at>  -167,9 +167,9  <at>  <at>  int main (int argc, char *argv[])
 	struct context global_context = {0};

 #ifdef HAVE_BLUETOOTH
-	int btobex = FALSE;
+	int btobex = 0;
 	bdaddr_t bdaddr;
-	uint8_t channel = 0;
+	uint16_t channel = 0;
 #endif
 #ifdef HAVE_USB
 	int usbobex = FALSE;
 <at>  <at>  -192,6 +192,7  <at>  <at>  int main (int argc, char *argv[])
 #endif
 #ifdef HAVE_BLUETOOTH
 			"    -b [addr] [chan]  Use bluetooth RFCOMM transport\n"
+			"    -B [addr] [psm]   Use bluetooth L2CAP transport\n"
 #endif
 #ifdef HAVE_USB
 			"    -u [interface]    Use USB transport\n"
 <at>  <at>  -214,7 +215,9  <at>  <at>  int main (int argc, char *argv[])
 #endif
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 44/52] Add function that tells you the current data direction

---
 include/openobex/obex.h       |    1 +
 include/openobex/obex_const.h |    7 +++++++
 lib/obex.c                    |   16 ++++++++++++++++
 lib/obex.sym                  |    1 +
 lib/obex_main.c               |   16 +++++++++++++---
 lib/obex_main.h               |    1 +
 6 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/include/openobex/obex.h b/include/openobex/obex.h
index e773c12..4d15671 100644
--- a/include/openobex/obex.h
+++ b/include/openobex/obex.h
 <at>  <at>  -111,6 +111,7  <at>  <at>  OPENOBEX_SYMBOL(void *)   OBEX_GetUserData(obex_t *self);
 OPENOBEX_SYMBOL(void)     OBEX_SetEventCb(obex_t *self, obex_event_cb_t eventcb, void * data);
 OPENOBEX_SYMBOL(int)      OBEX_SetTransportMTU(obex_t *self, uint16_t mtu_rx, uint16_t mtu_tx_max);
 OPENOBEX_SYMBOL(int)      OBEX_GetFD(obex_t *self);
+OPENOBEX_SYMBOL(enum obex_data_direction) OBEX_GetDataDirection(obex_t *self);

 OPENOBEX_SYMBOL(int)    OBEX_RegisterCTransport(obex_t *self, obex_ctrans_t *ctrans);
 OPENOBEX_SYMBOL(int)    OBEX_SetCustomData(obex_t *self, void * data);
diff --git a/include/openobex/obex_const.h b/include/openobex/obex_const.h
index f0cbbf0..eaf9a64 100644
--- a/include/openobex/obex_const.h
+++ b/include/openobex/obex_const.h
 <at>  <at>  -204,6 +204,13  <at>  <at>  enum obex_transport_type {
 	OBEX_TRANS_BT_L2CAP = 7,  /**≤ Bluetooth L2CAP */
 };

+/** Possible directions for data */
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:54
Picon

[PATCH 35/52] Convert OBEX_EV_* to an enum

---
 include/openobex/obex_const.h |   40 +++++++++++++++++++++++++++-------------
 1 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/include/openobex/obex_const.h b/include/openobex/obex_const.h
index ff147df..18d698a 100644
--- a/include/openobex/obex_const.h
+++ b/include/openobex/obex_const.h
 <at>  <at>  -151,19 +151,33  <at>  <at>  enum obex_mode {
 	OBEX_MODE_SERVER = 1, /**≤ server mode */
 };

-/* Possible events */
-#define OBEX_EV_PROGRESS	0	/* Progress has been made */
-#define OBEX_EV_REQHINT		1	/* An incoming request is about to come */
-#define OBEX_EV_REQ		2	/* An incoming request has arrived */
-#define OBEX_EV_REQDONE		3	/* Request has finished */
-#define OBEX_EV_LINKERR		4	/* Link has been disconnected */
-#define OBEX_EV_PARSEERR	5	/* Malformed data encountered */
-#define OBEX_EV_ACCEPTHINT	6	/* Connection accepted */
-#define OBEX_EV_ABORT		7	/* Request was aborted */
-#define OBEX_EV_STREAMEMPTY	8	/* Need to feed more data when sending a stream */
-#define OBEX_EV_STREAMAVAIL	9	/* Time to pick up data when receiving a stream */
-#define OBEX_EV_UNEXPECTED	10	/* Unexpected data, not fatal */
-#define OBEX_EV_REQCHECK	11	/* First packet of an incoming request has been parsed */
+/** Possible events */
+enum obex_event {
+	/** Progress has been made */
+	OBEX_EV_PROGRESS = 0,
+	/** An incoming request is about to come */
(Continue reading)

Hendrik Sattler | 27 Jul 2011 18:53
Picon

[PATCH 21/52] Fix documentation reference bug

---
 lib/obex.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/obex.c b/lib/obex.c
index a2409a2..bf2b71b 100644
--- a/lib/obex.c
+++ b/lib/obex.c
 <at>  <at>  -81,7 +81,7  <at>  <at> 
 			- #OBEX_FL_KEEPSERVER : Keep the server alive after incomming request
 			- #OBEX_FL_FILTERHINT : Filter target devices based on Obex hint bit
 			- #OBEX_FL_FILTERIAS  : Filter target devices based on IAS entry
-			- #OBEX_FL_CLOSEXEC   : Open all sockets with SO_CLOEXEC set
+			- #OBEX_FL_CLOEXEC   : Open all sockets with SO_CLOEXEC set
 	\return an OBEX handle or NULL on error.
  */
 LIB_SYMBOL
--

-- 
1.7.5.4

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
Johan Hedberg | 27 Jul 2011 22:16
Picon
Gravatar

Re: Summary of all current patches

Hi Hendrik,

On Wed, Jul 27, 2011, Hendrik Sattler wrote:
>  <at> Johan:
> You can find all of these patches in my gitorious repository in the "testing"
> branch and I really recommend pull from there! (git am has its issues when
> files with DOS-style line-endings are involved). I will not be available almost
> all of August, so can be get this in before then?

You're asking me to review 52 patches by the end of this week?
Unfortunately I don't think that's doable even if I allocated all of my
time for this. I will at least try to get the ones in which you said are
strictly needed.

Johan

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
Hendrik Sattler | 28 Jul 2011 08:18
Picon

Re: Summary of all current patches

Am Mittwoch, 27. Juli 2011, 22:16:37 schrieb Johan Hedberg:
> Hi Hendrik,
> 
> On Wed, Jul 27, 2011, Hendrik Sattler wrote:
> >  <at> Johan:
> > You can find all of these patches in my gitorious repository in the
> > "testing" branch and I really recommend pull from there! (git am has its
> > issues when files with DOS-style line-endings are involved). I will not
> > be available almost all of August, so can be get this in before then?
> 
> You're asking me to review 52 patches by the end of this week?
> Unfortunately I don't think that's doable even if I allocated all of my
> time for this. I will at least try to get the ones in which you said are
> strictly needed.

No, I don't ask that ;-)
You are right, it would be quite a lot :-/

Have fun...

HS

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey

Gmane