5858 *
5959 */
6060@ Deprecated
61- public class BTTransport extends SdlTransport {
61+ public class BTTransport extends SdlTransport {
62+ private static final String TAG = "BTTransport" ;
6263 //936DA01F9ABD4D9D80C702AF85C822A8
6364 private final static UUID SDL_V4_MOBILE_APPLICATION_SVC_CLASS = new UUID (0x936DA01F9ABD4D9DL , 0x80C702AF85C822A8L );
6465
@@ -296,7 +297,7 @@ private void disconnect(String msg, Exception ex) {
296297 _transportReader = null ;
297298 }
298299 } catch (Exception e ) {
299- DebugTool .logError (null , "Failed to stop transport reader thread." , e );
300+ DebugTool .logError (TAG , "Failed to stop transport reader thread." , e );
300301 } // end-catch
301302
302303 try {
@@ -305,7 +306,7 @@ private void disconnect(String msg, Exception ex) {
305306 _bluetoothAdapterMonitor = null ;
306307 }
307308 } catch (Exception e ) {
308- DebugTool .logError (null , "Failed to stop adapter monitor thread." , e );
309+ DebugTool .logError (TAG , "Failed to stop adapter monitor thread." , e );
309310 }
310311
311312 try {
@@ -314,7 +315,7 @@ private void disconnect(String msg, Exception ex) {
314315 _serverSocket = null ;
315316 }
316317 } catch (Exception e ) {
317- DebugTool .logError (null , "Failed to close serverSocket" , e );
318+ DebugTool .logError (TAG , "Failed to close serverSocket" , e );
318319 } // end-catch
319320
320321 try {
@@ -323,7 +324,7 @@ private void disconnect(String msg, Exception ex) {
323324 _activeSocket = null ;
324325 }
325326 } catch (Exception e ) {
326- DebugTool .logError (null , "Failed to close activeSocket" , e );
327+ DebugTool .logError (TAG , "Failed to close activeSocket" , e );
327328 } // end-catch
328329
329330
@@ -334,7 +335,7 @@ private void disconnect(String msg, Exception ex) {
334335 _output = null ;
335336 }
336337 } catch (Exception e ) {
337- DebugTool .logError (null , "Failed to close output stream" , e );
338+ DebugTool .logError (TAG , "Failed to close output stream" , e );
338339 } // end-catch
339340
340341 if (ex == null ) {
@@ -361,7 +362,7 @@ public boolean sendBytesOverTransport(SdlPacket packet) {
361362 _output .write (msgBytes , 0 , msgBytes .length );
362363 sendResult = true ;
363364 } catch (Exception ex ) {
364- DebugTool .logError (null , "Error writing to Bluetooth socket: " + ex .toString (), ex );
365+ DebugTool .logError (TAG , "Error writing to Bluetooth socket: " + ex .toString (), ex );
365366 handleTransportError ("Error writing to Bluetooth socket:" , ex );
366367 sendResult = false ;
367368 } // end-catch
@@ -461,7 +462,7 @@ private void readFromTransport() {
461462 if (currentByte == -1 ){ //If we read a -1 and the psm didn't move forward, then there is a problem
462463 if (!isHalted ) {
463464 // Only call disconnect if the thread has not been halted
464- DebugTool .logError (null , "End of stream reached!" );
465+ DebugTool .logError (TAG , "End of stream reached!" );
465466 disconnect ("End of stream reached." , null );
466467 }
467468 }
@@ -479,7 +480,7 @@ private void readFromTransport() {
479480 // Only call disconnect if the thread has not been halted
480481 clearInputStream ();
481482 String errString = "Failure in BTTransport reader thread: " + excp .toString ();
482- DebugTool .logError (null , errString , excp );
483+ DebugTool .logError (TAG , errString , excp );
483484 disconnect (errString , excp );
484485 }
485486 return ;
@@ -493,7 +494,7 @@ private void clearInputStream(){
493494 _input = null ;
494495 }
495496 } catch (Exception e ) {
496- DebugTool .logError (null , "Failed to close input stream" , e );
497+ DebugTool .logError (TAG , "Failed to close input stream" , e );
497498 } // end-catch
498499 }
499500
0 commit comments