summaryrefslogtreecommitdiff
path: root/definitions/raw.yaml
blob: 48ec1fd1482b7a56356aa70451602a086cd78034 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
# Raw data definitions
# These take the form of ISO-TP request/reply sets, and then a raw breakdown of
# the values which result from that.

# Each entry is a map which must have:
# name: identifier
# description: Some nice description of what this pid thing is
# request:
#   sendto: 0xecu
#   recvfrom: 0xecu  # defaults to sendto + 8
#   flowctrl: 0xecu  # defaults to sendto
#   packet: [0xva, 0xlu, 0xes]
# response:
#   length: nnn  # Optional, don't include if you don't want a length check
#   values:
#    - name: identifier
#      offset: bytenr
#      length: numbytes
#      check: [0xso, 0xme, 0xby, 0xte]  # Use if you just want to sanity check
#      kind: somekind # one of bit, bits, signed, unsigned
#      endian: little or big, defaults to big, unnecessary for non-multibyte
#      base: bitnr if appropriate
#      count: nbits if appropriate

# This is the bms - the battery management controller?

- name: bms1
  description: bms primary data set
  cadence: 1
  request:
    sendto: 0x7e4
    packet: [0x21, 0x01]
  response:
    length: 61
    values:
     - name: bms_fixed
       offset: 0
       length: 6
       check: [0x61, 0x01, 0xFF, 0xFF, 0xFF, 0xFF]
     - name: soc_bms
       offset: 6
       length: 1
       kind: unsigned
     - name: charge_available
       offset: 7
       length: 2
       kind: unsigned
     - name: discharge_available
       offset: 9
       length: 2
       kind: unsigned
     - name: charging
       offset: 11
       length: 1
       kind: bit
       base: 7
     - name: rapid_port
       offset: 11
       length: 1
       kind: bit
       base: 6
     - name: normal_port
       offset: 11
       length: 1
       kind: bit
       base: 5
     - name: weld_flag
       offset: 11
       length: 1
       kind: bit
       base: 4
     - name: fault
       offset: 11
       length: 1
       kind: bit
       base: 3
     - name: warning
       offset: 11
       length: 1
       kind: bit
       base: 2
     - name: controllable
       offset: 11
       length: 1
       kind: bit
       base: 1
     - name: main_relay
       offset: 11
       length: 1
       kind: bit
       base: 0
     - name: battery_current
       offset: 12
       length: 2
       kind: signed
     - name: battery_voltage
       offset: 14
       length: 2
       kind: unsigned
     - name: battery_maxtemp
       offset: 16
       length: 1
       kind: unsigned
     - name: battery_mintemp
       offset: 17
       length: 1
       kind: unsigned
     - name: battery_temp1
       offset: 18
       length: 1
       kind: unsigned
     - name: battery_temp2
       offset: 19
       length: 1
       kind: unsigned
     - name: battery_temp3
       offset: 20
       length: 1
       kind: unsigned
     - name: battery_temp4
       offset: 21
       length: 1
       kind: unsigned
     - name: battery_temp5
       offset: 22
       length: 1
       kind: unsigned
     - name: battery_inlet_temp
       offset: 24
       length: 1
       kind: unsigned
     - name: max_cell_voltage
       offset: 25
       length: 1
       kind: unsigned
     - name: max_cell_num
       offset: 26
       length: 1
       kind: unsigned
     - name: min_cell_voltage
       offset: 27
       length: 1
       kind: unsigned
     - name: min_cell_num
       offset: 28
       length: 1
       kind: unsigned
     - name: fan_status
       offset: 29
       length: 1
       kind: unsigned
     - name: fan_feedback
       offset: 30
       length: 1
       kind: unsigned
     - name: aux_battery_voltage
       offset: 31
       length: 1
       kind: unsigned
     - name: cumulative_charge_current
       offset: 32
       length: 4
       kind: unsigned
     - name: cumulative_discharge_current
       offset: 36
       length: 4
       kind: unsigned
     - name: cumulative_charge_energy
       offset: 40
       length: 4
       kind: unsigned
     - name: cumulative_discharge_energy
       offset: 44
       length: 4
       kind: unsigned
     - name: cumulative_operating_time
       offset: 48
       length: 4
       kind: unsigned
     - name: maybe_car_on
       offset: 52
       length: 1
       kind: bit
       base: 3
     - name: inverter_capacitor_voltage
       offset: 53
       length: 2
       kind: unsigned
     - name: drive_motor_speed1
       offset: 55
       length: 2
       kind: unsigned
     - name: drive_motor_speed2
       offset: 57
       length: 2
       kind: unsigned
     - name: isolation_resistance
       offset: 59
       length: 2
       kind: unsigned

