truck-code
j1939_struct.h
Go to the documentation of this file.
1 
15 #ifndef INCLUDE_JBUS_J1939_STRUCT_H_
16 #define INCLUDE_JBUS_J1939_STRUCT_H_
17 
18 #include <string>
19 #include "j1939_utils.h"
20 #include "utils/timestamp.h"
21 #include "utils/common.h" /* BYTE */
22 
23 
32 typedef struct
33 {
37  int priority;
38  int pdu_format;
41  int data_field[8];
42  int num_bytes;
44 
45 
47 typedef struct {
52  double req_spd_lim;
53  double req_trq_lim;
57 
58 
60 typedef struct {
66  double brk_pedal_pos;
82 
83 
85 typedef struct {
87  double front_axle_spd;
95 
96 
98 typedef struct {
100  double pressure;
101  double oil_temp;
102 } j1939_rf_typ;
103 
104 
106 typedef struct {
112  int req_gear;
120 } j1939_tc1_typ;
121 
122 
124 typedef struct {
126  int trq_mode;
137 
138 
140 typedef struct {
152 
153 
155 typedef struct {
159  double actual_eng_trq;
160  double eng_spd;
161  double eng_demand_trq;
164 
165 
167 typedef struct {
178 
179 
181 typedef struct {
189 
190 
192 typedef struct {
195  double turbo_speed;
197 
198 
200 typedef struct {
207 
208 
210 typedef struct {
212  double trip_dist;
214 } j1939_vd_typ;
215 
216 
218 typedef struct {
223  double retarder_speed[5];
224  double percent_torque[5];
227 
228 
229 #define MAX_FORWARD_GEARS 16
230 #define MAX_REVERSE_GEARS 8
231 
232 
234 typedef struct {
238  double rev_gear_ratios[MAX_REVERSE_GEARS];
239  double fwd_gear_rations[MAX_FORWARD_GEARS];
241 
242 
244 typedef struct {
246  double engine_spd[7];
247  double percent_trq[5];
257 
258 
260 typedef struct {
263  double fuel_temp;
264  double eng_oil_temp;
265  double turbo_oil_temp;
269 
270 
272 typedef struct {
274  double oil_temp;
275  double speed;
276  double set_speed;
284 } j1939_pto_typ;
285 
286 
288 typedef struct {
294  double vehicle_spd;
295  int cc_active;
303  double cc_set_speed;
304  int pto_state;
305  int cc_state;
311 
312 
314 typedef struct {
316  double eng_fuel_rate;
321 } j1939_lfe_typ;
322 
323 
325 typedef struct {
330  double air_inlet_temp;
333 
334 
336 typedef struct {
339  double boost_pressure;
345 } j1939_iec_typ;
346 
347 
349 typedef struct {
356 } j1939_vep_typ;
357 
358 
360 typedef struct {
363  double oil_level;
364  double diff_pressure;
365  double oil_pressure;
366  double oil_temp;
367 } j1939_tf_typ;
368 
369 
371 typedef struct {
374  double trip_distance;
376 
377 
379 typedef struct {
382  int brk_use;
386 
387 
389 typedef struct {
393  double yaw_rate;
394  double lat_accel;
395  double long_accel;
397 
398 
400 typedef struct {
402  double prcnt_fan_spd;
404 } j1939_fd_typ;
405 
406 
408 typedef struct {
415 
416 
418 typedef struct {
424  double rack_position;
429 } j1939_ei_typ;
430 
431 
433 typedef struct {
435  BYTE src_address;
447 
448 
450 typedef struct {
452  double ExternalAccelerationDemand; //
453  BYTE src_address; //
454  BYTE destination_address; //
455  BYTE pdu_format; //
456  BYTE XBREBIMode; //
457  BYTE XBRPriority; //
458  BYTE XBRControlMode; //
459  BYTE XBRUrgency; //
460  BYTE spare1; // 0xFF
461  BYTE spare2; // 0xFF
462  BYTE spare3; // 0xFF
463  BYTE XBRMessageCounter; //
464  BYTE XBRMessageChecksum; //
466 
467 
468 // /** PDU ETC2_E (Electronic Transmission Controller #2, source engine) doc. in
469 // * J1939 - 71, p152 */
470 // typedef struct {
471 // timestamp_t timestamp;
472 // char ETC2_E_TransmissionSelectedGear;
473 // float ETC2_E_TransmissionActualGearRatio;
474 // char ETC2_E_TransmissionCurrentGear;
475 // int ETC2_E_TransmissionRangeSelected;
476 // int ETC2_E_TransmissionRangeAttained;
477 // } j1939_etc2_e_typ;
478 
479 
480 // /** PDU VP_X_TGW */
481 // typedef struct {
482 // timestamp_t timestamp;
483 // float VP_X_TGW_Latitude_BB1_X_TGW;
484 // float VP_X_TGW_Longitude_BB1_X_TGW;
485 // } j1939_vp_x_typ;
486 
487 
488 // /** PDU VOLVO_TARGET(Volvo target data)*/
489 // typedef struct {
490 // timestamp_t timestamp;
491 // float TargetDist; // 0-655.35 m
492 // float TargetVel; // 0-655.35 m/sec
493 // float TargetAcc; // -327.68-327.67 m/sec/sec
494 // BYTE TargetAvailable; // 0=no target, 1=target
495 // } j1939_volvo_target_typ;
496 
497 
498 // /** PDU VOLVO_EGO(Volvo self data)*/
499 // typedef struct {
500 // timestamp_t timestamp;
501 // float EgoVel; // 0 to +655.35 m/sec
502 // float EgoAcc; // -327.68 to +327.67 m/sec/sec
503 // float EgoRoadGrade; // -25 to +26 %
504 // } j1939_volvo_ego_typ;
505 
506 
507 // /** PDU VBRK (Volvo brake type, Bendix brakes) */
508 // typedef struct {
509 // timestamp_t timestamp;
510 // float VBRK_BrkAppPressure;
511 // float VBRK_BrkPrimaryPressure;
512 // float VBRK_BrkSecondaryPressure;
513 // BYTE VBRK_BrkStatParkBrkActuator;
514 // BYTE VBRK_ParkBrkRedWarningSignal;
515 // BYTE VBRK_ParkBrkReleaseInhibitStat;
516 // } j1939_volvo_brk_t;
517 
518 
519 #endif /* INCLUDE_JBUS_J1939_STRUCT_H_ */
int retarder_type
Definition: j1939_struct.h:220
double oil_temp
Definition: j1939_struct.h:366
int remote_variable_spd_status
Definition: j1939_struct.h:279
double req_spd_lim
Definition: j1939_struct.h:52
timestamp_t timestamp
Definition: j1939_struct.h:326
timestamp_t timestamp
Definition: j1939_struct.h:201
int parking_brk_switch
Definition: j1939_struct.h:291
double rel_spd_rear_left_2
Definition: j1939_struct.h:92
double fuel_valve_pos2
Definition: j1939_struct.h:413
int halt_brk_mode
Definition: j1939_struct.h:381
BYTE byte6
Definition: j1939_struct.h:443
int steering_wheel_turn_ctr
Definition: j1939_struct.h:392
double eng_retarder_selection
Definition: j1939_struct.h:75
BYTE byte4
Definition: j1939_struct.h:441
int destination_address
Definition: j1939_struct.h:54
int fan_drive_state
Definition: j1939_struct.h:403
double rel_spd_front_right
Definition: j1939_struct.h:89
int cc_coast_switch
Definition: j1939_struct.h:300
double selection_nonengine
Definition: j1939_struct.h:134
double alternator_potential
Definition: j1939_struct.h:353
double fuel_temp
Definition: j1939_struct.h:263
double tot_vehicle_dist
Definition: j1939_struct.h:213
Definition: j1939_struct.h:234
int asr_hillholder_switch
Definition: j1939_struct.h:69
Definition: j1939_struct.h:218
int abs_ebs_amber_warning
Definition: j1939_struct.h:78
double lat_accel
Definition: j1939_struct.h:394
int gear_shift_inhibit
Definition: j1939_struct.h:110
BYTE byte1
Definition: j1939_struct.h:438
Definition: j1939_struct.h:379
Definition: j1939_struct.h:360
double eng_intercooler_temp
Definition: j1939_struct.h:266
timestamp_t timestamp
Definition: j1939_struct.h:48
double long_accel
Definition: j1939_struct.h:395
double yaw_rate
Definition: j1939_struct.h:393
Definition: j1939_struct.h:450
timestamp_t timestamp
Definition: j1939_struct.h:361
int clutch_switch
Definition: j1939_struct.h:298
int remote_preprogramm_status
Definition: j1939_struct.h:278
int accel_enable_switch
Definition: j1939_struct.h:74
Definition: j1939_struct.h:167
Definition: j1939_struct.h:244
double turbo_oil_temp
Definition: j1939_struct.h:265
double rel_spd_rear_right_1
Definition: j1939_struct.h:91
double front_axle_spd
Definition: j1939_struct.h:87
int src_address
Definition: j1939_struct.h:40
double turbo_lube_oil_pressure
Definition: j1939_struct.h:194
double est_eng_prstic_loss
Definition: j1939_struct.h:205
double eng_gas_mass_flow
Definition: j1939_struct.h:425
double actual_eng_trq
Definition: j1939_struct.h:159
timestamp_t timestamp
Definition: j1939_struct.h:211
int receive_status
Definition: j1939_struct.h:255
int trac_ctrl_override_switch
Definition: j1939_struct.h:70
double rel_spd_rear_right_2
Definition: j1939_struct.h:93
timestamp_t timestamp
Definition: j1939_struct.h:390
int two_spd_axle_switch
Definition: j1939_struct.h:290
timestamp_t timestamp
Definition: j1939_struct.h:235
double oil_temp
Definition: j1939_struct.h:274
timestamp_t timestamp
Definition: j1939_struct.h:434
double trip_dist
Definition: j1939_struct.h:212
timestamp_t timestamp
Definition: j1939_struct.h:245
double prcnt_clutch_slip
Definition: j1939_struct.h:146
timestamp_t timestamp
Definition: j1939_struct.h:419
int prog_shift_disable
Definition: j1939_struct.h:148
int accel_pedal2_idle
Definition: j1939_struct.h:172
int enable_switch
Definition: j1939_struct.h:277
timestamp_t timestamp
Definition: j1939_struct.h:34
double prcnt_fan_spd
Definition: j1939_struct.h:402
Definition: j1939_struct.h:400
int pdu_format
Definition: j1939_struct.h:38
BYTE byte8
Definition: j1939_struct.h:445
int ddl_front_axle2
Definition: j1939_struct.h:115
Definition: j1939_struct.h:371
double trq_ctrl_upper_lim
Definition: j1939_struct.h:254
double inst_estimated_brake_power
Definition: j1939_struct.h:427
timestamp_t timestamp
Definition: j1939_struct.h:273
int trans_selected_gear
Definition: j1939_struct.h:183
double pcnt_clutch_slip
Definition: j1939_struct.h:111
double total_brk_demand
Definition: j1939_struct.h:80
int ddl_front_axle1
Definition: j1939_struct.h:116
timestamp_t timestamp
Definition: j1939_struct.h:141
int max_available_prcnt_trq
Definition: j1939_struct.h:135
double intended_ret_pcnt_trq
Definition: j1939_struct.h:130
double gain_endspeed_governor
Definition: j1939_struct.h:248
int accel_pedal1_idle
Definition: j1939_struct.h:169
int eng_shutdown_override
Definition: j1939_struct.h:309
int resume_switch
Definition: j1939_struct.h:282
double fuel_valve_pos1
Definition: j1939_struct.h:412
double trq_ctrl_lower_lim
Definition: j1939_struct.h:253
int ddl_rear_axle1
Definition: j1939_struct.h:114
double eng_demand_trq
Definition: j1939_struct.h:161
int rq_brake_light
Definition: j1939_struct.h:131
double clutch_pressure
Definition: j1939_struct.h:362
double eng_inst_fuel_economy
Definition: j1939_struct.h:317
int pto_state
Definition: j1939_struct.h:304
double eng_throttle1_pos
Definition: j1939_struct.h:319
int pdu_specific
Definition: j1939_struct.h:39
BYTE destination_address
Definition: j1939_struct.h:436
double oil_pressure
Definition: j1939_struct.h:365
Definition: j1939_struct.h:288
double barometric_pressure
Definition: j1939_struct.h:327
int eng_idle_incr_switch
Definition: j1939_struct.h:306
double drvr_demand_eng_trq
Definition: j1939_struct.h:158
int drvrs_demand_prcnt_trq
Definition: j1939_struct.h:133
int trq_mode
Definition: j1939_struct.h:126
double intake_manifold_temp
Definition: j1939_struct.h:340
Definition: j1939_struct.h:272
int eng_trq_mode
Definition: j1939_struct.h:157
double trans_input_shaft_spd
Definition: j1939_struct.h:149
BYTE pdu_format
Definition: j1939_struct.h:437
double speed
Definition: j1939_struct.h:275
double net_battery_current
Definition: j1939_struct.h:351
Definition: j1939_struct.h:155
int asr_brk_ctrl_active
Definition: j1939_struct.h:63
timestamp_t timestamp
Definition: j1939_struct.h:289
int range_attained
Definition: j1939_struct.h:187
int retarder_ctrl_steps
Definition: j1939_struct.h:222
double eng_throttle2_pos
Definition: j1939_struct.h:320
timestamp_t timestamp
Definition: j1939_struct.h:86
double cc_set_speed
Definition: j1939_struct.h:303
int accel_interlock_switch
Definition: j1939_struct.h:71
unsigned char BYTE
Definition: common.h:39
int cc_active
Definition: j1939_struct.h:295
int src_address_ctrl
Definition: j1939_struct.h:150
int spd_limit_status
Definition: j1939_struct.h:171
timestamp_t timestamp
Definition: j1939_struct.h:99
timestamp_t timestamp
Definition: j1939_struct.h:219
timestamp_t timestamp
Definition: j1939_struct.h:337
BYTE byte3
Definition: j1939_struct.h:440
int cc_state
Definition: j1939_struct.h:305
int ddl_rear_axle2
Definition: j1939_struct.h:113
timestamp_t timestamp
Definition: j1939_struct.h:409
int cc_pause_switch
Definition: j1939_struct.h:292
Definition: j1939_struct.h:325
int ddl_central
Definition: j1939_struct.h:119
int src_address
Definition: j1939_struct.h:162
double cab_interior_temp
Definition: j1939_struct.h:328
double nominal_friction
Definition: j1939_struct.h:202
double eng_avg_fuel_economy
Definition: j1939_struct.h:318
double trans_act_gear_ratio
Definition: j1939_struct.h:184
int coast_decel_switch
Definition: j1939_struct.h:281
int accel_switch
Definition: j1939_struct.h:283
int src_address_ctrl
Definition: j1939_struct.h:132
int cc_accel_switch
Definition: j1939_struct.h:302
double xbr_accel_limit
Definition: j1939_struct.h:384
int ebs_red_warning
Definition: j1939_struct.h:77
double req_trq_lim
Definition: j1939_struct.h:53
double diff_pressure
Definition: j1939_struct.h:364
Definition: j1939_struct.h:408
Definition: j1939_struct.h:260
double eng_intercooler_thermostat_opening
Definition: j1939_struct.h:267
Definition: j1939_struct.h:192
timestamp_t timestamp
Definition: j1939_struct.h:61
timestamp_t timestamp
Definition: j1939_struct.h:401
double reference_eng_trq
Definition: j1939_struct.h:249
double max_momentary_overide_time
Definition: j1939_struct.h:250
int park_brk_release
Definition: j1939_struct.h:293
double air_inlet_temp
Definition: j1939_struct.h:330
int req_spd_ctrl
Definition: j1939_struct.h:50
int trans_current_gear
Definition: j1939_struct.h:185
Definition: j1939_struct.h:336
int abs_offroad_switch
Definition: j1939_struct.h:67
int ebs_brk_switch
Definition: j1939_struct.h:65
int xbr_active_ctrl_mode
Definition: j1939_struct.h:383
Definition: timestamp.h:23
int ddl_central_front
Definition: j1939_struct.h:118
int req_gear
Definition: j1939_struct.h:112
Definition: j1939_struct.h:85
double eng_oil_temp
Definition: j1939_struct.h:264
double eng_spd
Definition: j1939_struct.h:160
int src_address
Definition: j1939_struct.h:55
double oil_level
Definition: j1939_struct.h:363
double set_speed
Definition: j1939_struct.h:276
double pre_filter_oil_pressure
Definition: j1939_struct.h:420
double tran_output_shaft_spd
Definition: j1939_struct.h:145
int cc_resume_switch
Definition: j1939_struct.h:301
timestamp_t timestamp
Definition: j1939_struct.h:451
int eng_test_mode_switch
Definition: j1939_struct.h:308
double accel_pedal1_pos
Definition: j1939_struct.h:173
BIT reserved
Definition: j1939_struct.h:35
timestamp_t timestamp
Definition: j1939_struct.h:193
timestamp_t timestamp
Definition: j1939_struct.h:107
Definition: j1939_struct.h:389
unsigned char BIT
Definition: common.h:40
int eng_idle_decr_switch
Definition: j1939_struct.h:307
int ovrd_ctrl_m_pr
Definition: j1939_struct.h:51
int brk_switch
Definition: j1939_struct.h:297
timestamp_t timestamp
Definition: j1939_struct.h:372
Definition: j1939_struct.h:181
double rel_spd_front_left
Definition: j1939_struct.h:88
Definition: j1939_struct.h:106
int trans_shift
Definition: j1939_struct.h:144
timestamp_t timestamp
Definition: j1939_struct.h:156
timestamp_t timestamp
Definition: j1939_struct.h:380
double reference_retarder_trq
Definition: j1939_struct.h:225
double turbo_speed
Definition: j1939_struct.h:195
int operating_spd_adjust
Definition: j1939_struct.h:204
double rack_position
Definition: j1939_struct.h:424
Definition: j1939_struct.h:98
int enable_shift_assist
Definition: j1939_struct.h:128
timestamp_t timestamp
Definition: j1939_struct.h:125
double spd_ctrl_lower_lim
Definition: j1939_struct.h:251
Definition: j1939_struct.h:210
double spd_ctrl_upper_lim
Definition: j1939_struct.h:252
int abs_fully_operational
Definition: j1939_struct.h:76
double eng_fuel_rate
Definition: j1939_struct.h:316
double exhaust_gas_pressure
Definition: j1939_struct.h:422
double vehicle_distance
Definition: j1939_struct.h:373
double brk_pedal_pos
Definition: j1939_struct.h:66
int eng_overspd_enable
Definition: j1939_struct.h:147
int trq_conv_lockup
Definition: j1939_struct.h:143
double electrical_potential
Definition: j1939_struct.h:354
double oil_temp
Definition: j1939_struct.h:101
double coolant_filter_diff_pressure
Definition: j1939_struct.h:344
double road_surface_temp
Definition: j1939_struct.h:331
double air_filter_diff_pressure
Definition: j1939_struct.h:342
int asr_offroad_switch
Definition: j1939_struct.h:68
double alternator_current
Definition: j1939_struct.h:352
double eng_coolant_temp
Definition: j1939_struct.h:262
double steering_wheel_angle
Definition: j1939_struct.h:391
int accel_pedal_kickdown
Definition: j1939_struct.h:170
BIT data_page
Definition: j1939_struct.h:36
int antilock_brk_active
Definition: j1939_struct.h:64
int num_fwd_gear_ratios
Definition: j1939_struct.h:237
int src_address_ctrl
Definition: j1939_struct.h:79
int aux_eng_shutdown_switch
Definition: j1939_struct.h:73
double particulate_inlet_pressure
Definition: j1939_struct.h:338
BYTE byte7
Definition: j1939_struct.h:444
Definition: j1939_struct.h:124
int disengage_driveline
Definition: j1939_struct.h:108
int range_selected
Definition: j1939_struct.h:186
int enable_brake_assist
Definition: j1939_struct.h:127
Definition: j1939_struct.h:60
int retarder_loc
Definition: j1939_struct.h:221
int trq_conv_lockup_disable
Definition: j1939_struct.h:109
int priority
Definition: j1939_struct.h:37
int brk_use
Definition: j1939_struct.h:382
int set_switch
Definition: j1939_struct.h:280
double trip_distance
Definition: j1939_struct.h:374
double act_max_avail_eng_trq
Definition: j1939_struct.h:176
double actual_ret_pcnt_trq
Definition: j1939_struct.h:129
double fuel_flow_rate1
Definition: j1939_struct.h:410
Definition: j1939_struct.h:200
double eng_prcnt_load_curr_spd
Definition: j1939_struct.h:174
double air_inlet_pressure
Definition: j1939_struct.h:341
double rel_spd_rear_left_1
Definition: j1939_struct.h:90
timestamp_t timestamp
Definition: j1939_struct.h:315
timestamp_t timestamp
Definition: j1939_struct.h:261
Definition: j1939_struct.h:418
int num_rev_gear_ratios
Definition: j1939_struct.h:236
double accel_pedal2_pos
Definition: j1939_struct.h:175
double boost_pressure
Definition: j1939_struct.h:339
int cc_set_switch
Definition: j1939_struct.h:299
BYTE byte2
Definition: j1939_struct.h:439
Definition: j1939_struct.h:433
double ambient_air_temp
Definition: j1939_struct.h:329
Definition: j1939_struct.h:140
Definition: j1939_struct.h:349
int asr_engine_ctrl_active
Definition: j1939_struct.h:62
timestamp_t timestamp
Definition: j1939_struct.h:350
int trans_driveline
Definition: j1939_struct.h:142
double vehicle_spd
Definition: j1939_struct.h:294
BYTE byte5
Definition: j1939_struct.h:442
double desired_operating_spd
Definition: j1939_struct.h:203
double pressure
Definition: j1939_struct.h:100
timestamp_t timestamp
Definition: j1939_struct.h:168
double fuel_flow_rate2
Definition: j1939_struct.h:411
int num_bytes
Definition: j1939_struct.h:42
int ovrd_ctrl_m
Definition: j1939_struct.h:49
Definition: j1939_struct.h:47
Definition: j1939_struct.h:314
int cc_enable_switch
Definition: j1939_struct.h:296
double battery_potential
Definition: j1939_struct.h:355
double exhaust_gas_temp
Definition: j1939_struct.h:343
Definition: j1939_struct.h:32
int ddl_central_rear
Definition: j1939_struct.h:117
int eng_derate_switch
Definition: j1939_struct.h:72
timestamp_t timestamp
Definition: j1939_struct.h:182