Skip to content

Commit 8efeab3

Browse files
committed
Merge pull request #121 from DroidPlanner/fix_udp_connection
Fix double connection bug
2 parents 5ce71cf + e2c78c3 commit 8efeab3

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

ClientLib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
33
ext {
44
PUBLISH_ARTIFACT_ID = 'dronekit-android'
55
PUBLISH_VERSION = '2.3.09'
6-
PROJECT_DESCRIPTION = "DroneKit-Android Client Library"
6+
PROJECT_DESCRIPTION = "Android DroneKit client library."
77
PROJECT_LABELS = ['3DR', '3DR Services', 'DroneAPI', 'Android', 'DroneKit']
88
PROJECT_LICENSES = ['Apache-2.0']
99
}

ServiceApp/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ android {
3535
applicationId 'org.droidplanner.services.android'
3636
minSdkVersion 14
3737
targetSdkVersion 21
38-
versionCode 10212
38+
versionCode 10213
3939
versionName getGitVersion()
4040
}
4141

ServiceApp/src/org/droidplanner/services/android/drone/DroneManager.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,17 @@ public void connect(String appId, DroneEventsListener listener) throws Connectio
132132
if (!mavClient.isConnected()) {
133133
mavClient.openConnection();
134134
} else {
135-
listener.onDroneEvent(DroneInterfaces.DroneEventsType.CONNECTED, drone);
136-
137-
if (drone.isConnectionAlive())
138-
listener.onDroneEvent(DroneInterfaces.DroneEventsType.HEARTBEAT_FIRST, drone);
139-
else
140-
listener.onDroneEvent(DroneInterfaces.DroneEventsType.HEARTBEAT_TIMEOUT, drone);
135+
if (drone.isConnected()) {
141136

137+
if (drone.isConnectionAlive())
138+
listener.onDroneEvent(DroneInterfaces.DroneEventsType.HEARTBEAT_FIRST, drone);
139+
else {
140+
listener.onDroneEvent(DroneInterfaces.DroneEventsType.CONNECTED, drone);
141+
listener.onDroneEvent(DroneInterfaces.DroneEventsType.HEARTBEAT_TIMEOUT, drone);
142+
}
142143

143-
notifyConnected(appId, listener);
144+
notifyConnected(appId, listener);
145+
}
144146
}
145147

146148
mavClient.addLoggingFile(appId);

doc/getting_started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ For an existing app:
4646
}
4747

4848
dependencies {
49-
compile 'com.o3dr:droneKit-android:2.3.+'
49+
compile 'com.o3dr.android:droneKit-android:2.3.+'
5050
...
5151
}
5252

release_android_library.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'maven-publish'
22
apply plugin: 'com.jfrog.bintray'
33

44
def publishFlag = false
5-
def projectGroupId = 'com.o3dr'
5+
def projectGroupId = 'com.o3dr.android'
66
def projectArtifactId = project.PUBLISH_ARTIFACT_ID
77
def projectVersion = project.PUBLISH_VERSION
88
def projectDescription = project.PROJECT_DESCRIPTION
@@ -79,9 +79,8 @@ bintray {
7979
pkg {
8080
repo = getMavenRepo()
8181
name = projectArtifactId
82-
userOrg = '3d-robotics'
8382
desc = projectDescription
84-
websiteUrl = 'https://github.com/DroidPlanner/DroneKit-Android'
83+
websiteUrl = 'http://android.dronekit.io/'
8584
issueTrackerUrl = 'https://github.com/DroidPlanner/DroneKit-Android/issues'
8685
vcsUrl = 'https://github.com/DroidPlanner/DroneKit-Android.git'
8786
licenses = projectLicenses

0 commit comments

Comments
 (0)