Skip to content

Commit

Permalink
no longer listening for UDP broadcasts #33
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Jan 24, 2023
1 parent 712a164 commit 5eb5244
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 3.2.5 #${{ steps.get_version.outputs.VERSION }}
tag_name: 3.2.6 #${{ steps.get_version.outputs.VERSION }}
asset_path: app/build/outputs/apk/debug/app-debug.apk
asset_name: QZCompanionNordictrackTreadmill.apk
asset_content_type: application/zip
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "org.cagnulein.qzcompanionnordictracktreadmill"
minSdkVersion 21
targetSdkVersion 33
versionCode 52
versionName "3.2.5"
versionCode 53
versionName "3.2.6"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.cagnulein.qzcompanionnordictracktreadmill" android:versionName="3.2.5" android:versionCode="52" >
package="org.cagnulein.qzcompanionnordictracktreadmill" android:versionName="3.2.6" android:versionCode="53" >
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,18 @@ InetAddress getBroadcastAddress() throws IOException {
void startListenForUDPBroadcast() {
UDPBroadcastThread = new Thread(new Runnable() {
public void run() {
try {
InetAddress broadcastIP = getBroadcastAddress();
Integer port = 8003;
while (shouldRestartSocketListen) {
listenAndWaitAndThrowIntent(broadcastIP, port);
}
//if (!shouldListenForUDPBroadcast) throw new ThreadDeath();
} catch (Exception e) {
Log.i(LOG_TAG, "no longer listening for UDP broadcasts cause of error " + e.getMessage());
}
while(1) {
try {
InetAddress broadcastIP = getBroadcastAddress();
Integer port = 8003;
while (shouldRestartSocketListen) {
listenAndWaitAndThrowIntent(broadcastIP, port);
}
//if (!shouldListenForUDPBroadcast) throw new ThreadDeath();
} catch (Exception e) {
Log.i(LOG_TAG, "no longer listening for UDP broadcasts cause of error " + e.getMessage());
}
}
}
});
UDPBroadcastThread.start();
Expand Down

0 comments on commit 5eb5244

Please sign in to comment.