Skip to content

Commit

Permalink
Update protobufs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Jan 1, 2025
1 parent 22ab283 commit d51bae5
Show file tree
Hide file tree
Showing 12 changed files with 1,380 additions and 172 deletions.
55 changes: 55 additions & 0 deletions protobuf/car_server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ message VehicleAction {
reserved 60;
reserved 76;
oneof vehicle_action_msg {
GetVehicleData getVehicleData = 1;
ChargingSetLimitAction chargingSetLimitAction = 5;
ChargingStartStopAction chargingStartStopAction = 6;
DrivingClearSpeedLimitPinAction drivingClearSpeedLimitPinAction = 7;
Expand Down Expand Up @@ -75,13 +76,67 @@ message VehicleAction {
}
}

message GetVehicleData {
GetChargeState getChargeState = 2;
GetClimateState getClimateState = 3;
GetDriveState getDriveState = 4;
reserved 5, 6;
GetLocationState getLocationState = 7;
GetClosuresState getClosuresState = 8;
GetChargeScheduleState getChargeScheduleState = 10;
GetPreconditioningScheduleState getPreconditioningScheduleState = 11;
reserved 12, 13;
GetTirePressureState getTirePressureState = 14;
GetMediaState getMediaState = 15;
GetMediaDetailState getMediaDetailState = 16;
GetSoftwareUpdateState getSoftwareUpdateState = 17;
GetParentalControlsState getParentalControlsState = 19;
}

message GetTirePressureState {
}

message GetMediaState {
}

message GetMediaDetailState {
}

message GetSoftwareUpdateState {
}

message GetChargeState {
}

message GetClimateState {
}

message GetDriveState {
}

message GetLocationState {
}

message GetClosuresState {
}

message GetChargeScheduleState {
}

message GetPreconditioningScheduleState {
}

message GetParentalControlsState {
}

message EraseUserDataAction {
string reason = 1;
}

message Response {
ActionStatus actionStatus = 1;
oneof response_msg {
VehicleData vehicleData = 2;
Signatures.SessionInfo getSessionInfoResponse = 3;
NearbyChargingSites getNearbyChargingSites = 5;
Ping ping = 9;
Expand Down
22 changes: 22 additions & 0 deletions protobuf/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ message LatLong {
float longitude = 2;
}

message ChargePortLatchState {
oneof type {
Void SNA = 1;
Void Disengaged = 2;
Void Engaged = 3;
Void Blocking = 4;
}
}

message PreconditioningTimes {
oneof times {
Void all_week = 1;
Expand All @@ -30,6 +39,19 @@ message OffPeakChargingTimes {
}
}

enum MediaPlaybackStatus {
Stopped = 0;
Playing = 1;
Paused = 2;
}

enum StwHeatLevel {
StwHeatLevel_Unknown = 0;
StwHeatLevel_Off = 1;
StwHeatLevel_Low = 2;
StwHeatLevel_High = 3;
}

message ChargeSchedule {
uint64 id = 1; // datetime in epoch time
string name = 2;
Expand Down
22 changes: 22 additions & 0 deletions protobuf/managed_charging.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
syntax = "proto3";

package ManagedCharging;

option go_package = "github.com/teslamotors/vehicle-command/pkg/protocol/protobuf/managedcharging";

// The reasons why the site controller may recommend no charge.
// The site controller will only return the highest priority reason to the vehicle.
enum ChargeOnSolarNoChargeReason {
CHARGE_ON_SOLAR_NO_CHARGE_REASON_INVALID = 0;
// The Powerwall is being prioritized over the vehicle to charge.
CHARGE_ON_SOLAR_NO_CHARGE_REASON_POWERWALL_CHARGE_PRIORITY = 1;
// There is not enough solar for the vehicle to charge effectively.
CHARGE_ON_SOLAR_NO_CHARGE_REASON_INSUFFICIENT_SOLAR = 2;
// The site controller is prioritizing export to the grid. This can
// happen when the site controller is in autonomous mode and it is
// most economical to export excess solar to the grid, or during a
// virtual power plant event.
CHARGE_ON_SOLAR_NO_CHARGE_REASON_GRID_EXPORT_PRIORITY = 3;
// Another vehicle is charging on solar at this location and has priority.
CHARGE_ON_SOLAR_NO_CHARGE_REASON_ALTERNATE_VEHICLE_CHARGE_PRIORITY = 4;
}
10 changes: 10 additions & 0 deletions protobuf/signatures.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ enum Tag
TAG_COUNTER = 5;
TAG_CHALLENGE = 6;
TAG_FLAGS = 7;
TAG_REQUEST_HASH = 8;
TAG_FAULT = 9;
TAG_END = 255;
}

Expand All @@ -25,6 +27,7 @@ enum SignatureType
SIGNATURE_TYPE_HMAC = 6;
reserved 7;
SIGNATURE_TYPE_HMAC_PERSONALIZED = 8;
SIGNATURE_TYPE_AES_GCM_RESPONSE = 9;
}

message KeyIdentity {
Expand All @@ -43,6 +46,12 @@ message AES_GCM_Personalized_Signature_Data {
bytes tag = 5;
}

message AES_GCM_Response_Signature_Data {
bytes nonce = 1;
uint32 counter = 2;
bytes tag = 3;
}

message HMAC_Signature_Data {
bytes tag = 1;
}
Expand All @@ -61,6 +70,7 @@ message SignatureData {
AES_GCM_Personalized_Signature_Data AES_GCM_Personalized_data = 5;
HMAC_Signature_Data session_info_tag = 6;
HMAC_Personalized_Signature_Data HMAC_Personalized_data = 8;
AES_GCM_Response_Signature_Data AES_GCM_Response_data = 9;
}
}

Expand Down
6 changes: 6 additions & 0 deletions protobuf/universal_message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ enum MessageFault_E
MESSAGEFAULT_ERROR_REMOTE_ACCESS_DISABLED = 21; // The vehicle owner has disabled Mobile access.
MESSAGEFAULT_ERROR_REMOTE_SERVICE_ACCESS_DISABLED = 22; // The command was authorized with a Service key, but the vehicle has not been configured to permit remote service commands.
MESSAGEFAULT_ERROR_COMMAND_REQUIRES_ACCOUNT_CREDENTIALS = 23; // The command requires proof of Tesla account credentials but was not sent over a channel that provides this proof. Resend the command using Fleet API.
MESSAGEFAULT_ERROR_REQUEST_MTU_EXCEEDED = 24; // Client sent a request with a field that exceeds MTU
MESSAGEFAULT_ERROR_RESPONSE_MTU_EXCEEDED = 25; // Client's request was received, but response size exceeded MTU
MESSAGEFAULT_ERROR_REPEATED_COUNTER = 26;
MESSAGEFAULT_ERROR_INVALID_KEY_HANDLE = 27;
MESSAGEFAULT_ERROR_REQUIRES_RESPONSE_ENCRYPTION = 28;
}

message MessageStatus
Expand All @@ -69,6 +74,7 @@ message SessionInfoRequest

enum Flags {
FLAG_USER_COMMAND = 0;
FLAG_ENCRYPT_RESPONSE = 1;
}

message RoutableMessage {
Expand Down
Loading

0 comments on commit d51bae5

Please sign in to comment.