- Timestamp:
- Jul 13, 2009, 5:41:44 PM (15 years ago)
- Location:
- source/ariba/utility/bootstrap
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/bootstrap/BootstrapManager.cpp
r4850 r4879 41 41 #include "ariba/utility/bootstrap/modules/multicastdns/MulticastDns.h" 42 42 #include "ariba/utility/bootstrap/modules/periodicbroadcast/PeriodicBroadcast.h" 43 #include "ariba/utility/bootstrap/modules/bluetoothsdp/BluetoothSdp.h" 43 44 44 45 namespace ariba { … … 72 73 module = new PeriodicBroadcast(this); 73 74 break; 75 case BootstrapTypeBluetoothSdp: 76 module = new BluetoothSdp(this); 77 break; 74 78 } 75 79 … … 130 134 } 131 135 136 { // bluetooth sdp 137 RegistrationResult resone = RegistrationSucceeded; 138 resone = registerModule(BootstrapTypeBluetoothSdp); 139 140 if(resone != RegistrationSucceeded) 141 result = resone; 142 } 143 132 144 { // todo 133 145 /* ... */ … … 140 152 unregisterModule(BootstrapTypeMulticastDns); 141 153 unregisterModule(BootstrapTypePeriodicBroadcast); 154 unregisterModule(BootstrapTypeBluetoothSdp); 142 155 /* todo ... */ 143 156 -
source/ariba/utility/bootstrap/BootstrapManager.h
r4850 r4879 75 75 BootstrapTypeMulticastDns, // use mDNS bootstrapping 76 76 BootstrapTypePeriodicBroadcast, // stupid periodic broadcasting 77 BootstrapTypeBluetoothSdp, // bluetooth service discovery 77 78 }; 78 79 -
source/ariba/utility/bootstrap/modules/bluetoothsdp/BluetoothSdp.cpp
r4870 r4879 43 43 // Attribute descriptors for SDP 44 44 // base was chosen randomly 45 #define SDP_SPOVNET_BASE 0x400045 #define SDP_SPOVNET_BASE 0x4000 46 46 #define SDP_ATTR_SPOVNET_NAME 0x0000 + SDP_SPOVNET_BASE 47 47 #define SDP_ATTR_SPOVNET_INFO1 0x0001 + SDP_SPOVNET_BASE … … 133 133 */ 134 134 135 logging_info("Registering SDP service .\n");135 logging_info("Registering SDP service"); 136 136 137 137 uint8_t rfcomm_channel = channel_; … … 239 239 240 240 if (sdp_session_ == 0) { 241 std::cout 242 << "Something is wrong with your SDP server, nothing registered."; 241 logging_error( "Something is wrong with your SDP server, nothing registered" ); 243 242 } else { 244 243 sdp_record_register(sdp_session_, &record, 0); … … 260 259 #ifdef HAVE_BLUETOOTH_BLUETOOTH_H 261 260 262 logging_info("Unregistering SDP service .\n");261 logging_info("Unregistering SDP service"); 263 262 sdp_close(sdp_session_); 264 263 … … 276 275 */ 277 276 278 logging_info("Scanning for peers .\n");277 logging_info("Scanning for peers"); 279 278 280 279 inquiry_info *ii = NULL; … … 293 292 sock = hci_open_dev(dev_id); 294 293 if (dev_id < 0 || sock < 0) { 295 perror("opening socket");294 logging_error("opening socket"); 296 295 exit(1); 297 296 } … … 304 303 num_rsp = hci_inquiry(dev_id, len, max_rsp, NULL, &ii, flags); 305 304 if (num_rsp < 0) 306 perror("hci_inquiry");305 logging_error("hci_inquiry"); 307 306 308 307 for (i = 0; i < num_rsp; i++) { … … 324 323 close(sock); 325 324 326 logging_info("Next scan in 20 seconds .\n");325 logging_info("Next scan in 20 seconds"); 327 326 328 327 scan_timer_.expires_from_now(boost::posix_time::seconds(20)); 329 328 scan_timer_.async_wait(boost::bind(&BluetoothSdp::bt_scan, this)); 330 331 332 329 } 333 330 … … 399 396 #endif // HAVE_BLUETOOTH_BLUETOOTH_H 400 397 401 } 402 } //namespace ariba, utility 398 }} //namespace ariba, utility -
source/ariba/utility/bootstrap/modules/bluetoothsdp/BluetoothSdp.h
r4870 r4879 53 53 54 54 #ifdef HAVE_BLUETOOTH_BLUETOOTH_H 55 #include <bluetooth/bluetooth.h>56 #include <bluetooth/sdp.h>57 #include <bluetooth/sdp_lib.h>58 #include <bluetooth/hci.h>59 #include <bluetooth/hci_lib.h>55 #include <bluetooth/bluetooth.h> 56 #include <bluetooth/sdp.h> 57 #include <bluetooth/sdp_lib.h> 58 #include <bluetooth/hci.h> 59 #include <bluetooth/hci_lib.h> 60 60 #endif 61 61 … … 80 80 virtual void revokeService(string name); 81 81 82 private: 83 82 84 #ifdef HAVE_BLUETOOTH_BLUETOOTH_H 83 84 private:85 85 void bt_scan(); 86 86 void sdp_search(bdaddr_t target); … … 88 88 sdp_session_t *sdp_session_; 89 89 uint8_t channel_; 90 91 90 #endif // HAVE_BLUETOOTH_BLUETOOTH_H 92 91 … … 95 94 boost::thread t_; 96 95 97 98 96 }; 99 97
Note:
See TracChangeset
for help on using the changeset viewer.