Changeset 194 for trunk

Show
Ignore:
Timestamp:
09/05/07 15:02:32 (15 months ago)
Author:
zany
Message:

switching obexftpd to bt_kit

Location:
trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/apps/Makefile.am

    r188 r194  
    1313obexftp_SOURCES =               obexftp.c 
    1414 
    15 obexftpd_SOURCES =              obexftpd.c obexftp_sdp.c obexftp_sdp.h 
     15obexftpd_SOURCES =              obexftpd.c 
    1616stress_SOURCES =                stress.c 
    1717discovery_SOURCES =             discovery.c 
  • trunk/apps/obexftpd.c

    r186 r194  
    6868#include <common.h> 
    6969 
    70 #include "obexftp_sdp.h" 
    71  
    7270/* define this to "", "\r\n" or "\n" */ 
    7371#define EOLCHARS "\n" 
     
    857855        } 
    858856 
    859         if (transport==OBEX_TRANS_BLUETOOTH && 0 > obexftp_sdp_register(channel)) 
     857        if (transport==OBEX_TRANS_BLUETOOTH && 0 > obexftp_sdp_register_ftp(channel)) 
    860858        { 
    861859                //OBEX_Cleanup(handle); 
     
    933931        { 
    934932                fprintf(stderr, "sdp unregister\n"); 
    935                 obexftp_sdp_unregister(); 
     933                obexftp_sdp_unregister_ftp(); 
    936934        } 
    937935 
  • trunk/obexftp/client.c

    r193 r194  
    12031203#else 
    12041204        return NULL; 
    1205 #endif HAVE_BLUETOOTH 
     1205#endif /* HAVE_BLUETOOTH */ 
    12061206} 
    12071207 
     
    12131213#else 
    12141214        return NULL; 
    1215 #endif HAVE_BLUETOOTH 
     1215#endif /* HAVE_BLUETOOTH */ 
    12161216} 
    12171217 
     
    12231223#else 
    12241224        return 0; 
    1225 #endif HAVE_BLUETOOTH 
     1225#endif /* HAVE_BLUETOOTH */ 
     1226} 
     1227 
     1228 
     1229int 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 
     1239int 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 */ 
    12261246} 
    12271247 
  • trunk/obexftp/client.h

    r193 r194  
    5656#define DEFAULT_CACHE_TIMEOUT 180       /* 3 minutes */ 
    5757#define DEFAULT_CACHE_MAXSIZE 10240     /* 10k */ 
    58  
    59 /* bt svclass */ 
    60 #define OBEX_SYNC_SERVICE       0x1104 
    61 #define OBEX_PUSH_SERVICE       0x1105 
    62 #define OBEX_FTP_SERVICE        0x1106 
    6358 
    6459/* types */ 
     
    124119void obexftp_close(/*@only@*/ /*@out@*/ /*@null@*/ obexftp_client_t *cli); 
    125120 
    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  
    145121int obexftp_connect_uuid(obexftp_client_t *cli, 
    146122                                /*@null@*/ const char *device, /* for INET, BLUETOOTH */ 
  • trunk/obexftp/obexftp.h

    r186 r194  
    2727#endif 
    2828 
     29 
    2930/** ObexFTP message callback prototype. */ 
    3031typedef void (*obexftp_info_cb_t) (int event, const char *buf, int len, void *data); 
     
    5455#define STREAM_CHUNK 4096 
    5556 
     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 
     64char **obexftp_discover(int transport); 
     65char **obexftp_discover_bt_src(const char *src); /* HCI no. or address */ 
     66#define obexftp_discover_bt() \ 
     67        obexftp_discover_bt_src(NULL) 
     68 
     69char *obexftp_bt_name_src(const char *addr, const char *src); 
     70#define obexftp_bt_name(addr) \ 
     71        obexftp_bt_name_src(addr, NULL) 
     72 
     73int 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 
     83int 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) 
     90int 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 
    5699#ifdef __cplusplus 
    57100}