File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
escposprinter/src/main/java/com/dantsu/escposprinter/connection/bluetooth Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ public BluetoothConnection connect() throws EscPosConnectionException {
6161
6262 BluetoothAdapter bluetoothAdapter = BluetoothAdapter .getDefaultAdapter ();
6363
64- UUID uuid = getDeviceUUID ();
64+ UUID uuid = this . getDeviceUUID ();
6565
6666 try {
6767 this .socket = this .device .createRfcommSocketToServiceRecord (uuid );
@@ -80,13 +80,10 @@ public BluetoothConnection connect() throws EscPosConnectionException {
8080 /**
8181 * Get bluetooth device UUID
8282 */
83- @ SuppressLint ("MissingPermission" )
8483 protected UUID getDeviceUUID () {
84+ // https://developer.android.com/reference/android/bluetooth/BluetoothDevice - "00001101-0000-1000-8000-00805f9b34fb" SPP UUID
8585 ParcelUuid [] uuids = device .getUuids ();
86- // https://developer.android.com/reference/android/bluetooth/BluetoothDevice
87- UUID sppUid = UUID .fromString ("00001101-0000-1000-8000-00805f9b34fb" );
88-
89- return (uuids != null && uuids .length > 0 ) ? uuids [0 ].getUuid () : sppUid ;
86+ return (uuids != null && uuids .length > 0 ) ? uuids [0 ].getUuid () : UUID .fromString ("00001101-0000-1000-8000-00805f9b34fb" );
9087 }
9188
9289 /**
You can’t perform that action at this time.
0 commit comments