diff -Naur openobex-apps-1.0.0/src/Makefile.am openobex-apps-1.0.0-new/src/Makefile.am --- openobex-apps-1.0.0/src/Makefile.am 2002-12-01 18:34:41.000000000 +0100 +++ openobex-apps-1.0.0-new/src/Makefile.am 2005-07-14 17:03:26.000000000 +0200 @@ -9,7 +9,7 @@ obex_put_common.c obex_put_common.h -bin_PROGRAMS = irxfer obex_tcp irobex_palm3 obex_test +bin_PROGRAMS = irxfer obex_tcp irobex_palm3 obex_test obexserver obex_test_SOURCES = \ obex_test.c obex_test.h \ @@ -19,6 +19,10 @@ obex_test_LDADD = @OPENOBEX_LIBS@ @BLUETOOTH_LIBS@ libmisc.a +obexserver_SOURCES = obexserver.c + +obexserver_LDADD = @OPENOBEX_LIBS@ libmisc.a + obex_tcp_SOURCES = obex_tcp.c irxfer_SOURCES = irxfer.c diff -Naur openobex-apps-1.0.0/src/Makefile.in openobex-apps-1.0.0-new/src/Makefile.in --- openobex-apps-1.0.0/src/Makefile.in 2002-12-01 18:36:18.000000000 +0100 +++ openobex-apps-1.0.0-new/src/Makefile.in 2005-07-14 17:03:26.000000000 +0200 @@ -78,13 +78,17 @@ libmisc_a_SOURCES = obex_io.c obex_io.h obex_put_common.c obex_put_common.h -bin_PROGRAMS = irxfer obex_tcp irobex_palm3 obex_test +bin_PROGRAMS = irxfer obex_tcp irobex_palm3 obex_test obexserver obex_test_SOURCES = obex_test.c obex_test.h obex_test_client.c obex_test_client.h obex_test_server.c obex_test_server.h obex_test_cable.c obex_test_cable.h obex_test_LDADD = @OPENOBEX_LIBS@ @BLUETOOTH_LIBS@ libmisc.a +obexserver_SOURCES = obexserver.c + +obexserver_LDADD = @OPENOBEX_LIBS@ libmisc.a + obex_tcp_SOURCES = obex_tcp.c irxfer_SOURCES = irxfer.c @@ -127,6 +131,9 @@ obex_test_cable.o obex_test_DEPENDENCIES = libmisc.a obex_test_LDFLAGS = +obexserver_OBJECTS = obexserver.o +obexserver_DEPENDENCIES = libmisc.a +obexserver_LDFLAGS = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -138,8 +145,8 @@ TAR = tar GZIP_ENV = --best -SOURCES = $(libmisc_a_SOURCES) $(irxfer_SOURCES) $(obex_tcp_SOURCES) $(irobex_palm3_SOURCES) $(obex_test_SOURCES) -OBJECTS = $(libmisc_a_OBJECTS) $(irxfer_OBJECTS) $(obex_tcp_OBJECTS) $(irobex_palm3_OBJECTS) $(obex_test_OBJECTS) +SOURCES = $(libmisc_a_SOURCES) $(irxfer_SOURCES) $(obex_tcp_SOURCES) $(irobex_palm3_SOURCES) $(obex_test_SOURCES) $(obexserver_SOURCES) +OBJECTS = $(libmisc_a_OBJECTS) $(irxfer_OBJECTS) $(obex_tcp_OBJECTS) $(irobex_palm3_OBJECTS) $(obex_test_OBJECTS) $(obexserver_OBJECTS) all: all-redirect .SUFFIXES: @@ -226,6 +233,10 @@ @rm -f obex_test $(LINK) $(obex_test_LDFLAGS) $(obex_test_OBJECTS) $(obex_test_LDADD) $(LIBS) +obexserver: $(obexserver_OBJECTS) $(obexserver_DEPENDENCIES) + @rm -f obexserver + $(LINK) $(obexserver_LDFLAGS) $(obexserver_OBJECTS) $(LDADD) $(LIBS) + tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) @@ -282,6 +293,7 @@ obex_test.h obex_test_cable.h obex_test_server.o: obex_test_server.c obex_io.h obex_test.h \ obex_test_cable.h obex_test_server.h +obexserver.o: obexserver.c info-am: info: info-am diff -Naur openobex-apps-1.0.0/src/obexserver.c openobex-apps-1.0.0-new/src/obexserver.c --- openobex-apps-1.0.0/src/obexserver.c 1970-01-01 01:00:00.000000000 +0100 +++ openobex-apps-1.0.0-new/src/obexserver.c 2005-07-14 17:03:30.000000000 +0200 @@ -0,0 +1,33 @@ +/* Simple OpenOBEX server for Bluez+OpenOBEX */ +/* link with libmisc.a from OPENObex-apps and libopenobex from OpenOBEX */ +/* venglin@freebsd.lublin.pl */ + + +#include +#include + +#include + +#define OBEX_PUSH_HANDLE 10 + +volatile int finished = 0; +obex_t *handle = NULL; + +void obex_event(obex_t *handle, obex_object_t *object, int mode, int event, int obex_cmd, int obex_rsp); + +int main(int argc, char **argv) +{ + obex_object_t *object; + + handle = OBEX_Init(OBEX_TRANS_BLUETOOTH, obex_event, 0); + + if (argc == 1) + { + BtOBEX_ServerRegister(handle, NULL, OBEX_PUSH_HANDLE); + printf("Waiting for connection...\n"); + btobex_accept(handle); + + while (!finished) + OBEX_HandleInput(handle, 1); + } +}