Ignore:
Timestamp:
Jul 29, 2009, 11:45:17 AM (15 years ago)
Author:
Christoph Mayer
Message:

-logging fix, -sdp fix, -endpoint operator fix, -endpoint aufräumen

Location:
source/ariba/utility/bootstrap/modules/bluetoothsdp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/bootstrap/modules/bluetoothsdp/BluetoothSdp.cpp

    r5358 r5412  
    217217
    218218        if (sdp_session_ == NULL) {
    219                 logging_error( "something is wrong with your SDP server, nothing registered" );
     219                logging_error( "something is wrong with your SDP server, nothing registered: " << strerror(errno) );
    220220        } else {
    221221                int ret = sdp_record_register(sdp_session_, &record, 0);
    222222
    223223                if(ret < 0){
    224                         logging_error("failed registering sdp record");
     224                        logging_error("failed registering sdp record: " << strerror(errno));
    225225                }else{
    226226                        logging_debug("sdp record registered using session " << sdp_session_);
     
    269269        sock = hci_open_dev(dev_id);
    270270        if (dev_id < 0 || sock < 0) {
    271                 logging_error("opening socket for device " << dev_id << " failed. can not scan for peers");
     271                logging_error("opening socket for device "
     272                                << dev_id << " failed. can not scan for peers: " << strerror(errno));
    272273                return;
    273274        }
     
    280281        num_rsp = hci_inquiry(dev_id, len, max_rsp, NULL, &ii, flags);
    281282        if (num_rsp < 0)
    282                 logging_error("hci_inquiry failed with " << num_rsp);
     283                logging_error("hci_inquiry failed with " << num_rsp << ": " << strerror(errno));
    283284
    284285        for (i = 0; i < num_rsp; i++) {
     
    289290
    290291                logging_debug("found peer [" << saddress << "] [" << sname << "]");
    291 
    292                 // TODO: sdp_search can be very slow, fork it!
    293292                sdp_search( address, sname );
    294293        }
     
    297296        close(sock);
    298297
    299         int nextscan = (rand() % 40) + 5;
     298        int nextscan = (rand() % 30) + 5;
    300299        logging_debug("next sdp scan in " << nextscan << " seconds");
    301300
     
    328327
    329328        if (session == NULL) {
    330                 logging_error("failed to connect to SDP server at " << ba2string(&target) <<".");
     329                logging_error("failed to connect to SDP server at "
     330                                << ba2string(&target) << ": " << strerror(errno));
    331331                return;
    332332        }
     
    373373                }
    374374        } else {
    375                 logging_error("sdp_service_search_attr_req failed with timeout");
     375                logging_error("sdp_service_search_attr_req failed with timeout: " << strerror(errno));
    376376        }
    377377
  • source/ariba/utility/bootstrap/modules/bluetoothsdp/BluetoothSdp.h

    r5358 r5412  
    4545#include <string>
    4646#include <ctime>
     47#include <cerrno>
    4748#include <boost/bind.hpp>
    4849#include <boost/asio.hpp>
Note: See TracChangeset for help on using the changeset viewer.