@teslemetry/tesla-protocol 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/command/car_server.cjs +11126 -0
- package/dist/command/car_server.d.cts +1281 -0
- package/dist/command/car_server.d.mts +1281 -0
- package/dist/command/car_server.mjs +10880 -0
- package/dist/command/common.cjs +1536 -0
- package/dist/command/common.d.cts +327 -0
- package/dist/command/common.d.mts +327 -0
- package/dist/command/common.mjs +1488 -0
- package/dist/command/errors.cjs +107 -0
- package/dist/command/errors.d.cts +40 -0
- package/dist/command/errors.d.mts +40 -0
- package/dist/command/errors.mjs +102 -0
- package/dist/command/google/protobuf/timestamp.cjs +71 -0
- package/dist/command/google/protobuf/timestamp.d.cts +124 -0
- package/dist/command/google/protobuf/timestamp.d.mts +124 -0
- package/dist/command/google/protobuf/timestamp.mjs +69 -0
- package/dist/command/google/protobuf/wrappers.cjs +421 -0
- package/dist/command/google/protobuf/wrappers.d.cts +134 -0
- package/dist/command/google/protobuf/wrappers.d.mts +134 -0
- package/dist/command/google/protobuf/wrappers.mjs +411 -0
- package/dist/command/keys.cjs +60 -0
- package/dist/command/keys.d.cts +23 -0
- package/dist/command/keys.d.mts +23 -0
- package/dist/command/keys.mjs +56 -0
- package/dist/command/managed_charging.cjs +435 -0
- package/dist/command/managed_charging.d.cts +86 -0
- package/dist/command/managed_charging.d.mts +86 -0
- package/dist/command/managed_charging.mjs +421 -0
- package/dist/command/session.cjs +119 -0
- package/dist/command/session.d.cts +28 -0
- package/dist/command/session.d.mts +28 -0
- package/dist/command/session.mjs +117 -0
- package/dist/command/signatures.cjs +696 -0
- package/dist/command/signatures.d.cts +107 -0
- package/dist/command/signatures.d.mts +107 -0
- package/dist/command/signatures.mjs +678 -0
- package/dist/command/universal_message.cjs +588 -0
- package/dist/command/universal_message.d.cts +141 -0
- package/dist/command/universal_message.d.mts +141 -0
- package/dist/command/universal_message.mjs +571 -0
- package/dist/command/vcsec.cjs +2281 -0
- package/dist/command/vcsec.d.cts +404 -0
- package/dist/command/vcsec.d.mts +404 -0
- package/dist/command/vcsec.mjs +2218 -0
- package/dist/command/vehicle.cjs +10332 -0
- package/dist/command/vehicle.d.cts +1429 -0
- package/dist/command/vehicle.d.mts +1429 -0
- package/dist/command/vehicle.mjs +10168 -0
- package/dist/energy_command/identifier_type.cjs +47 -0
- package/dist/energy_command/identifier_type.d.cts +19 -0
- package/dist/energy_command/identifier_type.d.mts +19 -0
- package/dist/energy_command/identifier_type.mjs +43 -0
- package/dist/energy_device/authorization_api.cjs +815 -0
- package/dist/energy_device/authorization_api.d.cts +92 -0
- package/dist/energy_device/authorization_api.d.mts +92 -0
- package/dist/energy_device/authorization_api.mjs +801 -0
- package/dist/energy_device/authorization_types.cjs +348 -0
- package/dist/energy_device/authorization_types.d.cts +79 -0
- package/dist/energy_device/authorization_types.d.mts +79 -0
- package/dist/energy_device/authorization_types.mjs +331 -0
- package/dist/energy_device/common_api.cjs +2104 -0
- package/dist/energy_device/common_api.d.cts +211 -0
- package/dist/energy_device/common_api.d.mts +211 -0
- package/dist/energy_device/common_api.mjs +2064 -0
- package/dist/energy_device/device.cjs +485 -0
- package/dist/energy_device/device.d.cts +102 -0
- package/dist/energy_device/device.d.mts +102 -0
- package/dist/energy_device/device.mjs +462 -0
- package/dist/energy_device/energy.cjs +442 -0
- package/dist/energy_device/energy.d.cts +82 -0
- package/dist/energy_device/energy.d.mts +82 -0
- package/dist/energy_device/energy.mjs +429 -0
- package/dist/energy_device/energy_site_net.cjs +235 -0
- package/dist/energy_device/energy_site_net.d.cts +69 -0
- package/dist/energy_device/energy_site_net.d.mts +69 -0
- package/dist/energy_device/energy_site_net.mjs +219 -0
- package/dist/energy_device/error.cjs +53 -0
- package/dist/energy_device/error.d.cts +27 -0
- package/dist/energy_device/error.d.mts +27 -0
- package/dist/energy_device/error.mjs +51 -0
- package/dist/energy_device/google/protobuf/timestamp.cjs +71 -0
- package/dist/energy_device/google/protobuf/timestamp.d.cts +124 -0
- package/dist/energy_device/google/protobuf/timestamp.d.mts +124 -0
- package/dist/energy_device/google/protobuf/timestamp.mjs +69 -0
- package/dist/energy_device/google/protobuf/wrappers.cjs +421 -0
- package/dist/energy_device/google/protobuf/wrappers.d.cts +134 -0
- package/dist/energy_device/google/protobuf/wrappers.d.mts +134 -0
- package/dist/energy_device/google/protobuf/wrappers.mjs +411 -0
- package/dist/energy_device/google/rpc/status.cjs +65 -0
- package/dist/energy_device/google/rpc/status.d.cts +26 -0
- package/dist/energy_device/google/rpc/status.d.mts +26 -0
- package/dist/energy_device/google/rpc/status.mjs +63 -0
- package/dist/energy_device/networking.cjs +834 -0
- package/dist/energy_device/networking.d.cts +141 -0
- package/dist/energy_device/networking.d.mts +141 -0
- package/dist/energy_device/networking.mjs +810 -0
- package/dist/energy_device/teg_api.cjs +594 -0
- package/dist/energy_device/teg_api.d.cts +140 -0
- package/dist/energy_device/teg_api.d.mts +140 -0
- package/dist/energy_device/teg_api.mjs +581 -0
- package/dist/energy_device/transport.cjs +478 -0
- package/dist/energy_device/transport.d.cts +95 -0
- package/dist/energy_device/transport.d.mts +95 -0
- package/dist/energy_device/transport.mjs +460 -0
- package/dist/energy_device/update.cjs +521 -0
- package/dist/energy_device/update.d.cts +86 -0
- package/dist/energy_device/update.d.mts +86 -0
- package/dist/energy_device/update.mjs +506 -0
- package/dist/energy_device/wall_connector.cjs +634 -0
- package/dist/energy_device/wall_connector.d.cts +182 -0
- package/dist/energy_device/wall_connector.d.mts +182 -0
- package/dist/energy_device/wall_connector.mjs +590 -0
- package/dist/telemetry/google/protobuf/timestamp.cjs +71 -0
- package/dist/telemetry/google/protobuf/timestamp.d.cts +124 -0
- package/dist/telemetry/google/protobuf/timestamp.d.mts +124 -0
- package/dist/telemetry/google/protobuf/timestamp.mjs +69 -0
- package/dist/telemetry/vehicle_alert.cjs +214 -0
- package/dist/telemetry/vehicle_alert.d.cts +48 -0
- package/dist/telemetry/vehicle_alert.d.mts +48 -0
- package/dist/telemetry/vehicle_alert.mjs +208 -0
- package/dist/telemetry/vehicle_connectivity.cjs +145 -0
- package/dist/telemetry/vehicle_connectivity.d.cts +41 -0
- package/dist/telemetry/vehicle_connectivity.d.mts +41 -0
- package/dist/telemetry/vehicle_connectivity.mjs +140 -0
- package/dist/telemetry/vehicle_data.cjs +3792 -0
- package/dist/telemetry/vehicle_data.d.cts +872 -0
- package/dist/telemetry/vehicle_data.d.mts +872 -0
- package/dist/telemetry/vehicle_data.mjs +3655 -0
- package/dist/telemetry/vehicle_error.cjs +245 -0
- package/dist/telemetry/vehicle_error.d.cts +45 -0
- package/dist/telemetry/vehicle_error.d.mts +45 -0
- package/dist/telemetry/vehicle_error.mjs +241 -0
- package/dist/telemetry/vehicle_metric.cjs +236 -0
- package/dist/telemetry/vehicle_metric.d.cts +44 -0
- package/dist/telemetry/vehicle_metric.d.mts +44 -0
- package/dist/telemetry/vehicle_metric.mjs +232 -0
- package/dist/teslapower/google/protobuf/any.cjs +84 -0
- package/dist/teslapower/google/protobuf/any.d.cts +140 -0
- package/dist/teslapower/google/protobuf/any.d.mts +140 -0
- package/dist/teslapower/google/protobuf/any.mjs +82 -0
- package/dist/teslapower/google/protobuf/timestamp.cjs +71 -0
- package/dist/teslapower/google/protobuf/timestamp.d.cts +124 -0
- package/dist/teslapower/google/protobuf/timestamp.d.mts +124 -0
- package/dist/teslapower/google/protobuf/timestamp.mjs +69 -0
- package/dist/teslapower/teslapower.cjs +5486 -0
- package/dist/teslapower/teslapower.d.cts +518 -0
- package/dist/teslapower/teslapower.d.mts +518 -0
- package/dist/teslapower/teslapower.mjs +5381 -0
- package/package.json +53 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
//#region src/energy_device/device.ts
|
|
3
|
+
const protobufPackage = "tesla.proto.energy_device.v1";
|
|
4
|
+
/**
|
|
5
|
+
* TESLEMETRY SOURCE-OF-RECORD - no upstream.
|
|
6
|
+
* Provenance: Tesla Energy gateway (TEG) local API, from our own
|
|
7
|
+
* observations and contributions from the community
|
|
8
|
+
*/
|
|
9
|
+
let DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
10
|
+
DeviceType[DeviceType["DEVICE_TYPE_INVALID"] = 0] = "DEVICE_TYPE_INVALID";
|
|
11
|
+
DeviceType[DeviceType["DEVICE_TYPE_GEN3WC"] = 1] = "DEVICE_TYPE_GEN3WC";
|
|
12
|
+
DeviceType[DeviceType["DEVICE_TYPE_PVCOM"] = 2] = "DEVICE_TYPE_PVCOM";
|
|
13
|
+
DeviceType[DeviceType["DEVICE_TYPE_MSA"] = 3] = "DEVICE_TYPE_MSA";
|
|
14
|
+
DeviceType[DeviceType["DEVICE_TYPE_SITECONTROLLER"] = 4] = "DEVICE_TYPE_SITECONTROLLER";
|
|
15
|
+
DeviceType[DeviceType["DEVICE_TYPE_MEGAPUTER"] = 5] = "DEVICE_TYPE_MEGAPUTER";
|
|
16
|
+
DeviceType[DeviceType["DEVICE_TYPE_IPM"] = 6] = "DEVICE_TYPE_IPM";
|
|
17
|
+
DeviceType[DeviceType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
18
|
+
return DeviceType;
|
|
19
|
+
}({});
|
|
20
|
+
function deviceTypeFromJSON(object) {
|
|
21
|
+
switch (object) {
|
|
22
|
+
case 0:
|
|
23
|
+
case "DEVICE_TYPE_INVALID": return 0;
|
|
24
|
+
case 1:
|
|
25
|
+
case "DEVICE_TYPE_GEN3WC": return 1;
|
|
26
|
+
case 2:
|
|
27
|
+
case "DEVICE_TYPE_PVCOM": return 2;
|
|
28
|
+
case 3:
|
|
29
|
+
case "DEVICE_TYPE_MSA": return 3;
|
|
30
|
+
case 4:
|
|
31
|
+
case "DEVICE_TYPE_SITECONTROLLER": return 4;
|
|
32
|
+
case 5:
|
|
33
|
+
case "DEVICE_TYPE_MEGAPUTER": return 5;
|
|
34
|
+
case 6:
|
|
35
|
+
case "DEVICE_TYPE_IPM": return 6;
|
|
36
|
+
default: return -1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function deviceTypeToJSON(object) {
|
|
40
|
+
switch (object) {
|
|
41
|
+
case 0: return "DEVICE_TYPE_INVALID";
|
|
42
|
+
case 1: return "DEVICE_TYPE_GEN3WC";
|
|
43
|
+
case 2: return "DEVICE_TYPE_PVCOM";
|
|
44
|
+
case 3: return "DEVICE_TYPE_MSA";
|
|
45
|
+
case 4: return "DEVICE_TYPE_SITECONTROLLER";
|
|
46
|
+
case 5: return "DEVICE_TYPE_MEGAPUTER";
|
|
47
|
+
case 6: return "DEVICE_TYPE_IPM";
|
|
48
|
+
default: return "UNRECOGNIZED";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
let DeviceCertFormat = /* @__PURE__ */ function(DeviceCertFormat) {
|
|
52
|
+
DeviceCertFormat[DeviceCertFormat["DEVICE_CERT_FORMAT_INVALID"] = 0] = "DEVICE_CERT_FORMAT_INVALID";
|
|
53
|
+
DeviceCertFormat[DeviceCertFormat["DEVICE_CERT_FORMAT_DER"] = 1] = "DEVICE_CERT_FORMAT_DER";
|
|
54
|
+
DeviceCertFormat[DeviceCertFormat["DEVICE_CERT_FORMAT_PEM"] = 2] = "DEVICE_CERT_FORMAT_PEM";
|
|
55
|
+
DeviceCertFormat[DeviceCertFormat["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
56
|
+
return DeviceCertFormat;
|
|
57
|
+
}({});
|
|
58
|
+
function deviceCertFormatFromJSON(object) {
|
|
59
|
+
switch (object) {
|
|
60
|
+
case 0:
|
|
61
|
+
case "DEVICE_CERT_FORMAT_INVALID": return 0;
|
|
62
|
+
case 1:
|
|
63
|
+
case "DEVICE_CERT_FORMAT_DER": return 1;
|
|
64
|
+
case 2:
|
|
65
|
+
case "DEVICE_CERT_FORMAT_PEM": return 2;
|
|
66
|
+
default: return -1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function deviceCertFormatToJSON(object) {
|
|
70
|
+
switch (object) {
|
|
71
|
+
case 0: return "DEVICE_CERT_FORMAT_INVALID";
|
|
72
|
+
case 1: return "DEVICE_CERT_FORMAT_DER";
|
|
73
|
+
case 2: return "DEVICE_CERT_FORMAT_PEM";
|
|
74
|
+
default: return "UNRECOGNIZED";
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
let DeviceSignatureType = /* @__PURE__ */ function(DeviceSignatureType) {
|
|
78
|
+
DeviceSignatureType[DeviceSignatureType["DEVICE_SIGNATURE_TYPE_INVALID"] = 0] = "DEVICE_SIGNATURE_TYPE_INVALID";
|
|
79
|
+
DeviceSignatureType[DeviceSignatureType["DEVICE_SIGNATURE_TYPE_SHA256_ECDSA_ASN1"] = 1] = "DEVICE_SIGNATURE_TYPE_SHA256_ECDSA_ASN1";
|
|
80
|
+
DeviceSignatureType[DeviceSignatureType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
81
|
+
return DeviceSignatureType;
|
|
82
|
+
}({});
|
|
83
|
+
function deviceSignatureTypeFromJSON(object) {
|
|
84
|
+
switch (object) {
|
|
85
|
+
case 0:
|
|
86
|
+
case "DEVICE_SIGNATURE_TYPE_INVALID": return 0;
|
|
87
|
+
case 1:
|
|
88
|
+
case "DEVICE_SIGNATURE_TYPE_SHA256_ECDSA_ASN1": return 1;
|
|
89
|
+
default: return -1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function deviceSignatureTypeToJSON(object) {
|
|
93
|
+
switch (object) {
|
|
94
|
+
case 0: return "DEVICE_SIGNATURE_TYPE_INVALID";
|
|
95
|
+
case 1: return "DEVICE_SIGNATURE_TYPE_SHA256_ECDSA_ASN1";
|
|
96
|
+
default: return "UNRECOGNIZED";
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
let Cipher = /* @__PURE__ */ function(Cipher) {
|
|
100
|
+
Cipher[Cipher["CIPHER_INVALID"] = 0] = "CIPHER_INVALID";
|
|
101
|
+
Cipher[Cipher["CIPHER_RSA_OAEP_SHA256"] = 2] = "CIPHER_RSA_OAEP_SHA256";
|
|
102
|
+
Cipher[Cipher["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
103
|
+
return Cipher;
|
|
104
|
+
}({});
|
|
105
|
+
function cipherFromJSON(object) {
|
|
106
|
+
switch (object) {
|
|
107
|
+
case 0:
|
|
108
|
+
case "CIPHER_INVALID": return 0;
|
|
109
|
+
case 2:
|
|
110
|
+
case "CIPHER_RSA_OAEP_SHA256": return 2;
|
|
111
|
+
default: return -1;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function cipherToJSON(object) {
|
|
115
|
+
switch (object) {
|
|
116
|
+
case 0: return "CIPHER_INVALID";
|
|
117
|
+
case 2: return "CIPHER_RSA_OAEP_SHA256";
|
|
118
|
+
default: return "UNRECOGNIZED";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
let TEGDeviceType = /* @__PURE__ */ function(TEGDeviceType) {
|
|
122
|
+
TEGDeviceType[TEGDeviceType["TEG_DEVICE_TYPE_INVALID"] = 0] = "TEG_DEVICE_TYPE_INVALID";
|
|
123
|
+
TEGDeviceType[TEGDeviceType["TEG_DEVICE_TYPE_SMC"] = 1] = "TEG_DEVICE_TYPE_SMC";
|
|
124
|
+
TEGDeviceType[TEGDeviceType["TEG_DEVICE_TYPE_HEC_GATEWAY1"] = 2] = "TEG_DEVICE_TYPE_HEC_GATEWAY1";
|
|
125
|
+
TEGDeviceType[TEGDeviceType["TEG_DEVICE_TYPE_TEG_GATEWAY2"] = 3] = "TEG_DEVICE_TYPE_TEG_GATEWAY2";
|
|
126
|
+
TEGDeviceType[TEGDeviceType["TEG_DEVICE_TYPE_TEG_POWERWALLPLUS"] = 4] = "TEG_DEVICE_TYPE_TEG_POWERWALLPLUS";
|
|
127
|
+
TEGDeviceType[TEGDeviceType["TEG_DEVICE_TYPE_TEG_MP1"] = 5] = "TEG_DEVICE_TYPE_TEG_MP1";
|
|
128
|
+
TEGDeviceType[TEGDeviceType["TEG_DEVICE_TYPE_TEG_SUPERCHARGER"] = 6] = "TEG_DEVICE_TYPE_TEG_SUPERCHARGER";
|
|
129
|
+
TEGDeviceType[TEGDeviceType["TEG_DEVICE_TYPE_TACO_POWERWALL3"] = 7] = "TEG_DEVICE_TYPE_TACO_POWERWALL3";
|
|
130
|
+
TEGDeviceType[TEGDeviceType["TEG_DEVICE_TYPE_TEG_PVI"] = 8] = "TEG_DEVICE_TYPE_TEG_PVI";
|
|
131
|
+
TEGDeviceType[TEGDeviceType["TEG_DEVICE_TYPE_TACO_GATEWAY3V"] = 9] = "TEG_DEVICE_TYPE_TACO_GATEWAY3V";
|
|
132
|
+
TEGDeviceType[TEGDeviceType["TEG_DEVICE_TYPE_TACO_WALLBOX"] = 10] = "TEG_DEVICE_TYPE_TACO_WALLBOX";
|
|
133
|
+
TEGDeviceType[TEGDeviceType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
134
|
+
return TEGDeviceType;
|
|
135
|
+
}({});
|
|
136
|
+
function tEGDeviceTypeFromJSON(object) {
|
|
137
|
+
switch (object) {
|
|
138
|
+
case 0:
|
|
139
|
+
case "TEG_DEVICE_TYPE_INVALID": return 0;
|
|
140
|
+
case 1:
|
|
141
|
+
case "TEG_DEVICE_TYPE_SMC": return 1;
|
|
142
|
+
case 2:
|
|
143
|
+
case "TEG_DEVICE_TYPE_HEC_GATEWAY1": return 2;
|
|
144
|
+
case 3:
|
|
145
|
+
case "TEG_DEVICE_TYPE_TEG_GATEWAY2": return 3;
|
|
146
|
+
case 4:
|
|
147
|
+
case "TEG_DEVICE_TYPE_TEG_POWERWALLPLUS": return 4;
|
|
148
|
+
case 5:
|
|
149
|
+
case "TEG_DEVICE_TYPE_TEG_MP1": return 5;
|
|
150
|
+
case 6:
|
|
151
|
+
case "TEG_DEVICE_TYPE_TEG_SUPERCHARGER": return 6;
|
|
152
|
+
case 7:
|
|
153
|
+
case "TEG_DEVICE_TYPE_TACO_POWERWALL3": return 7;
|
|
154
|
+
case 8:
|
|
155
|
+
case "TEG_DEVICE_TYPE_TEG_PVI": return 8;
|
|
156
|
+
case 9:
|
|
157
|
+
case "TEG_DEVICE_TYPE_TACO_GATEWAY3V": return 9;
|
|
158
|
+
case 10:
|
|
159
|
+
case "TEG_DEVICE_TYPE_TACO_WALLBOX": return 10;
|
|
160
|
+
default: return -1;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function tEGDeviceTypeToJSON(object) {
|
|
164
|
+
switch (object) {
|
|
165
|
+
case 0: return "TEG_DEVICE_TYPE_INVALID";
|
|
166
|
+
case 1: return "TEG_DEVICE_TYPE_SMC";
|
|
167
|
+
case 2: return "TEG_DEVICE_TYPE_HEC_GATEWAY1";
|
|
168
|
+
case 3: return "TEG_DEVICE_TYPE_TEG_GATEWAY2";
|
|
169
|
+
case 4: return "TEG_DEVICE_TYPE_TEG_POWERWALLPLUS";
|
|
170
|
+
case 5: return "TEG_DEVICE_TYPE_TEG_MP1";
|
|
171
|
+
case 6: return "TEG_DEVICE_TYPE_TEG_SUPERCHARGER";
|
|
172
|
+
case 7: return "TEG_DEVICE_TYPE_TACO_POWERWALL3";
|
|
173
|
+
case 8: return "TEG_DEVICE_TYPE_TEG_PVI";
|
|
174
|
+
case 9: return "TEG_DEVICE_TYPE_TACO_GATEWAY3V";
|
|
175
|
+
case 10: return "TEG_DEVICE_TYPE_TACO_WALLBOX";
|
|
176
|
+
default: return "UNRECOGNIZED";
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
let iPMDeviceType = /* @__PURE__ */ function(iPMDeviceType) {
|
|
180
|
+
iPMDeviceType[iPMDeviceType["IPM_DEVICE_TYPE_INVALID"] = 0] = "IPM_DEVICE_TYPE_INVALID";
|
|
181
|
+
iPMDeviceType[iPMDeviceType["IPM_DEVICE_TYPE_POWERPACK3"] = 1] = "IPM_DEVICE_TYPE_POWERPACK3";
|
|
182
|
+
iPMDeviceType[iPMDeviceType["IPM_DEVICE_TYPE_SUPERCHARGER4"] = 2] = "IPM_DEVICE_TYPE_SUPERCHARGER4";
|
|
183
|
+
iPMDeviceType[iPMDeviceType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
184
|
+
return iPMDeviceType;
|
|
185
|
+
}({});
|
|
186
|
+
function iPMDeviceTypeFromJSON(object) {
|
|
187
|
+
switch (object) {
|
|
188
|
+
case 0:
|
|
189
|
+
case "IPM_DEVICE_TYPE_INVALID": return 0;
|
|
190
|
+
case 1:
|
|
191
|
+
case "IPM_DEVICE_TYPE_POWERPACK3": return 1;
|
|
192
|
+
case 2:
|
|
193
|
+
case "IPM_DEVICE_TYPE_SUPERCHARGER4": return 2;
|
|
194
|
+
default: return -1;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function iPMDeviceTypeToJSON(object) {
|
|
198
|
+
switch (object) {
|
|
199
|
+
case 0: return "IPM_DEVICE_TYPE_INVALID";
|
|
200
|
+
case 1: return "IPM_DEVICE_TYPE_POWERPACK3";
|
|
201
|
+
case 2: return "IPM_DEVICE_TYPE_SUPERCHARGER4";
|
|
202
|
+
default: return "UNRECOGNIZED";
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function createBaseDin() {
|
|
206
|
+
return { value: "" };
|
|
207
|
+
}
|
|
208
|
+
const Din = {
|
|
209
|
+
encode(message, writer = new BinaryWriter()) {
|
|
210
|
+
if (message.value !== "") writer.uint32(10).string(message.value);
|
|
211
|
+
return writer;
|
|
212
|
+
},
|
|
213
|
+
decode(input, length) {
|
|
214
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
215
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
216
|
+
const message = createBaseDin();
|
|
217
|
+
while (reader.pos < end) {
|
|
218
|
+
const tag = reader.uint32();
|
|
219
|
+
switch (tag >>> 3) {
|
|
220
|
+
case 1:
|
|
221
|
+
if (tag !== 10) break;
|
|
222
|
+
message.value = reader.string();
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
226
|
+
reader.skip(tag & 7);
|
|
227
|
+
}
|
|
228
|
+
return message;
|
|
229
|
+
},
|
|
230
|
+
fromJSON(object) {
|
|
231
|
+
return { value: isSet(object.value) ? globalThis.String(object.value) : "" };
|
|
232
|
+
},
|
|
233
|
+
toJSON(message) {
|
|
234
|
+
const obj = {};
|
|
235
|
+
if (message.value !== void 0) obj.value = message.value;
|
|
236
|
+
return obj;
|
|
237
|
+
},
|
|
238
|
+
create(base) {
|
|
239
|
+
return Din.fromPartial(base ?? {});
|
|
240
|
+
},
|
|
241
|
+
fromPartial(object) {
|
|
242
|
+
const message = createBaseDin();
|
|
243
|
+
message.value = object.value ?? "";
|
|
244
|
+
return message;
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
function createBaseEcuId() {
|
|
248
|
+
return {
|
|
249
|
+
partNumber: "",
|
|
250
|
+
serialNumber: ""
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
const EcuId = {
|
|
254
|
+
encode(message, writer = new BinaryWriter()) {
|
|
255
|
+
if (message.partNumber !== "") writer.uint32(10).string(message.partNumber);
|
|
256
|
+
if (message.serialNumber !== "") writer.uint32(18).string(message.serialNumber);
|
|
257
|
+
return writer;
|
|
258
|
+
},
|
|
259
|
+
decode(input, length) {
|
|
260
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
261
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
262
|
+
const message = createBaseEcuId();
|
|
263
|
+
while (reader.pos < end) {
|
|
264
|
+
const tag = reader.uint32();
|
|
265
|
+
switch (tag >>> 3) {
|
|
266
|
+
case 1:
|
|
267
|
+
if (tag !== 10) break;
|
|
268
|
+
message.partNumber = reader.string();
|
|
269
|
+
continue;
|
|
270
|
+
case 2:
|
|
271
|
+
if (tag !== 18) break;
|
|
272
|
+
message.serialNumber = reader.string();
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
276
|
+
reader.skip(tag & 7);
|
|
277
|
+
}
|
|
278
|
+
return message;
|
|
279
|
+
},
|
|
280
|
+
fromJSON(object) {
|
|
281
|
+
return {
|
|
282
|
+
partNumber: isSet(object.partNumber) ? globalThis.String(object.partNumber) : "",
|
|
283
|
+
serialNumber: isSet(object.serialNumber) ? globalThis.String(object.serialNumber) : ""
|
|
284
|
+
};
|
|
285
|
+
},
|
|
286
|
+
toJSON(message) {
|
|
287
|
+
const obj = {};
|
|
288
|
+
if (message.partNumber !== void 0) obj.partNumber = message.partNumber;
|
|
289
|
+
if (message.serialNumber !== void 0) obj.serialNumber = message.serialNumber;
|
|
290
|
+
return obj;
|
|
291
|
+
},
|
|
292
|
+
create(base) {
|
|
293
|
+
return EcuId.fromPartial(base ?? {});
|
|
294
|
+
},
|
|
295
|
+
fromPartial(object) {
|
|
296
|
+
const message = createBaseEcuId();
|
|
297
|
+
message.partNumber = object.partNumber ?? "";
|
|
298
|
+
message.serialNumber = object.serialNumber ?? "";
|
|
299
|
+
return message;
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
function createBaseDeviceSignedPayload() {
|
|
303
|
+
return {
|
|
304
|
+
payload: /* @__PURE__ */ new Uint8Array(0),
|
|
305
|
+
deviceSignatureType: 0,
|
|
306
|
+
signature: /* @__PURE__ */ new Uint8Array(0),
|
|
307
|
+
deviceCertFormat: 0,
|
|
308
|
+
deviceCert: /* @__PURE__ */ new Uint8Array(0)
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
const DeviceSignedPayload = {
|
|
312
|
+
encode(message, writer = new BinaryWriter()) {
|
|
313
|
+
if (message.payload.length !== 0) writer.uint32(10).bytes(message.payload);
|
|
314
|
+
if (message.deviceSignatureType !== 0) writer.uint32(16).int32(message.deviceSignatureType);
|
|
315
|
+
if (message.signature.length !== 0) writer.uint32(26).bytes(message.signature);
|
|
316
|
+
if (message.deviceCertFormat !== 0) writer.uint32(32).int32(message.deviceCertFormat);
|
|
317
|
+
if (message.deviceCert.length !== 0) writer.uint32(42).bytes(message.deviceCert);
|
|
318
|
+
return writer;
|
|
319
|
+
},
|
|
320
|
+
decode(input, length) {
|
|
321
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
322
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
323
|
+
const message = createBaseDeviceSignedPayload();
|
|
324
|
+
while (reader.pos < end) {
|
|
325
|
+
const tag = reader.uint32();
|
|
326
|
+
switch (tag >>> 3) {
|
|
327
|
+
case 1:
|
|
328
|
+
if (tag !== 10) break;
|
|
329
|
+
message.payload = reader.bytes();
|
|
330
|
+
continue;
|
|
331
|
+
case 2:
|
|
332
|
+
if (tag !== 16) break;
|
|
333
|
+
message.deviceSignatureType = reader.int32();
|
|
334
|
+
continue;
|
|
335
|
+
case 3:
|
|
336
|
+
if (tag !== 26) break;
|
|
337
|
+
message.signature = reader.bytes();
|
|
338
|
+
continue;
|
|
339
|
+
case 4:
|
|
340
|
+
if (tag !== 32) break;
|
|
341
|
+
message.deviceCertFormat = reader.int32();
|
|
342
|
+
continue;
|
|
343
|
+
case 5:
|
|
344
|
+
if (tag !== 42) break;
|
|
345
|
+
message.deviceCert = reader.bytes();
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
349
|
+
reader.skip(tag & 7);
|
|
350
|
+
}
|
|
351
|
+
return message;
|
|
352
|
+
},
|
|
353
|
+
fromJSON(object) {
|
|
354
|
+
return {
|
|
355
|
+
payload: isSet(object.payload) ? bytesFromBase64(object.payload) : /* @__PURE__ */ new Uint8Array(0),
|
|
356
|
+
deviceSignatureType: isSet(object.deviceSignatureType) ? deviceSignatureTypeFromJSON(object.deviceSignatureType) : 0,
|
|
357
|
+
signature: isSet(object.signature) ? bytesFromBase64(object.signature) : /* @__PURE__ */ new Uint8Array(0),
|
|
358
|
+
deviceCertFormat: isSet(object.deviceCertFormat) ? deviceCertFormatFromJSON(object.deviceCertFormat) : 0,
|
|
359
|
+
deviceCert: isSet(object.deviceCert) ? bytesFromBase64(object.deviceCert) : /* @__PURE__ */ new Uint8Array(0)
|
|
360
|
+
};
|
|
361
|
+
},
|
|
362
|
+
toJSON(message) {
|
|
363
|
+
const obj = {};
|
|
364
|
+
if (message.payload !== void 0) obj.payload = base64FromBytes(message.payload);
|
|
365
|
+
if (message.deviceSignatureType !== void 0) obj.deviceSignatureType = deviceSignatureTypeToJSON(message.deviceSignatureType);
|
|
366
|
+
if (message.signature !== void 0) obj.signature = base64FromBytes(message.signature);
|
|
367
|
+
if (message.deviceCertFormat !== void 0) obj.deviceCertFormat = deviceCertFormatToJSON(message.deviceCertFormat);
|
|
368
|
+
if (message.deviceCert !== void 0) obj.deviceCert = base64FromBytes(message.deviceCert);
|
|
369
|
+
return obj;
|
|
370
|
+
},
|
|
371
|
+
create(base) {
|
|
372
|
+
return DeviceSignedPayload.fromPartial(base ?? {});
|
|
373
|
+
},
|
|
374
|
+
fromPartial(object) {
|
|
375
|
+
const message = createBaseDeviceSignedPayload();
|
|
376
|
+
message.payload = object.payload ?? /* @__PURE__ */ new Uint8Array(0);
|
|
377
|
+
message.deviceSignatureType = object.deviceSignatureType ?? 0;
|
|
378
|
+
message.signature = object.signature ?? /* @__PURE__ */ new Uint8Array(0);
|
|
379
|
+
message.deviceCertFormat = object.deviceCertFormat ?? 0;
|
|
380
|
+
message.deviceCert = object.deviceCert ?? /* @__PURE__ */ new Uint8Array(0);
|
|
381
|
+
return message;
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
function createBaseEncryptedMessage() {
|
|
385
|
+
return {
|
|
386
|
+
cipher: 0,
|
|
387
|
+
cipherText: /* @__PURE__ */ new Uint8Array(0)
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
const EncryptedMessage = {
|
|
391
|
+
encode(message, writer = new BinaryWriter()) {
|
|
392
|
+
if (message.cipher !== 0) writer.uint32(8).int32(message.cipher);
|
|
393
|
+
if (message.cipherText.length !== 0) writer.uint32(18).bytes(message.cipherText);
|
|
394
|
+
return writer;
|
|
395
|
+
},
|
|
396
|
+
decode(input, length) {
|
|
397
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
398
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
399
|
+
const message = createBaseEncryptedMessage();
|
|
400
|
+
while (reader.pos < end) {
|
|
401
|
+
const tag = reader.uint32();
|
|
402
|
+
switch (tag >>> 3) {
|
|
403
|
+
case 1:
|
|
404
|
+
if (tag !== 8) break;
|
|
405
|
+
message.cipher = reader.int32();
|
|
406
|
+
continue;
|
|
407
|
+
case 2:
|
|
408
|
+
if (tag !== 18) break;
|
|
409
|
+
message.cipherText = reader.bytes();
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
413
|
+
reader.skip(tag & 7);
|
|
414
|
+
}
|
|
415
|
+
return message;
|
|
416
|
+
},
|
|
417
|
+
fromJSON(object) {
|
|
418
|
+
return {
|
|
419
|
+
cipher: isSet(object.cipher) ? cipherFromJSON(object.cipher) : 0,
|
|
420
|
+
cipherText: isSet(object.cipherText) ? bytesFromBase64(object.cipherText) : /* @__PURE__ */ new Uint8Array(0)
|
|
421
|
+
};
|
|
422
|
+
},
|
|
423
|
+
toJSON(message) {
|
|
424
|
+
const obj = {};
|
|
425
|
+
if (message.cipher !== void 0) obj.cipher = cipherToJSON(message.cipher);
|
|
426
|
+
if (message.cipherText !== void 0) obj.cipherText = base64FromBytes(message.cipherText);
|
|
427
|
+
return obj;
|
|
428
|
+
},
|
|
429
|
+
create(base) {
|
|
430
|
+
return EncryptedMessage.fromPartial(base ?? {});
|
|
431
|
+
},
|
|
432
|
+
fromPartial(object) {
|
|
433
|
+
const message = createBaseEncryptedMessage();
|
|
434
|
+
message.cipher = object.cipher ?? 0;
|
|
435
|
+
message.cipherText = object.cipherText ?? /* @__PURE__ */ new Uint8Array(0);
|
|
436
|
+
return message;
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
function bytesFromBase64(b64) {
|
|
440
|
+
if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
441
|
+
else {
|
|
442
|
+
const bin = globalThis.atob(b64);
|
|
443
|
+
const arr = new Uint8Array(bin.length);
|
|
444
|
+
for (let i = 0; i < bin.length; ++i) arr[i] = bin.charCodeAt(i);
|
|
445
|
+
return arr;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
function base64FromBytes(arr) {
|
|
449
|
+
if (globalThis.Buffer) return globalThis.Buffer.from(arr).toString("base64");
|
|
450
|
+
else {
|
|
451
|
+
const bin = [];
|
|
452
|
+
arr.forEach((byte) => {
|
|
453
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
454
|
+
});
|
|
455
|
+
return globalThis.btoa(bin.join(""));
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
function isSet(value) {
|
|
459
|
+
return value !== null && value !== void 0;
|
|
460
|
+
}
|
|
461
|
+
//#endregion
|
|
462
|
+
export { Cipher, DeviceCertFormat, DeviceSignatureType, DeviceSignedPayload, DeviceType, Din, EcuId, EncryptedMessage, TEGDeviceType, cipherFromJSON, cipherToJSON, deviceCertFormatFromJSON, deviceCertFormatToJSON, deviceSignatureTypeFromJSON, deviceSignatureTypeToJSON, deviceTypeFromJSON, deviceTypeToJSON, iPMDeviceType, iPMDeviceTypeFromJSON, iPMDeviceTypeToJSON, protobufPackage, tEGDeviceTypeFromJSON, tEGDeviceTypeToJSON };
|