- Timestamp:
- 06/07/07 14:34:42 (18 months ago)
- Location:
- trunk/obexftp
- Files:
-
- 2 modified
-
bt_discovery.c (modified) (5 diffs)
-
client.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/obexftp/bt_discovery.c
r145 r162 14 14 #include <bluetooth/hci.h> 15 15 #include <bluetooth/hci_lib.h> 16 17 16 #include <bluetooth/sdp.h> 18 17 #include <bluetooth/sdp_lib.h> … … 30 29 static const uint8_t svc_uuid_pcsuite[] = SVC_UUID_PCSUITE; 31 30 32 char **obexftp_discover_bt ()31 char **obexftp_discover_bt_src(const char *src) 33 32 { 34 33 char **res; … … 42 41 int dd, i; 43 42 44 dev_id = hci_get_route(NULL); 45 /* dev_id = hci_devid( "01:23:45:67:89:AB" ); */ 43 /* Get local bluetooth address */ 44 if (src && strlen(src) == 17) 45 dev_id = hci_devid(src); 46 else if (src) 47 dev_id = atoi(src); 48 else 49 dev_id = hci_get_route(NULL); 46 50 DEBUG(1, "%s: Scanning ...\n", __func__); 47 51 flags = IREQ_CACHE_FLUSH; /* only show devices currently in range */ … … 124 128 } 125 129 126 int obexftp_browse_bt (const char *addr, int svclass)130 int obexftp_browse_bt_src(const char *src, const char *addr, int svclass) 127 131 { 128 132 int res = -1; … … 137 141 138 142 /* Get local bluetooth address */ 139 dev_id = hci_get_route(NULL); 140 /* dev_id = hci_devid( "01:23:45:67:89:AB" ); */ 143 if (src && strlen(src) == 17) 144 dev_id = hci_devid(src); 145 else if (src) 146 dev_id = atoi(src); 147 else 148 dev_id = hci_get_route(NULL); 141 149 142 150 /* Connect to remote SDP server */ -
trunk/obexftp/client.h
r146 r162 125 125 126 126 char **obexftp_discover(int transport); 127 char **obexftp_discover_bt(void); /* this is a quick hack */ 128 129 int obexftp_browse_bt(const char *addr, int svclass); 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 int obexftp_browse_bt_src(const char *src, const char *addr, int svclass); 132 #define obexftp_browse_bt(device, service) \ 133 obexftp_browse_bt_src(NULL, device, service) 130 134 #define obexftp_browse_bt_ftp(device) \ 131 obexftp_browse_bt (device, OBEX_FTP_SERVICE)135 obexftp_browse_bt_src(NULL, device, OBEX_FTP_SERVICE) 132 136 #define obexftp_browse_bt_push(device) \ 133 obexftp_browse_bt (device, OBEX_PUSH_SERVICE)137 obexftp_browse_bt_src(NULL, device, OBEX_PUSH_SERVICE) 134 138 #define obexftp_browse_bt_sync(device) \ 135 obexftp_browse_bt (device, OBEX_SYNC_SERVICE)139 obexftp_browse_bt_src(NULL, device, OBEX_SYNC_SERVICE) 136 140 137 141 int obexftp_connect_uuid(obexftp_client_t *cli,
