|
18 | 18 | import java.io.ByteArrayInputStream;
|
19 | 19 | import java.io.ByteArrayOutputStream;
|
20 | 20 | import java.math.BigInteger;
|
| 21 | +import java.util.Arrays; |
21 | 22 | import java.util.Collections;
|
22 | 23 | import java.util.LinkedList;
|
23 | 24 | import java.util.List;
|
|
42 | 43 |
|
43 | 44 | class BlufiClientImpl implements BlufiParameter {
|
44 | 45 | private static final String TAG = "BlufiClientImpl";
|
| 46 | + private static final boolean DEBUG = false; |
45 | 47 |
|
46 | 48 | private static final int DEFAULT_PACKAGE_LENGTH = 20;
|
47 | 49 | private static final int PACKAGE_HEADER_LENGTH = 4;
|
@@ -292,6 +294,9 @@ private void gattWrite(byte[] data) throws InterruptedException {
|
292 | 294 | return;
|
293 | 295 | }
|
294 | 296 | synchronized (mWriteLock) {
|
| 297 | + if (DEBUG) { |
| 298 | + Log.i(TAG, "gattWrite= " + Arrays.toString(data)); |
| 299 | + } |
295 | 300 | mWriteChar.setValue(data);
|
296 | 301 | mGatt.writeCharacteristic(mWriteChar);
|
297 | 302 | mWriteLock.wait();
|
@@ -427,6 +432,9 @@ private int parseNotification(byte[] response, BlufiNotifyData notification) {
|
427 | 432 | Log.w(TAG, "parseNotification null data");
|
428 | 433 | return -1;
|
429 | 434 | }
|
| 435 | + if (DEBUG) { |
| 436 | + Log.d(TAG, "Notification= " + Arrays.toString(response)); |
| 437 | + } |
430 | 438 |
|
431 | 439 | if (response.length < 4) {
|
432 | 440 | Log.w(TAG, "parseNotification data length less than 4");
|
@@ -1126,7 +1134,7 @@ private void __requestCloseConnection() {
|
1126 | 1134 | }
|
1127 | 1135 | }
|
1128 | 1136 |
|
1129 |
| - private abstract class ThrowableRunnable implements Runnable { |
| 1137 | + private abstract static class ThrowableRunnable implements Runnable { |
1130 | 1138 | @Override
|
1131 | 1139 | public void run() {
|
1132 | 1140 | try {
|
|
0 commit comments