- name: bms2
  description: bms first cell set
  cadence: 25
  request:
    sendto: 0x7e4
    packet: [0x21, 0x02]
  response:
    length: 38
    values:
      - name: bms_fixed
        offset: 0
        length: 6
        check: [0x61, 0x02, 0xff, 0xff, 0xff, 0xff]
      - name: cell01
        offset: 6
        length: 1
        kind: unsigned
      - name: cell02
        offset: 7
        length: 1
        kind: unsigned
      - name: cell03
        offset: 8
        length: 1
        kind: unsigned
      - name: cell04
        offset: 9
        length: 1
        kind: unsigned
      - name: cell05
        offset: 10
        length: 1
        kind: unsigned
      - name: cell06
        offset: 11
        length: 1
        kind: unsigned
      - name: cell07
        offset: 12
        length: 1
        kind: unsigned
      - name: cell08
        offset: 13
        length: 1
        kind: unsigned
      - name: cell09
        offset: 14
        length: 1
        kind: unsigned
      - name: cell10
        offset: 15
        length: 1
        kind: unsigned
      - name: cell11
        offset: 16
        length: 1
        kind: unsigned
      - name: cell12
        offset: 17
        length: 1
        kind: unsigned
      - name: cell13
        offset: 18
        length: 1
        kind: unsigned
      - name: cell14
        offset: 19
        length: 1
        kind: unsigned
      - name: cell15
        offset: 20
        length: 1
        kind: unsigned
      - name: cell16
        offset: 21
        length: 1
        kind: unsigned
      - name: cell17
        offset: 22
        length: 1
        kind: unsigned
      - name: cell18
        offset: 23
        length: 1
        kind: unsigned
      - name: cell19
        offset: 24
        length: 1
        kind: unsigned
      - name: cell20
        offset: 25
        length: 1
        kind: unsigned
      - name: cell21
        offset: 26
        length: 1
        kind: unsigned
      - name: cell22
        offset: 27
        length: 1
        kind: unsigned
      - name: cell23
        offset: 28
        length: 1
        kind: unsigned
      - name: cell24
        offset: 29
        length: 1
        kind: unsigned
      - name: cell25
        offset: 30
        length: 1
        kind: unsigned
      - name: cell26
        offset: 31
        length: 1
        kind: unsigned
      - name: cell27
        offset: 32
        length: 1
        kind: unsigned
      - name: cell28
        offset: 33
        length: 1
        kind: unsigned
      - name: cell29
        offset: 34
        length: 1
        kind: unsigned
      - name: cell30
        offset: 35
        length: 1
        kind: unsigned
      - name: cell31
        offset: 36
        length: 1
        kind: unsigned
      - name: cell32
        offset: 37
        length: 1
        kind: unsigned

