-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into peloton_raspberry_treadmill
- Loading branch information
Showing
33 changed files
with
15,515 additions
and
166 deletions.
There are no files selected for viewing
95 changes: 89 additions & 6 deletions
95
build-qdomyos-zwift-Qt_5_15_2_for_iOS-Debug/qdomyoszwift.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
android.useAndroidX=true | ||
android.enableJetifier=true | ||
protoc_platform=osx-x86_64 |
Empty file.
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,65 @@ | ||
package org.cagnulen.qdomyoszwift; | ||
|
||
import android.app.ActivityManager; | ||
import android.app.Activity; | ||
import android.content.Context; | ||
import android.content.DialogInterface; | ||
import android.content.Intent; | ||
import android.net.Uri; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
import android.provider.Settings; | ||
import android.text.Editable; | ||
import android.text.TextWatcher; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
import android.widget.Toast; | ||
import android.os.Looper; | ||
import android.os.Handler; | ||
import android.util.Log; | ||
import com.garmin.android.connectiq.ConnectIQ; | ||
import com.garmin.android.connectiq.ConnectIQAdbStrategy; | ||
import com.garmin.android.connectiq.IQApp; | ||
import com.garmin.android.connectiq.IQDevice; | ||
import com.garmin.android.connectiq.exception.InvalidStateException; | ||
import com.garmin.android.connectiq.exception.ServiceUnavailableException; | ||
import android.content.BroadcastReceiver; | ||
import android.content.ContextWrapper; | ||
import android.content.IntentFilter; | ||
import android.widget.Toast; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import com.google.protobuf.InvalidProtocolBufferException; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
|
||
public class ZwiftAPI { | ||
|
||
private static Context context; | ||
|
||
private static final String TAG = "ZwiftAPI: "; | ||
private static ZwiftMessages.PlayerState playerState; | ||
|
||
public static void zwift_api_decodemessage_player(byte[] value) { | ||
try { | ||
playerState = ZwiftMessages.PlayerState.parseFrom(value); | ||
// Ora puoi usare 'message' come un oggetto normale | ||
} catch (InvalidProtocolBufferException e) { | ||
// Gestisci l'eccezione se il messaggio non può essere parsato | ||
Log.e(TAG, e.toString()); | ||
} | ||
} | ||
|
||
public static float getAltitude() { | ||
Log.d(TAG, "getAltitude " + playerState.getAltitude()); | ||
return playerState.getAltitude(); | ||
} | ||
|
||
public static float getDistance() { | ||
Log.d(TAG, "getDistance " + playerState.getDistance()); | ||
return playerState.getDistance(); | ||
} | ||
} |
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,155 @@ | ||
syntax="proto3"; | ||
|
||
package org.cagnulen.qdomyoszwift; | ||
|
||
message PlayerState { | ||
int32 id = 1; | ||
int64 worldTime = 2; | ||
int32 distance = 3; | ||
int32 roadTime = 4; | ||
int32 laps = 5; | ||
int32 speed = 6; | ||
int32 roadPosition = 8; | ||
int32 cadenceUHz = 9; | ||
int32 heartrate = 11; | ||
int32 power = 12; | ||
int64 heading = 13; | ||
int32 lean = 14; | ||
int32 climbing = 15; | ||
int32 time = 16; | ||
int32 f19 = 19; | ||
int32 f20 = 20; | ||
int32 progress = 21; | ||
int64 customisationId = 22; | ||
int32 justWatching = 23; | ||
int32 calories = 24; | ||
float x = 25; | ||
float altitude = 26; | ||
float y = 27; | ||
int32 watchingRiderId = 28; | ||
int32 groupId = 29; | ||
int64 sport = 31; | ||
} | ||
|
||
message ClientToServer { | ||
int32 connected = 1; | ||
int32 rider_id = 2; | ||
int64 world_time = 3; | ||
PlayerState state = 7; | ||
int32 seqno = 4; | ||
int64 tag8 = 8; | ||
int64 tag9 = 9; | ||
int64 last_update = 10; | ||
int64 tag11 = 11; | ||
int64 last_player_update = 12; | ||
} | ||
|
||
message SegmentResult { | ||
int64 id = 1; | ||
int64 rider_id = 2; | ||
int64 event_subgroup_id = 6; | ||
string first_name = 7; | ||
string last_name = 8; | ||
string finish_time_str = 10; | ||
int64 elapsed_ms = 11; | ||
int32 powermeter = 12; | ||
int32 weight = 13; | ||
int32 power = 15; | ||
int32 heartrate = 19; | ||
} | ||
|
||
message SegmentResults { | ||
int64 world_id = 1; | ||
int64 segment_id = 2; | ||
int64 event_subgroup_id = 3; | ||
repeated SegmentResult segment_results = 4; | ||
} | ||
|
||
message UnknownMessage1 { | ||
// string firstName=7; | ||
// string lastName=8; | ||
// string timestamp=17; | ||
} | ||
|
||
message UnknownMessage { | ||
// int64 tag1=1; | ||
// UnknownMessage1 tag4=4; | ||
} | ||
|
||
message ServerToClient { | ||
int32 tag1 = 1; | ||
int32 rider_id = 2; | ||
int64 world_time = 3; | ||
int32 seqno = 4; | ||
repeated PlayerState player_states = 8; | ||
repeated UnknownMessage player_updates = 9; | ||
int64 tag11 = 11; | ||
int64 tag17 = 17; | ||
int32 num_msgs = 18; | ||
int32 msgnum = 19; | ||
} | ||
|
||
message WorldAttributes { | ||
int32 world_id = 1; | ||
string name = 2; | ||
int64 tag3 = 3; | ||
int64 tag5 = 4; | ||
int64 world_time = 6; | ||
int64 clock_time = 7; | ||
} | ||
|
||
message WorldAttribute { | ||
int64 world_time = 2; | ||
} | ||
|
||
message EventSubgroupProtobuf { | ||
int32 id = 1; | ||
string name = 2; | ||
int32 rules = 8; | ||
int32 route = 22; | ||
int32 laps = 25; | ||
int32 startLocation = 29; | ||
int32 label = 30; | ||
int32 paceType = 31; | ||
int32 jerseyHash = 36; | ||
} | ||
|
||
message RiderAttributes { | ||
int32 f2 = 2; | ||
int32 f3 = 3; | ||
message AttributeMessage { | ||
int32 myId = 1; | ||
int32 theirId = 2; | ||
string firstName = 3; | ||
string lastName = 4; | ||
int32 countryCode = 5; | ||
} | ||
AttributeMessage attributeMessage = 4; | ||
int32 theirId = 10; | ||
int32 f13 = 13; | ||
} | ||
|
||
message Profiles { | ||
repeated Profile profiles = 1; | ||
} | ||
|
||
message Profile { | ||
int32 id = 1; | ||
string firstName = 4; | ||
string lastName = 5; | ||
int32 male = 6; | ||
int32 weight = 9; | ||
int32 bodyType = 12; | ||
int32 countryCode = 34; | ||
int32 totalDistance = 35; | ||
int32 totalDistanceClimbed = 36; | ||
int32 totalTimeInMinutes = 37; | ||
int32 totalWattHours = 41; | ||
int32 height = 42; | ||
int32 totalExperiencePoints = 46; | ||
int32 achievementLevel = 49; | ||
int32 powerSource = 52; | ||
int32 age = 55; | ||
string launchedGameClient = 108; | ||
int32 currentActivityId = 109; | ||
} |
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
Oops, something went wrong.