|
@@ -4,6 +4,7 @@ import java.io.IOException;
|
|
|
import java.io.ObjectInputStream;
|
|
|
import java.io.ObjectOutputStream;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Iterator;
|
|
|
|
|
@@ -44,7 +45,6 @@ public class CommunicationThread extends Thread {
|
|
|
|
|
|
ObjectInputStream tmpIn = null;
|
|
|
ObjectOutputStream tmpOut = null;
|
|
|
-
|
|
|
|
|
|
// Get the input and output streams, using temp objects because
|
|
|
// member streams are final
|
|
@@ -100,16 +100,26 @@ public class CommunicationThread extends Thread {
|
|
|
switch(message.getMessage_code()){
|
|
|
case SyncMessage.SYNC_REQUEST:
|
|
|
SyncInfo thisSyncInfo = synchronizer.getSyncInfo();
|
|
|
- write(new SyncMessage(SyncMessage.SYNC_RESPONSE_INFO, thisSyncInfo));
|
|
|
+
|
|
|
+ System.out.println("----------------------- Sent: " + Arrays.toString(thisSyncInfo.bssids.toArray()));
|
|
|
+ write(new SyncMessage(SyncMessage.SYNC_RESPONSE_INFO, thisSyncInfo));
|
|
|
break;
|
|
|
case SyncMessage.SYNC_RESPONSE_INFO:
|
|
|
SyncInfo otherSyncInfo = (SyncInfo) message.getPayload();
|
|
|
+
|
|
|
+ System.out.println("----------------------- Received: " + Arrays.toString(otherSyncInfo.bssids.toArray()));
|
|
|
+ System.out.println("----------------------- Received: " + otherSyncInfo.deviceMap.toString());
|
|
|
+
|
|
|
SyncData thisSyncData = synchronizer.getSyncData(otherSyncInfo);
|
|
|
write(new SyncMessage(SyncMessage.SYNC_RESPONSE_DATA, thisSyncData));
|
|
|
|
|
|
break;
|
|
|
case SyncMessage.SYNC_RESPONSE_DATA:
|
|
|
SyncData otherData = (SyncData) message.getPayload();
|
|
|
+
|
|
|
+ System.out.println("----------------------- Received: " + otherData.syncRecords.toString());
|
|
|
+ System.out.println("----------------------- Received: " + otherData.networkRecords.toString());
|
|
|
+
|
|
|
synchronizer.updateFromSyncData(otherData);
|
|
|
|
|
|
mHandler.obtainMessage(BluetoothSyncActivity.SYNC_SUCCESSFUL).sendToTarget();
|