- name: bms3
  description: bms second cell set
  cadence: 25
  request:
    sendto: 0x7e4
    packet: [0x21, 0x03]
  response:
    length: 38
    values:
      - name: bms_fixed
        offset: 0
        length: 6
        check: [0x61, 0x03, 0xff, 0xff, 0xff, 0xff]
      - name: cell33
        offset: 6
        length: 1
        kind: unsigned
      - name: cell34
        offset: 7
        length: 1
        kind: unsigned
      - name: cell35
        offset: 8
        length: 1
        kind: unsigned
      - name: cell36
        offset: 9
        length: 1
        kind: unsigned
      - name: cell37
        offset: 10
        length: 1
        kind: unsigned
      - name: cell38
        offset: 11
        length: 1
        kind: unsigned
      - name: cell39
        offset: 12
        length: 1
        kind: unsigned
      - name: cell40
        offset: 13
        length: 1
        kind: unsigned
      - name: cell41
        offset: 14
        length: 1
        kind: unsigned
      - name: cell42
        offset: 15
        length: 1
        kind: unsigned
      - name: cell43
        offset: 16
        length: 1
        kind: unsigned
      - name: cell44
        offset: 17
        length: 1
        kind: unsigned
      - name: cell45
        offset: 18
        length: 1
        kind: unsigned
      - name: cell46
        offset: 19
        length: 1
        kind: unsigned
      - name: cell47
        offset: 20
        length: 1
        kind: unsigned
      - name: cell48
        offset: 21
        length: 1
        kind: unsigned
      - name: cell49
        offset: 22
        length: 1
        kind: unsigned
      - name: cell50
        offset: 23
        length: 1
        kind: unsigned
      - name: cell51
        offset: 24
        length: 1
        kind: unsigned
      - name: cell52
        offset: 25
        length: 1
        kind: unsigned
      - name: cell53
        offset: 26
        length: 1
        kind: unsigned
      - name: cell54
        offset: 27
        length: 1
        kind: unsigned
      - name: cell55
        offset: 28
        length: 1
        kind: unsigned
      - name: cell56
        offset: 29
        length: 1
        kind: unsigned
      - name: cell57
        offset: 30
        length: 1
        kind: unsigned
      - name: cell58
        offset: 31
        length: 1
        kind: unsigned
      - name: cell59
        offset: 32
        length: 1
        kind: unsigned
      - name: cell60
        offset: 33
        length: 1
        kind: unsigned
      - name: cell61
        offset: 34
        length: 1
        kind: unsigned
      - name: cell62
        offset: 35
        length: 1
        kind: unsigned
      - name: cell63
        offset: 36
        length: 1
        kind: unsigned
      - name: cell64
        offset: 37
        length: 1
        kind: unsigned

- name: bms4
  description: bms third cell set
  cadence: 25
  request:
    sendto: 0x7e4
    packet: [0x21, 0x04]
  response:
    length: 38
    values:
      - name: bms_fixed
        offset: 0
        length: 6
        check: [0x61, 0x04, 0xff, 0xff, 0xff, 0xff]
      - name: cell65
        offset: 6
        length: 1
        kind: unsigned
      - name: cell66
        offset: 7
        length: 1
        kind: unsigned
      - name: cell67
        offset: 8
        length: 1
        kind: unsigned
      - name: cell68
        offset: 9
        length: 1
        kind: unsigned
      - name: cell69
        offset: 10
        length: 1
        kind: unsigned
      - name: cell70
        offset: 11
        length: 1
        kind: unsigned
      - name: cell71
        offset: 12
        length: 1
        kind: unsigned
      - name: cell72
        offset: 13
        length: 1
        kind: unsigned
      - name: cell73
        offset: 14
        length: 1
        kind: unsigned
      - name: cell74
        offset: 15
        length: 1
        kind: unsigned
      - name: cell75
        offset: 16
        length: 1
        kind: unsigned
      - name: cell76
        offset: 17
        length: 1
        kind: unsigned
      - name: cell77
        offset: 18
        length: 1
        kind: unsigned
      - name: cell78
        offset: 19
        length: 1
        kind: unsigned
      - name: cell79
        offset: 20
        length: 1
        kind: unsigned
      - name: cell80
        offset: 21
        length: 1
        kind: unsigned
      - name: cell81
        offset: 22
        length: 1
        kind: unsigned
      - name: cell82
        offset: 23
        length: 1
        kind: unsigned
      - name: cell83
        offset: 24
        length: 1
        kind: unsigned
      - name: cell84
        offset: 25
        length: 1
        kind: unsigned
      - name: cell85
        offset: 26
        length: 1
        kind: unsigned
      - name: cell86
        offset: 27
        length: 1
        kind: unsigned
      - name: cell87
        offset: 28
        length: 1
        kind: unsigned
      - name: cell88
        offset: 29
        length: 1
        kind: unsigned
      - name: cell89
        offset: 30
        length: 1
        kind: unsigned
      - name: cell90
        offset: 31
        length: 1
        kind: unsigned
      - name: cell91
        offset: 32
        length: 1
        kind: unsigned
      - name: cell92
        offset: 33
        length: 1
        kind: unsigned
      - name: cell93
        offset: 34
        length: 1
        kind: unsigned
      - name: cell94
        offset: 35
        length: 1
        kind: unsigned
      - name: cell95
        offset: 36
        length: 1
        kind: unsigned
      - name: cell96
        offset: 37
        length: 1
        kind: unsigned

