1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

Merge branch 'android' into revo

This commit is contained in:
James Cotton 2012-10-05 08:47:20 -05:00
commit dae9cbc76d
4 changed files with 12 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -256,6 +256,7 @@ public abstract class ObjectManagerActivity extends Activity {
// Bind to the telemetry service (which will start it)
Intent intent = new Intent(getApplicationContext(),
org.openpilot.androidgcs.telemetry.OPTelemetryService.class);
startService(intent);
if (DEBUG)
Log.d(TAG, "Attempting to bind: " + intent);
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);

View File

@ -143,7 +143,7 @@ public class BluetoothUAVTalk extends TelemetryTask {
socket = null;
try {
socket = device.createInsecureRfcommSocketToServiceRecord(MY_UUID);
socket = device.createRfcommSocketToServiceRecord(MY_UUID);
} catch (IOException e) {
if (ERROR) Log.e(TAG,"Unable to create Rfcomm socket");
return false;

View File

@ -123,7 +123,10 @@ public class HidUAVTalk extends TelemetryTask {
while(deviceIterator.hasNext()){
UsbDevice dev = deviceIterator.next();
if (DEBUG) Log.d(TAG, "Testing device: " + dev);
usbManager.requestPermission(dev, permissionIntent);
if( ValidateFoundDevice(dev) ) {
usbManager.requestPermission(dev, permissionIntent);
break;
}
}
if (DEBUG) Log.d(TAG, "Registered the deviceAttachedFilter");
@ -254,6 +257,12 @@ public class HidUAVTalk extends TelemetryTask {
UsbEndpoint ep1 = null;
UsbEndpoint ep2 = null;
if (connectDevice.getInterfaceCount() < 2) {
if (ERROR) Log.e(TAG, "Interface count for USB device incorrect");
telemService.toastMessage("Failed to connect");
return false;
}
// Using the same interface for reading and writing
usbInterface = connectDevice.getInterface(0x2);
if (usbInterface.getEndpointCount() == 2)