-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from DroidPlanner/droneapi_update
Droneapi update
- Loading branch information
Showing
17 changed files
with
288 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
AidlLib/src/com/o3dr/services/android/lib/model/IApiListener.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.o3dr.services.android.lib.model; | ||
|
||
import com.o3dr.services.android.lib.drone.connection.ConnectionResult; | ||
|
||
/** | ||
* DroneAPI event listener. A valid instance must be provided at api registration. | ||
*/ | ||
interface IApiListener { | ||
|
||
/** | ||
* Ping the api listener to make sure it's still up and connected. | ||
*/ | ||
boolean ping(); | ||
|
||
/** | ||
* Called when the connection attempt fails. | ||
* @param result Describe why the connection failed. | ||
*/ | ||
oneway void onConnectionFailed(in ConnectionResult result); | ||
|
||
/** | ||
* Retrieve the version code for the connected client. | ||
*/ | ||
int getClientVersionCode(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
ClientLib/mobile/src/main/java/com/o3dr/android/client/DroneApiListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.o3dr.android.client; | ||
|
||
import android.os.RemoteException; | ||
|
||
import com.o3dr.services.android.lib.BuildConfig; | ||
import com.o3dr.services.android.lib.drone.connection.ConnectionResult; | ||
import com.o3dr.services.android.lib.model.IApiListener; | ||
|
||
/** | ||
* Created by fhuya on 12/15/14. | ||
*/ | ||
public class DroneApiListener extends IApiListener.Stub { | ||
|
||
private final Drone drone; | ||
|
||
public DroneApiListener(Drone drone){ | ||
this.drone = drone; | ||
} | ||
|
||
@Override | ||
public boolean ping() throws RemoteException { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void onConnectionFailed(ConnectionResult connectionResult) throws RemoteException { | ||
drone.notifyDroneConnectionFailed(connectionResult); | ||
} | ||
|
||
@Override | ||
public int getClientVersionCode() throws RemoteException { | ||
return BuildConfig.VERSION_CODE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.