- name: bms5
  description: bms secondary data set
  cadence: 1
  request:
   sendto: 0x7e4
   packet: [0x21, 0x05]
  response:
    length: 45
    values:
     - name: bms_fixed
       offset: 0
       length: 6
       check: [0x61, 0x05, 0xFF, 0xFF, 0xFF, 0xFF]
     - name: battery_temp6
       offset: 11
       length: 1
       kind: unsigned
     - name: battery_temp7
       offset: 12
       length: 1
       kind: unsigned
     - name: battery_temp8
       offset: 13
       length: 1
       kind: unsigned
     - name: battery_temp9
       offset: 14
       length: 1
       kind: unsigned
     - name: battery_temp10
       offset: 15
       length: 1
       kind: unsigned
     - name: battery_temp11
       offset: 16
       length: 1
       kind: unsigned
     - name: battery_temp12
       offset: 17
       length: 1
       kind: unsigned
     - name: available_charge_power
       offset: 18
       length: 2
       kind: unsigned
     - name: available_discharge_power
       offset: 20
       length: 2
       kind: unsigned
     - name: battery_cell_voltate_deviation
       offset: 22
       length: 1
       kind: unsigned
     - name: airbag_h_duty_cycle
       offset: 24
       length: 1
       kind: unsigned
     - name: battery_heater_temp1
       offset: 25
       length: 1
       kind: unsigned
     - name: battery_heater_temp2
       offset: 26
       length: 1
       kind: unsigned
     - name: state_of_health
       offset: 27
       length: 2
       kind: unsigned
     - name: max_deterioration_cell_num
       offset: 29
       length: 1
       kind: unsigned
     - name: min_deterioration
       offset: 30
       length: 2
       kind: unsigned
     - name: min_deterioration_cell_num
       offset: 32
       length: 1
       kind: unsigned
     - name: soc_display
       offset: 33
       length: 1
       kind: unsigned

#- name: ldc
#  description: Low Voltage DC-DC Converter
#  request:
#   sendto: 0x7c5
#   packet: [0x21, 0x01]
#  response:
#    length: 18
#    values:
#     - name: ldc_fixed
#       offset: 0
#       length: 6
#       check: [0x61, 0x01, 0x1F, 0x00, 0x00, 0x00]
#     - name: low_voltage
#       offset: 7
#       length: 1
#       kind: unsigned
#     - name: low_current
#       offset: 8
#       length: 1
#       kind: unsigned
#     - name: high_voltage
#       offset: 9
#       length: 1
#       kind: unsigned
#     - name: maybe_temperature
#       offset: 10
#       length: 1
#       kind: unsigned
#
#- name: obc
#  description: On-Board charger
#  request:
#   sendto: 0x794
#   packet: [0x21, 0x02]
#  response:
#   length: 23
#   values:
#    - name: obc_fixed
#      offset: 0
#      length: 6
#      check: [0x61, 0x02, 0xE8, 0x03, 0x1F, 0x00]
#    - name: ac_volts
#      offset: 8
#      length: 2
#      kind: unsigned
#    - name: dc_volts
#      offset: 14
#      length: 2
#      kind: unsigned
#    - name: ac_current
#      offset: 16
#      length: 2
#      kind: unsigned
#    - name: pilot_duty_cycle
#      offset: 19
#      length: 1
#      kind: unsigned

