Repository navigation
Conversation
charging.session.trip_target read field 2 as the target SoC. In the app's message (d5l) field 1 is the SoC, field 2 the minutes until it is reached and field 3 a status, so a target of 80% with 45 minutes to go was reported as 45%. Read all three, emitting the minutes as chargingTripTargetMinsRemaining, the name GraphQL already uses.
A frame with a target but no time estimate (#2 absent or 0) decoded as 0 minutes, which a consumer shows as "0 min". The app hides the minutes when they are <= 0, so report None for them, as for 0xFFFF.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
charging.session.trip_targetis decoded with the wrong field layout. The schema has onefield,
soc_limit = 2. The app's message for this topic (d5l, dispatched fromc97.java:581in app 3.16.0) has three:soctime_estimatestatusThe app stores #1 and #2 unchanged as
chargingTripTargetSocandchargingTripTargetMinsRemaining(qp2.java:130-131), the same names as the two gatewayfields in
schemas/gateway.graphql. So today the decoder reports the minutes as the SoCand never reads the SoC at all.
The same bytes, an 80% target with 45 minutes to go (
08 50 10 2d 18 01):{"chargingTripTargetSoc": 45}{"chargingTripTargetSoc": 80, "chargingTripTargetMinsRemaining": 45, "_chargingTripTargetStatus": 1}The one frame we have captured from a vehicle is
10 ff ff 03: #2 = 0xFFFF and no #1. Thecurrent comment, "0xFFFF when not set", comes from frames like this one, and the
decoder gives
Nonefor it before and after this change. The 0xFFFF belongs to the minutes,though, not to the SoC.
Changes
charging.proto:TripTargetgetssoc = 1,time_estimate = 2andstatus = 3(
int32, enum type unknown). Regeneratedcharging_pb2.py/.pyi. No other module changed.decode_trip_target:chargingTripTargetSockeeps its key. It is set only when GraphQL Endpoints #1 is 1-100, the same checkthe app makes before it shows a trip target on any screen (
np4.java:81,y13.java:397,j23.java:1146). Otherwise it isNone, as before.chargingTripTargetMinsRemaining(minutes), with the gateway's name. It is set onlywhen there is a target and the value is 1 to 0xFFFE. Otherwise it is
None: Add CI to run tests #2 absentor 0 (the app hides the minutes when they are
<= 0), or 0xFFFF._chargingTripTargetStatusis the raw value, following_unexpectedStopReason.tests/parallax/test_charging.py: the 80%/45 min case, with a check that itserializes to
0850102d1801, so the field numbers are pinned; the 0xFFFF minutes case; an80% target with Add CI to run tests #2 absent (
08 50), which givesNoneminutes rather than 0; no target atSoC 0 and 101; and the captured
10ffff03frame.Testing
236 passed (232 before, plus 4 new;
test_trip_targetwas rewritten). Ruff and mypy areclean.
Notes
set yet. The only capture is the "no target" frame above. We will check one live frame with a
target set before marking this ready.
Nonebecause the captured frame sends it. The app itself nevertests for 0xFFFF. It only hides the indicator when the SoC is outside 1-100, and the
minutes when they are
<= 0, which the decoder follows by reportingNonethere too, soa consumer shows unknown instead of "0 min".
status(Fixes error in publish #3) has no accessor in any of the 54 app versions we checked, so it stays raw.