MotorControlThread receives and sends data.

This commit is contained in:
2014-02-10 15:24:34 -04:30
parent 2fcd92501c
commit 6d6608bb67
8 changed files with 114 additions and 17 deletions

View File

@@ -16,6 +16,7 @@
package ve.ucv.ciens.ccg.nxtcam;
import ve.ucv.ciens.ccg.nxtcam.camera.CameraPreview;
import ve.ucv.ciens.ccg.nxtcam.network.MotorControlThread;
import ve.ucv.ciens.ccg.nxtcam.network.VideoStreamingThread;
import ve.ucv.ciens.ccg.nxtcam.network.LCPThread;
import ve.ucv.ciens.ccg.nxtcam.utils.Logger;
@@ -41,6 +42,7 @@ public class CamActivity extends Activity{
private CameraSetupTask camSetupTask;
private VideoStreamingThread imThread;
private LCPThread botThread;
private MotorControlThread motorThread;
private String serverIp;
/*******************
@@ -56,6 +58,9 @@ public class CamActivity extends Activity{
serverIp = intent.getStringExtra("address");
imThread = new VideoStreamingThread(serverIp);
imThread.start();
motorThread = new MotorControlThread(serverIp);
motorThread.start();
}
@Override
@@ -104,14 +109,17 @@ public class CamActivity extends Activity{
releaseCamera();
}
}
@Override
public void onDestroy(){
super.onDestroy();
// TODO: Destroy the network threads.
imThread.finish();
imThread = null;
motorThread.finish();
motorThread = null;
}
@Override
public void onBackPressed(){
Intent result = new Intent();