1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
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 <stdio.h>
+#include <stdlib.h>
+
+#include <openobex/obex.h>
+
+#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);
+ }
+}
|