- name: vmcu1
  description: Vehicle Management Control Unit, first part
  cadence: 1
  request:
    sendto: 0x7E2
    packet: [0x21, 0x01]
  response:
    length: 22
    values:
      - name: vmcu_fixed
        length: 6
        offset: 0
        check: [0x61, 0x01, 0xff, 0xe0, 0x00, 0x00]
      - name: gear_d
        offset: 7
        length: 1
        kind: bit
        base: 3
      - name: gear_r
        offset: 7
        length: 1
        kind: bit
        base: 1
      - name: gear_p
        offset: 7
        length: 1
        kind: bit
        base: 0
      - name: gear_n
        offset: 7
        length: 1
        kind: bit
        base: 2
      - name: brake_sw
        offset: 8
        length: 1
        kind: bit
        base: 1
      - name: brake_lamp
        offset: 8
        length: 1
        kind: bit
        base: 0
      - name: accel_pedal_depth
        offset: 14
        length: 1
        kind: unsigned
      - name: vehicle_speed
        offset: 15
        length: 2
        kind: signed-le

- name: vmcu2
  description: Vehicle Management Control Unit, second part
  cadence: 1
  request:
    sendto: 0x7E2
    packet: [0x21, 0x02]
  response:
    length: 23
    values:
      - name: vmcu_fixed
        length: 6
        offset: 0
        check: [0x61, 0x02, 0xff, 0x80, 0x00, 0x00]
      - name: motor_temp
        length: 1
        offset: 16
        kind: unsigned
      - name: mcu_temp
        length: 1
        offset: 22
        kind: unsigned

- name: who_knows_7e5_2101
  description: BCCM-B+ChargerCtrl
  cadence: 1
  request:
    sendto: 0x7E5
    packet: [0x21, 0x01]
  response:
    length: 44
    values:
      - name: bccm_fixed
        length: 6
        offset: 0
        check: [0x61, 0x01, 0xff, 0xff, 0xf8, 0x00]

- name: who_knows_7e3_2101
  description: No idea, but it responds to 2101
  cadence: 1
  request:
    sendto: 0x7E3
    packet: [0x21, 0x01]
  response:
    length: 30
    values:
      - name: who_knows_fixed
        length: 6
        offset: 0
        check: [0x61, 0x01, 0x00, 0x00, 0x03, 0xff]

- name: who_knows_7e3_2102
  description: No idea, but it responds to 2102
  cadence: 1
  request:
    sendto: 0x7E3
    packet: [0x21, 0x02]
  response:
    length: 56
    values:
      - name: who_knows_fixed
        length: 6
        offset: 0
        check: [0x61, 0x02, 0x07, 0xff, 0xff, 0xff]

- name: who_knows_7e3_2103
  description: No idea, but it responds to 2103
  cadence: 1
  request:
    sendto: 0x7E3
    packet: [0x21, 0x03]
  response:
    length: 27
    values:
      - name: who_knows_fixed
        length: 6
        offset: 0
        check: [0x61, 0x03, 0x00, 0x00, 0x00, 0x00]

- name: who_knows_7d5
  description: No idea, but it responds to 2101
  cadence: 1
  request:
    sendto: 0x7D5
    packet: [0x21, 0x01]
  response:
    length: 26
    values:
      - name: who_knows_fixed
        length: 6
        offset: 0
        check: [0x61, 0x01, 0xfb, 0x18, 0x00, 0x00]