Changeset 4970
- Timestamp:
- Jul 16, 2009, 9:23:30 AM (15 years ago)
- Location:
- source/ariba/utility/bootstrap/modules/bluetoothsdp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/bootstrap/modules/bluetoothsdp/BluetoothSdp.cpp
r4905 r4970 62 62 namespace ariba { 63 63 namespace utility { 64 use_logging_cpp(BluetoothSdp) 65 ; 66 67 //TODO: figure out this compiler flag stuff 64 use_logging_cpp(BluetoothSdp); 68 65 69 66 BluetoothSdp::BluetoothSdp(BootstrapInformationCallback* _callback) : … … 71 68 #ifdef HAVE_BLUETOOTH_BLUETOOTH_H 72 69 73 // T ODO: think about this!74 channel_ = 7;75 // TODO: what about the callback?70 // This can be ignored, as the channel we really be saved in one 71 // of the info strings (as an attribute) 72 channel_ = 1; 76 73 77 74 #endif // HAVE_BLUETOOTH_BLUETOOTH_H … … 149 146 150 147 // prepare the info attribute buffers 151 string namebuf, info1buf, info2buf, info3buf;148 //string namebuf, info1buf, info2buf, info3buf; 152 149 uint8_t namelen, info1len, info2len, info3len; 153 150 … … 162 159 } 163 160 164 // we need to save the string len for sdp 161 // we need to save the string len for sdp; do we? 162 /* 165 163 namebuf = (char)namelen; 166 164 namebuf.append(name); … … 171 169 info3buf = (char)info3len; 172 170 info3buf.append(info3); 171 */ 173 172 174 173 // set the general service ID … … 212 211 // add the spovnet attributes 213 212 sdp_attr_add_new(&record, SDP_ATTR_SPOVNET_NAME, SDP_TEXT_STR8, 214 name buf.data());213 name.data()); 215 214 216 215 sdp_attr_add_new(&record, SDP_ATTR_SPOVNET_INFO1, SDP_TEXT_STR8, 217 info1 buf.data());216 info1.data()); 218 217 219 218 sdp_attr_add_new(&record, SDP_ATTR_SPOVNET_INFO2, SDP_TEXT_STR8, 220 info2 buf.data());219 info2.data()); 221 220 222 221 sdp_attr_add_new(&record, SDP_ATTR_SPOVNET_INFO3, SDP_TEXT_STR8, 223 info3 buf.data());222 info3.data()); 224 223 225 224 // connect to the local SDP server, register the service record, … … 271 270 int i; 272 271 273 /*274 char addr[19] = { 0 };275 char name[248] = { 0 };276 */277 272 bdaddr_t address; 278 273 uint8_t channel; … … 306 301 address = (ii + i)->bdaddr; 307 302 308 logging_info(" Peer found.")303 logging_info("Found peer " << ba2string(&address) << ", querying SDP.") 309 304 310 305 // TODO: sdp_search can be very slow, fork it! … … 343 338 344 339 if (session == 0) { 345 // TODO: put the remote's address here 346 logging_error("Failed to connect to remote SDP server."); 340 logging_error("Failed to connect to SDP server at " << ba2string(&target) <<"."); 347 341 return; 348 342 } … … 382 376 logging_info("Remote peer info2 is: " << info2); 383 377 logging_info("Remote peer info3 is: " << info3); 384 //TODO: callback here + extract info's and stuff 378 379 // Callback 380 callback->onBootstrapServiceFound(name, info1, info2, info3); 381 385 382 } 386 383 sdp_record_free(rec); … … 394 391 } 395 392 393 string BluetoothSdp::ba2string(bdaddr_t *ba) { 394 /* 395 * Returns a string holding the bt adress in human readable form. 396 */ 397 char *str; 398 ba2str(ba, str); 399 string result = str; 400 return result; 401 } 402 396 403 #endif // HAVE_BLUETOOTH_BLUETOOTH_H 397 404 -
source/ariba/utility/bootstrap/modules/bluetoothsdp/BluetoothSdp.h
r4879 r4970 85 85 void bt_scan(); 86 86 void sdp_search(bdaddr_t target); 87 string ba2string(bdaddr_t *ba); 87 88 88 89 sdp_session_t *sdp_session_;
Note:
See TracChangeset
for help on using the changeset viewer.