- Timestamp:
- 09/05/07 15:02:32 (15 months ago)
- Location:
- trunk
- Files:
-
- 5 modified
-
apps/Makefile.am (modified) (1 diff)
-
apps/obexftpd.c (modified) (3 diffs)
-
obexftp/client.c (modified) (3 diffs)
-
obexftp/client.h (modified) (2 diffs)
-
obexftp/obexftp.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/apps/Makefile.am
r188 r194 13 13 obexftp_SOURCES = obexftp.c 14 14 15 obexftpd_SOURCES = obexftpd.c obexftp_sdp.c obexftp_sdp.h15 obexftpd_SOURCES = obexftpd.c 16 16 stress_SOURCES = stress.c 17 17 discovery_SOURCES = discovery.c -
trunk/apps/obexftpd.c
r186 r194 68 68 #include <common.h> 69 69 70 #include "obexftp_sdp.h"71 72 70 /* define this to "", "\r\n" or "\n" */ 73 71 #define EOLCHARS "\n" … … 857 855 } 858 856 859 if (transport==OBEX_TRANS_BLUETOOTH && 0 > obexftp_sdp_register (channel))857 if (transport==OBEX_TRANS_BLUETOOTH && 0 > obexftp_sdp_register_ftp(channel)) 860 858 { 861 859 //OBEX_Cleanup(handle); … … 933 931 { 934 932 fprintf(stderr, "sdp unregister\n"); 935 obexftp_sdp_unregister ();933 obexftp_sdp_unregister_ftp(); 936 934 } 937 935 -
trunk/obexftp/client.c
r193 r194 1203 1203 #else 1204 1204 return NULL; 1205 #endif HAVE_BLUETOOTH1205 #endif /* HAVE_BLUETOOTH */ 1206 1206 } 1207 1207 … … 1213 1213 #else 1214 1214 return NULL; 1215 #endif HAVE_BLUETOOTH1215 #endif /* HAVE_BLUETOOTH */ 1216 1216 } 1217 1217 … … 1223 1223 #else 1224 1224 return 0; 1225 #endif HAVE_BLUETOOTH 1225 #endif /* HAVE_BLUETOOTH */ 1226 } 1227 1228 1229 int obexftp_sdp_register(int svclass, int channel) 1230 { 1231 #ifdef HAVE_BLUETOOTH 1232 return btkit_register_obex(svclass, channel); 1233 #else 1234 return 0; 1235 #endif /* HAVE_BLUETOOTH */ 1236 } 1237 1238 1239 int obexftp_sdp_unregister(int svclass) 1240 { 1241 #ifdef HAVE_BLUETOOTH 1242 return btkit_unregister_service(svclass); 1243 #else 1244 return 0; 1245 #endif /* HAVE_BLUETOOTH */ 1226 1246 } 1227 1247 -
trunk/obexftp/client.h
r193 r194 56 56 #define DEFAULT_CACHE_TIMEOUT 180 /* 3 minutes */ 57 57 #define DEFAULT_CACHE_MAXSIZE 10240 /* 10k */ 58 59 /* bt svclass */60 #define OBEX_SYNC_SERVICE 0x110461 #define OBEX_PUSH_SERVICE 0x110562 #define OBEX_FTP_SERVICE 0x110663 58 64 59 /* types */ … … 124 119 void obexftp_close(/*@only@*/ /*@out@*/ /*@null@*/ obexftp_client_t *cli); 125 120 126 char **obexftp_discover(int transport);127 char **obexftp_discover_bt_src(const char *src); /* HCI no. or address */128 #define obexftp_discover_bt() \129 obexftp_discover_bt_src(NULL)130 131 char *obexftp_bt_name_src(const char *addr, const char *src);132 #define obexftp_bt_name(addr) \133 obexftp_bt_name_src(addr, NULL)134 135 int obexftp_browse_bt_src(const char *src, const char *addr, int svclass);136 #define obexftp_browse_bt(device, service) \137 obexftp_browse_bt_src(NULL, device, service)138 #define obexftp_browse_bt_ftp(device) \139 obexftp_browse_bt_src(NULL, device, OBEX_FTP_SERVICE)140 #define obexftp_browse_bt_push(device) \141 obexftp_browse_bt_src(NULL, device, OBEX_PUSH_SERVICE)142 #define obexftp_browse_bt_sync(device) \143 obexftp_browse_bt_src(NULL, device, OBEX_SYNC_SERVICE)144 145 121 int obexftp_connect_uuid(obexftp_client_t *cli, 146 122 /*@null@*/ const char *device, /* for INET, BLUETOOTH */ -
trunk/obexftp/obexftp.h
r186 r194 27 27 #endif 28 28 29 29 30 /** ObexFTP message callback prototype. */ 30 31 typedef void (*obexftp_info_cb_t) (int event, const char *buf, int len, void *data); … … 54 55 #define STREAM_CHUNK 4096 55 56 57 /* bt svclass */ 58 #define OBEX_SYNC_SERVICE 0x1104 59 #define OBEX_PUSH_SERVICE 0x1105 60 #define OBEX_FTP_SERVICE 0x1106 61 62 /* server and client helpers for bt */ 63 64 char **obexftp_discover(int transport); 65 char **obexftp_discover_bt_src(const char *src); /* HCI no. or address */ 66 #define obexftp_discover_bt() \ 67 obexftp_discover_bt_src(NULL) 68 69 char *obexftp_bt_name_src(const char *addr, const char *src); 70 #define obexftp_bt_name(addr) \ 71 obexftp_bt_name_src(addr, NULL) 72 73 int obexftp_browse_bt_src(const char *src, const char *addr, int svclass); 74 #define obexftp_browse_bt(device, service) \ 75 obexftp_browse_bt_src(NULL, device, service) 76 #define obexftp_browse_bt_ftp(device) \ 77 obexftp_browse_bt_src(NULL, device, OBEX_FTP_SERVICE) 78 #define obexftp_browse_bt_push(device) \ 79 obexftp_browse_bt_src(NULL, device, OBEX_PUSH_SERVICE) 80 #define obexftp_browse_bt_sync(device) \ 81 obexftp_browse_bt_src(NULL, device, OBEX_SYNC_SERVICE) 82 83 int obexftp_sdp_register(int svclass, int channel); 84 #define obexftp_sdp_register_ftp(channel) \ 85 obexftp_sdp_register(OBEX_FTP_SERVICE, channel) 86 #define obexftp_sdp_register_push(channel) \ 87 obexftp_sdp_register(OBEX_PUSH_SERVICE, channel) 88 #define obexftp_sdp_register_sync(channel) \ 89 obexftp_sdp_register(OBEX_SYNC_SERVICE, channel) 90 int obexftp_sdp_unregister(int svclass); 91 #define obexftp_sdp_unregister_ftp() \ 92 obexftp_sdp_unregister(OBEX_FTP_SERVICE) 93 #define obexftp_sdp_unregister_push() \ 94 obexftp_sdp_unregister(OBEX_PUSH_SERVICE) 95 #define obexftp_sdp_unregister_sync() \ 96 obexftp_sdp_unregister(OBEX_SYNC_SERVICE) 97 98 56 99 #ifdef __cplusplus 57 100 }
