summaryrefslogtreecommitdiff
path: root/host
diff options
context:
space:
mode:
authorDominic Spill <dominicgs@gmail.com>2016-02-06 23:04:17 +0000
committerDominic Spill <dominicgs@gmail.com>2016-02-06 23:04:17 +0000
commite828fb7ee7616d81cc696048889da88b68b036ff (patch)
treee69f9747448bd8c90dda17cb49d4af469d7115bb /host
parentb8920cfbbec2ce2e6535b0a41e9e37d7a4c2aef2 (diff)
Revert "Switch ubertooth-scan from rx_live to ubertooth_bulk_*"
This reverts commit b8920cfbbec2ce2e6535b0a41e9e37d7a4c2aef2.
Diffstat (limited to 'host')
-rw-r--r--host/libubertooth/src/ubertooth.c3
-rw-r--r--host/ubertooth-tools/src/ubertooth-scan.c22
2 files changed, 3 insertions, 22 deletions
diff --git a/host/libubertooth/src/ubertooth.c b/host/libubertooth/src/ubertooth.c
index 9b19d2c..d1a5799 100644
--- a/host/libubertooth/src/ubertooth.c
+++ b/host/libubertooth/src/ubertooth.c
@@ -271,8 +271,7 @@ int ubertooth_bulk_receive(ubertooth_t* ut, rx_callback cb, void* cb_args)
rx = (usb_pkt_rx*)(ut->full_usb_buf + PKT_LEN * i);
if(rx->pkt_type != KEEP_ALIVE) {
ringbuffer_add(ut->packets, rx);
- if(cb)
- (*cb)(ut, cb_args);
+ (*cb)(ut, cb_args);
}
if(ut->stop_ubertooth) {
if(ut->rx_xfer)
diff --git a/host/ubertooth-tools/src/ubertooth-scan.c b/host/ubertooth-tools/src/ubertooth-scan.c
index 96cbc22..e872949 100644
--- a/host/ubertooth-tools/src/ubertooth-scan.c
+++ b/host/ubertooth-tools/src/ubertooth-scan.c
@@ -182,7 +182,7 @@ void print_name_and_class(int dev_handle, int dev_id, bdaddr_t *bdaddr,
int main(int argc, char *argv[])
{
inquiry_info *ii = NULL;
- int i, r, opt, dev_id, dev_handle, len, flags, max_rsp, num_rsp, lap, timeout = 20;
+ int i, opt, dev_id, dev_handle, len, flags, max_rsp, num_rsp, lap, timeout = 20;
uint8_t uap, extended = 0;
uint8_t scan = 0;
char ubertooth_device = -1;
@@ -266,25 +266,7 @@ int main(int argc, char *argv[])
/* Now find hidden piconets with Ubertooth */
printf("\nUbertooth scan\n");
btbb_init_survey();
-
- // init USB transfer
- r = ubertooth_bulk_init(ut);
- if (r < 0)
- return r;
-
- // tell ubertooth to send packets
- r = cmd_rx_syms(ut->devh);
- if (r < 0)
- return r;
-
- if (timeout)
- ubertooth_set_timeout(ut, timeout);
-
- // receive and process each packet
- while(!ut->stop_ubertooth) {
- ubertooth_bulk_wait(ut);
- ubertooth_bulk_receive(ut, NULL, NULL);
- }
+ rx_live(ut, NULL, timeout);
ubertooth_stop(ut);
while((pn=btbb_next_survey_result()) != NULL) {