Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support vehicle data over BLE #330

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

sethterashima
Copy link
Collaborator

Description

Adds support for fetching and decrypting vehicle data over BLE. Some types of vehicle data are not available prior to 2024.38.

Fixes #229 #52

Type of change

Please select all options that apply to this change:

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update

Checklist:

Confirm you have completed the following steps:

  • My code follows the style of this project.
  • I have performed a self-review of my code.
  • I have made corresponding updates to the documentation.
  • I have added/updated unit tests to cover my changes.

Seth Terashima added 2 commits November 16, 2024 10:38
Clients indicate that they support encrypted vehicle responses by
setting a flag bit in the request. The flag is authenticated but ignored
by vehicles that do not support encryption.

Clients should always set the flag when possible. In the future,
vehicles may refuse to respond to certain requests if the client does
not support this feature.
Vehicle Data commands are intended to work over BLE. The Fleet API
vehicle data endpoint is more efficient when using an Internet
connection.
@kirichkov
Copy link

Thanks for this addition! I don't see the DriveState returning the vehicle's location. Any chance we can obtain the vehicle's location via BLE, or will this data remain available via API-only?

message DriveState {
ShiftState shift_state = 1;
oneof optional_speed { uint32 speed = 102; }
oneof optional_power { int32 power = 103; }
google.protobuf.Timestamp timestamp = 4;
oneof optional_odometer_in_hundredths_of_a_mile { int32 odometer_in_hundredths_of_a_mile = 105; }
oneof optional_speed_float { float speed_float = 106; }
oneof optional_active_route_destination { string active_route_destination = 7; }
oneof optional_active_route_minutes_to_arrival { float active_route_minutes_to_arrival = 8; }
oneof optional_active_route_miles_to_arrival { float active_route_miles_to_arrival = 9; }
oneof optional_active_route_traffic_minutes_delay { float active_route_traffic_minutes_delay = 10; }
oneof optional_active_route_energy_at_arrival { float active_route_energy_at_arrival = 11; }
oneof optional_last_route_update { uint32 last_route_update = 14; }
google.protobuf.Timestamp last_traffic_update = 15;
LatLong active_route_coordinates = 12;
}

@sethterashima
Copy link
Collaborator Author

@kirichkov The vehicle location API is undergoing some refactoring; I hope to add support to the SDK once the API is stable.

@kirichkov
Copy link

@kirichkov The vehicle location API is undergoing some refactoring; I hope to add support to the SDK once the API is stable.

Thanks for the clarification!

@sethterashima sethterashima merged commit 7457011 into teslamotors:main Nov 18, 2024
1 check passed
@sethterashima sethterashima deleted the vehicle-data branch November 21, 2024 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: IsChargerConnected and IsSOCbelowChargingLimit via BLE
4 participants