/* Generated by DBCC, see */ #include "all_SRE_edited.h" #include #include #define UNUSED(X) ((void)(X)) static inline uint64_t reverse_byte_order(uint64_t x) { x = (x & 0x00000000FFFFFFFF) << 32 | (x & 0xFFFFFFFF00000000) >> 32; x = (x & 0x0000FFFF0000FFFF) << 16 | (x & 0xFFFF0000FFFF0000) >> 16; x = (x & 0x00FF00FF00FF00FF) << 8 | (x & 0xFF00FF00FF00FF00) >> 8; return x; } static inline int print_helper(int r, int print_return_value) { return ((r >= 0) && (print_return_value >= 0)) ? r + print_return_value : -1; } static int pack_can_0x600_BMS_Safety_Checker(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* Pack_Voltage: start-bit 24, length 32, endianess intel, scaling 0.0001, offset 0 */ x = ((uint32_t)(o->can_0x600_BMS_Safety_Checker.Pack_Voltage)) & 0xffffffff; x <<= 24; i |= x; /* SPIError: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.SPIError)) & 0xff; x <<= 56; i |= x; /* Balacing_End_Fault: start-bit 1, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Balacing_End_Fault)) & 0x1; x <<= 1; i |= x; /* Cell_Volt_Imbalance_Fault: start-bit 2, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_Volt_Imbalance_Fault)) & 0x1; x <<= 2; i |= x; /* Cell_High_Temp_Fault: start-bit 3, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_High_Temp_Fault)) & 0x1; x <<= 3; i |= x; /* Cell_High_Volt_Fault: start-bit 4, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_High_Volt_Fault)) & 0x1; x <<= 4; i |= x; /* Cell_Low_Volt_Fault: start-bit 5, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_Low_Volt_Fault)) & 0x1; x <<= 5; i |= x; /* Pack_Low_Volt_Fault: start-bit 6, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Pack_Low_Volt_Fault)) & 0x1; x <<= 6; i |= x; /* Pack_High_Volt_Fault: start-bit 7, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Pack_High_Volt_Fault)) & 0x1; x <<= 7; i |= x; /* Cell_Volt_Imbalance_Warning: start-bit 9, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_Volt_Imbalance_Warning)) & 0x1; x <<= 9; i |= x; /* Cell_Low_Temp_Warning: start-bit 10, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_Low_Temp_Warning)) & 0x1; x <<= 10; i |= x; /* Cell_High_Temp_Warning: start-bit 11, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_High_Temp_Warning)) & 0x1; x <<= 11; i |= x; /* Cell_High_Volt_Warning: start-bit 12, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_High_Volt_Warning)) & 0x1; x <<= 12; i |= x; /* Cell_Low_Volt_Warning: start-bit 13, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_Low_Volt_Warning)) & 0x1; x <<= 13; i |= x; /* Pack_Low_Volt_Warning: start-bit 14, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Pack_Low_Volt_Warning)) & 0x1; x <<= 14; i |= x; /* Pack_High_Volt_Warning: start-bit 15, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Pack_High_Volt_Warning)) & 0x1; x <<= 15; i |= x; /* Balancing_State: start-bit 23, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.Balancing_State)) & 0x1; x <<= 23; i |= x; *data = (i); o->can_0x600_BMS_Safety_Checker_tx = 1; return 8; } static int unpack_can_0x600_BMS_Safety_Checker(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* Pack_Voltage: start-bit 24, length 32, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 24) & 0xffffffff; o->can_0x600_BMS_Safety_Checker.Pack_Voltage = x; /* SPIError: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x600_BMS_Safety_Checker.SPIError = x; /* Balacing_End_Fault: start-bit 1, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 1) & 0x1; o->can_0x600_BMS_Safety_Checker.Balacing_End_Fault = x; /* Cell_Volt_Imbalance_Fault: start-bit 2, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 2) & 0x1; o->can_0x600_BMS_Safety_Checker.Cell_Volt_Imbalance_Fault = x; /* Cell_High_Temp_Fault: start-bit 3, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 3) & 0x1; o->can_0x600_BMS_Safety_Checker.Cell_High_Temp_Fault = x; /* Cell_High_Volt_Fault: start-bit 4, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 4) & 0x1; o->can_0x600_BMS_Safety_Checker.Cell_High_Volt_Fault = x; /* Cell_Low_Volt_Fault: start-bit 5, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 5) & 0x1; o->can_0x600_BMS_Safety_Checker.Cell_Low_Volt_Fault = x; /* Pack_Low_Volt_Fault: start-bit 6, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 6) & 0x1; o->can_0x600_BMS_Safety_Checker.Pack_Low_Volt_Fault = x; /* Pack_High_Volt_Fault: start-bit 7, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 7) & 0x1; o->can_0x600_BMS_Safety_Checker.Pack_High_Volt_Fault = x; /* Cell_Volt_Imbalance_Warning: start-bit 9, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 9) & 0x1; o->can_0x600_BMS_Safety_Checker.Cell_Volt_Imbalance_Warning = x; /* Cell_Low_Temp_Warning: start-bit 10, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 10) & 0x1; o->can_0x600_BMS_Safety_Checker.Cell_Low_Temp_Warning = x; /* Cell_High_Temp_Warning: start-bit 11, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 11) & 0x1; o->can_0x600_BMS_Safety_Checker.Cell_High_Temp_Warning = x; /* Cell_High_Volt_Warning: start-bit 12, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 12) & 0x1; o->can_0x600_BMS_Safety_Checker.Cell_High_Volt_Warning = x; /* Cell_Low_Volt_Warning: start-bit 13, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 13) & 0x1; o->can_0x600_BMS_Safety_Checker.Cell_Low_Volt_Warning = x; /* Pack_Low_Volt_Warning: start-bit 14, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 14) & 0x1; o->can_0x600_BMS_Safety_Checker.Pack_Low_Volt_Warning = x; /* Pack_High_Volt_Warning: start-bit 15, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 15) & 0x1; o->can_0x600_BMS_Safety_Checker.Pack_High_Volt_Warning = x; /* Balancing_State: start-bit 23, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 23) & 0x1; o->can_0x600_BMS_Safety_Checker.Balancing_State = x; o->can_0x600_BMS_Safety_Checker_rx = 1; o->can_0x600_BMS_Safety_Checker_time_stamp_rx = time_stamp; return 8; } int decode_can_0x600_Pack_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x600_BMS_Safety_Checker.Pack_Voltage); rval *= 0.0001; if (rval <= 1000) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x600_Pack_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x600_BMS_Safety_Checker.Pack_Voltage = 0; if (in > 1000) return -1; in *= 10000; o->can_0x600_BMS_Safety_Checker.Pack_Voltage = in; return 0; } int decode_can_0x600_SPIError(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.SPIError); *out = rval; return 0; } int encode_can_0x600_SPIError(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.SPIError = in; return 0; } int decode_can_0x600_Balacing_End_Fault(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Balacing_End_Fault); *out = rval; return 0; } int encode_can_0x600_Balacing_End_Fault(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Balacing_End_Fault = in; return 0; } int decode_can_0x600_Cell_Volt_Imbalance_Fault(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_Volt_Imbalance_Fault); *out = rval; return 0; } int encode_can_0x600_Cell_Volt_Imbalance_Fault(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Cell_Volt_Imbalance_Fault = in; return 0; } int decode_can_0x600_Cell_High_Temp_Fault(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_High_Temp_Fault); *out = rval; return 0; } int encode_can_0x600_Cell_High_Temp_Fault(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Cell_High_Temp_Fault = in; return 0; } int decode_can_0x600_Cell_High_Volt_Fault(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_High_Volt_Fault); *out = rval; return 0; } int encode_can_0x600_Cell_High_Volt_Fault(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Cell_High_Volt_Fault = in; return 0; } int decode_can_0x600_Cell_Low_Volt_Fault(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_Low_Volt_Fault); *out = rval; return 0; } int encode_can_0x600_Cell_Low_Volt_Fault(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Cell_Low_Volt_Fault = in; return 0; } int decode_can_0x600_Pack_Low_Volt_Fault(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Pack_Low_Volt_Fault); *out = rval; return 0; } int encode_can_0x600_Pack_Low_Volt_Fault(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Pack_Low_Volt_Fault = in; return 0; } int decode_can_0x600_Pack_High_Volt_Fault(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Pack_High_Volt_Fault); *out = rval; return 0; } int encode_can_0x600_Pack_High_Volt_Fault(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Pack_High_Volt_Fault = in; return 0; } int decode_can_0x600_Cell_Volt_Imbalance_Warning(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_Volt_Imbalance_Warning); *out = rval; return 0; } int encode_can_0x600_Cell_Volt_Imbalance_Warning(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Cell_Volt_Imbalance_Warning = in; return 0; } int decode_can_0x600_Cell_Low_Temp_Warning(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_Low_Temp_Warning); *out = rval; return 0; } int encode_can_0x600_Cell_Low_Temp_Warning(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Cell_Low_Temp_Warning = in; return 0; } int decode_can_0x600_Cell_High_Temp_Warning(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_High_Temp_Warning); *out = rval; return 0; } int encode_can_0x600_Cell_High_Temp_Warning(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Cell_High_Temp_Warning = in; return 0; } int decode_can_0x600_Cell_High_Volt_Warning(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_High_Volt_Warning); *out = rval; return 0; } int encode_can_0x600_Cell_High_Volt_Warning(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Cell_High_Volt_Warning = in; return 0; } int decode_can_0x600_Cell_Low_Volt_Warning(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Cell_Low_Volt_Warning); *out = rval; return 0; } int encode_can_0x600_Cell_Low_Volt_Warning(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Cell_Low_Volt_Warning = in; return 0; } int decode_can_0x600_Pack_Low_Volt_Warning(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Pack_Low_Volt_Warning); *out = rval; return 0; } int encode_can_0x600_Pack_Low_Volt_Warning(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Pack_Low_Volt_Warning = in; return 0; } int decode_can_0x600_Pack_High_Volt_Warning(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Pack_High_Volt_Warning); *out = rval; return 0; } int encode_can_0x600_Pack_High_Volt_Warning(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Pack_High_Volt_Warning = in; return 0; } int decode_can_0x600_Balancing_State(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x600_BMS_Safety_Checker.Balancing_State); *out = rval; return 0; } int encode_can_0x600_Balancing_State(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.Balancing_State = in; return 0; } int print_can_0x600_BMS_Safety_Checker(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "Pack_Voltage = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Pack_Voltage))); r = print_helper(r, fprintf(output, "SPIError = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.SPIError))); r = print_helper(r, fprintf(output, "Balacing_End_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Balacing_End_Fault))); r = print_helper(r, fprintf(output, "Cell_Volt_Imbalance_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Cell_Volt_Imbalance_Fault))); r = print_helper(r, fprintf(output, "Cell_High_Temp_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Cell_High_Temp_Fault))); r = print_helper(r, fprintf(output, "Cell_High_Volt_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Cell_High_Volt_Fault))); r = print_helper(r, fprintf(output, "Cell_Low_Volt_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Cell_Low_Volt_Fault))); r = print_helper(r, fprintf(output, "Pack_Low_Volt_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Pack_Low_Volt_Fault))); r = print_helper(r, fprintf(output, "Pack_High_Volt_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Pack_High_Volt_Fault))); r = print_helper(r, fprintf(output, "Cell_Volt_Imbalance_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Cell_Volt_Imbalance_Warning))); r = print_helper(r, fprintf(output, "Cell_Low_Temp_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Cell_Low_Temp_Warning))); r = print_helper(r, fprintf(output, "Cell_High_Temp_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Cell_High_Temp_Warning))); r = print_helper(r, fprintf(output, "Cell_High_Volt_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Cell_High_Volt_Warning))); r = print_helper(r, fprintf(output, "Cell_Low_Volt_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Cell_Low_Volt_Warning))); r = print_helper(r, fprintf(output, "Pack_Low_Volt_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Pack_Low_Volt_Warning))); r = print_helper(r, fprintf(output, "Pack_High_Volt_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Pack_High_Volt_Warning))); r = print_helper(r, fprintf(output, "Balancing_State = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.Balancing_State))); return r; } static int pack_can_0x622_BMS_Cell_Summary(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* Highest_Cell_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x622_BMS_Cell_Summary.Highest_Cell_Voltage)) & 0xffff; i |= x; /* Lowest_Cell_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x622_BMS_Cell_Summary.Lowest_Cell_Voltage)) & 0xffff; x <<= 16; i |= x; /* Higest_Cell_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x622_BMS_Cell_Summary.Higest_Cell_Temperature)) & 0xffff; x <<= 32; i |= x; /* Lowest_Cell_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x622_BMS_Cell_Summary.Lowest_Cell_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x622_BMS_Cell_Summary_tx = 1; return 8; } static int unpack_can_0x622_BMS_Cell_Summary(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* Highest_Cell_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x622_BMS_Cell_Summary.Highest_Cell_Voltage = x; /* Lowest_Cell_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x622_BMS_Cell_Summary.Lowest_Cell_Voltage = x; /* Higest_Cell_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x622_BMS_Cell_Summary.Higest_Cell_Temperature = x; /* Lowest_Cell_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x622_BMS_Cell_Summary.Lowest_Cell_Temperature = x; o->can_0x622_BMS_Cell_Summary_rx = 1; o->can_0x622_BMS_Cell_Summary_time_stamp_rx = time_stamp; return 8; } int decode_can_0x622_Highest_Cell_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x622_BMS_Cell_Summary.Highest_Cell_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x622_Highest_Cell_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x622_BMS_Cell_Summary.Highest_Cell_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x622_BMS_Cell_Summary.Highest_Cell_Voltage = in; return 0; } int decode_can_0x622_Lowest_Cell_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x622_BMS_Cell_Summary.Lowest_Cell_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x622_Lowest_Cell_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x622_BMS_Cell_Summary.Lowest_Cell_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x622_BMS_Cell_Summary.Lowest_Cell_Voltage = in; return 0; } int decode_can_0x622_Higest_Cell_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x622_BMS_Cell_Summary.Higest_Cell_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x622_Higest_Cell_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x622_BMS_Cell_Summary.Higest_Cell_Temperature = 0; if (in > 100) return -1; o->can_0x622_BMS_Cell_Summary.Higest_Cell_Temperature = in; return 0; } int decode_can_0x622_Lowest_Cell_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x622_BMS_Cell_Summary.Lowest_Cell_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x622_Lowest_Cell_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x622_BMS_Cell_Summary.Lowest_Cell_Temperature = 0; if (in > 100) return -1; o->can_0x622_BMS_Cell_Summary.Lowest_Cell_Temperature = in; return 0; } int print_can_0x622_BMS_Cell_Summary(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "Highest_Cell_Voltage = (wire: %.0f)\n", (double)(o->can_0x622_BMS_Cell_Summary.Highest_Cell_Voltage))); r = print_helper(r, fprintf(output, "Lowest_Cell_Voltage = (wire: %.0f)\n", (double)(o->can_0x622_BMS_Cell_Summary.Lowest_Cell_Voltage))); r = print_helper(r, fprintf(output, "Higest_Cell_Temperature = (wire: %.0f)\n", (double)(o->can_0x622_BMS_Cell_Summary.Higest_Cell_Temperature))); r = print_helper(r, fprintf(output, "Lowest_Cell_Temperature = (wire: %.0f)\n", (double)(o->can_0x622_BMS_Cell_Summary.Lowest_Cell_Temperature))); return r; } static int pack_can_0x630_BMS_M1_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M1_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_1_Voltage)) & 0xffff; i |= x; /* BMS_M1_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_2_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M1_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_3_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M1_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_4_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x630_BMS_M1_Cell_Voltage_Data_1_tx = 1; return 8; } static int unpack_can_0x630_BMS_M1_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M1_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_1_Voltage = x; /* BMS_M1_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_2_Voltage = x; /* BMS_M1_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_3_Voltage = x; /* BMS_M1_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_4_Voltage = x; o->can_0x630_BMS_M1_Cell_Voltage_Data_1_rx = 1; o->can_0x630_BMS_M1_Cell_Voltage_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x630_BMS_M1_Cell_1_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_1_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x630_BMS_M1_Cell_1_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_1_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_1_Voltage = in; return 0; } int decode_can_0x630_BMS_M1_Cell_2_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_2_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x630_BMS_M1_Cell_2_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_2_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_2_Voltage = in; return 0; } int decode_can_0x630_BMS_M1_Cell_3_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_3_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x630_BMS_M1_Cell_3_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_3_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_3_Voltage = in; return 0; } int decode_can_0x630_BMS_M1_Cell_4_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_4_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x630_BMS_M1_Cell_4_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_4_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_4_Voltage = in; return 0; } int print_can_0x630_BMS_M1_Cell_Voltage_Data_1(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M1_Cell_1_Voltage = (wire: %.0f)\n", (double)(o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_1_Voltage))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_2_Voltage = (wire: %.0f)\n", (double)(o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_2_Voltage))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_3_Voltage = (wire: %.0f)\n", (double)(o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_3_Voltage))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_4_Voltage = (wire: %.0f)\n", (double)(o->can_0x630_BMS_M1_Cell_Voltage_Data_1.BMS_M1_Cell_4_Voltage))); return r; } static int pack_can_0x631_BMS_M1_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M1_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_5_Voltage)) & 0xffff; i |= x; /* BMS_M1_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_6_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M1_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_7_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M1_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_8_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x631_BMS_M1_Cell_Voltage_Data_2_tx = 1; return 8; } static int unpack_can_0x631_BMS_M1_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M1_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_5_Voltage = x; /* BMS_M1_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_6_Voltage = x; /* BMS_M1_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_7_Voltage = x; /* BMS_M1_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_8_Voltage = x; o->can_0x631_BMS_M1_Cell_Voltage_Data_2_rx = 1; o->can_0x631_BMS_M1_Cell_Voltage_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x631_BMS_M1_Cell_5_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_5_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x631_BMS_M1_Cell_5_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_5_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_5_Voltage = in; return 0; } int decode_can_0x631_BMS_M1_Cell_6_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_6_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x631_BMS_M1_Cell_6_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_6_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_6_Voltage = in; return 0; } int decode_can_0x631_BMS_M1_Cell_7_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_7_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x631_BMS_M1_Cell_7_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_7_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_7_Voltage = in; return 0; } int decode_can_0x631_BMS_M1_Cell_8_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_8_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x631_BMS_M1_Cell_8_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_8_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_8_Voltage = in; return 0; } int print_can_0x631_BMS_M1_Cell_Voltage_Data_2(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M1_Cell_5_Voltage = (wire: %.0f)\n", (double)(o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_5_Voltage))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_6_Voltage = (wire: %.0f)\n", (double)(o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_6_Voltage))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_7_Voltage = (wire: %.0f)\n", (double)(o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_7_Voltage))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_8_Voltage = (wire: %.0f)\n", (double)(o->can_0x631_BMS_M1_Cell_Voltage_Data_2.BMS_M1_Cell_8_Voltage))); return r; } static int pack_can_0x632_BMS_M1_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M1_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_9_Voltage)) & 0xffff; i |= x; /* BMS_M1_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_10_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M1_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_11_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M1_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_12_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x632_BMS_M1_Cell_Voltage_Data_3_tx = 1; return 8; } static int unpack_can_0x632_BMS_M1_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M1_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_9_Voltage = x; /* BMS_M1_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_10_Voltage = x; /* BMS_M1_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_11_Voltage = x; /* BMS_M1_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_12_Voltage = x; o->can_0x632_BMS_M1_Cell_Voltage_Data_3_rx = 1; o->can_0x632_BMS_M1_Cell_Voltage_Data_3_time_stamp_rx = time_stamp; return 8; } int decode_can_0x632_BMS_M1_Cell_9_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_9_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x632_BMS_M1_Cell_9_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_9_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_9_Voltage = in; return 0; } int decode_can_0x632_BMS_M1_Cell_10_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_10_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x632_BMS_M1_Cell_10_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_10_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_10_Voltage = in; return 0; } int decode_can_0x632_BMS_M1_Cell_11_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_11_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x632_BMS_M1_Cell_11_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_11_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_11_Voltage = in; return 0; } int decode_can_0x632_BMS_M1_Cell_12_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_12_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x632_BMS_M1_Cell_12_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_12_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_12_Voltage = in; return 0; } int print_can_0x632_BMS_M1_Cell_Voltage_Data_3(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M1_Cell_9_Voltage = (wire: %.0f)\n", (double)(o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_9_Voltage))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_10_Voltage = (wire: %.0f)\n", (double)(o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_10_Voltage))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_11_Voltage = (wire: %.0f)\n", (double)(o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_11_Voltage))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_12_Voltage = (wire: %.0f)\n", (double)(o->can_0x632_BMS_M1_Cell_Voltage_Data_3.BMS_M1_Cell_12_Voltage))); return r; } static int pack_can_0x633_BMS_M2_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M2_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_1_Voltage)) & 0xffff; i |= x; /* BMS_M2_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_2_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M2_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_3_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M2_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_4_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x633_BMS_M2_Cell_Voltage_Data_1_tx = 1; return 8; } static int unpack_can_0x633_BMS_M2_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M2_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_1_Voltage = x; /* BMS_M2_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_2_Voltage = x; /* BMS_M2_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_3_Voltage = x; /* BMS_M2_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_4_Voltage = x; o->can_0x633_BMS_M2_Cell_Voltage_Data_1_rx = 1; o->can_0x633_BMS_M2_Cell_Voltage_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x633_BMS_M2_Cell_1_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_1_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x633_BMS_M2_Cell_1_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_1_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_1_Voltage = in; return 0; } int decode_can_0x633_BMS_M2_Cell_2_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_2_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x633_BMS_M2_Cell_2_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_2_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_2_Voltage = in; return 0; } int decode_can_0x633_BMS_M2_Cell_3_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_3_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x633_BMS_M2_Cell_3_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_3_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_3_Voltage = in; return 0; } int decode_can_0x633_BMS_M2_Cell_4_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_4_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x633_BMS_M2_Cell_4_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_4_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_4_Voltage = in; return 0; } int print_can_0x633_BMS_M2_Cell_Voltage_Data_1(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M2_Cell_1_Voltage = (wire: %.0f)\n", (double)(o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_1_Voltage))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_2_Voltage = (wire: %.0f)\n", (double)(o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_2_Voltage))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_3_Voltage = (wire: %.0f)\n", (double)(o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_3_Voltage))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_4_Voltage = (wire: %.0f)\n", (double)(o->can_0x633_BMS_M2_Cell_Voltage_Data_1.BMS_M2_Cell_4_Voltage))); return r; } static int pack_can_0x634_BMS_M2_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M2_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_5_Voltage)) & 0xffff; i |= x; /* BMS_M2_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_6_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M2_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_7_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M2_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_8_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x634_BMS_M2_Cell_Voltage_Data_2_tx = 1; return 8; } static int unpack_can_0x634_BMS_M2_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M2_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_5_Voltage = x; /* BMS_M2_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_6_Voltage = x; /* BMS_M2_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_7_Voltage = x; /* BMS_M2_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_8_Voltage = x; o->can_0x634_BMS_M2_Cell_Voltage_Data_2_rx = 1; o->can_0x634_BMS_M2_Cell_Voltage_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x634_BMS_M2_Cell_5_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_5_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x634_BMS_M2_Cell_5_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_5_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_5_Voltage = in; return 0; } int decode_can_0x634_BMS_M2_Cell_6_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_6_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x634_BMS_M2_Cell_6_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_6_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_6_Voltage = in; return 0; } int decode_can_0x634_BMS_M2_Cell_7_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_7_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x634_BMS_M2_Cell_7_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_7_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_7_Voltage = in; return 0; } int decode_can_0x634_BMS_M2_Cell_8_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_8_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x634_BMS_M2_Cell_8_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_8_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_8_Voltage = in; return 0; } int print_can_0x634_BMS_M2_Cell_Voltage_Data_2(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M2_Cell_5_Voltage = (wire: %.0f)\n", (double)(o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_5_Voltage))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_6_Voltage = (wire: %.0f)\n", (double)(o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_6_Voltage))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_7_Voltage = (wire: %.0f)\n", (double)(o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_7_Voltage))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_8_Voltage = (wire: %.0f)\n", (double)(o->can_0x634_BMS_M2_Cell_Voltage_Data_2.BMS_M2_Cell_8_Voltage))); return r; } static int pack_can_0x635_BMS_M2_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M2_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_9_Voltage)) & 0xffff; i |= x; /* BMS_M2_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_10_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M2_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_11_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M2_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_12_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x635_BMS_M2_Cell_Voltage_Data_3_tx = 1; return 8; } static int unpack_can_0x635_BMS_M2_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M2_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_9_Voltage = x; /* BMS_M2_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_10_Voltage = x; /* BMS_M2_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_11_Voltage = x; /* BMS_M2_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_12_Voltage = x; o->can_0x635_BMS_M2_Cell_Voltage_Data_3_rx = 1; o->can_0x635_BMS_M2_Cell_Voltage_Data_3_time_stamp_rx = time_stamp; return 8; } int decode_can_0x635_BMS_M2_Cell_9_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_9_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x635_BMS_M2_Cell_9_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_9_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_9_Voltage = in; return 0; } int decode_can_0x635_BMS_M2_Cell_10_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_10_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x635_BMS_M2_Cell_10_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_10_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_10_Voltage = in; return 0; } int decode_can_0x635_BMS_M2_Cell_11_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_11_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x635_BMS_M2_Cell_11_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_11_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_11_Voltage = in; return 0; } int decode_can_0x635_BMS_M2_Cell_12_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_12_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x635_BMS_M2_Cell_12_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_12_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_12_Voltage = in; return 0; } int print_can_0x635_BMS_M2_Cell_Voltage_Data_3(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M2_Cell_9_Voltage = (wire: %.0f)\n", (double)(o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_9_Voltage))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_10_Voltage = (wire: %.0f)\n", (double)(o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_10_Voltage))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_11_Voltage = (wire: %.0f)\n", (double)(o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_11_Voltage))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_12_Voltage = (wire: %.0f)\n", (double)(o->can_0x635_BMS_M2_Cell_Voltage_Data_3.BMS_M2_Cell_12_Voltage))); return r; } static int pack_can_0x636_BMS_M3_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M3_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_1_Voltage)) & 0xffff; i |= x; /* BMS_M3_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_2_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M3_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_3_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M3_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_4_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x636_BMS_M3_Cell_Voltage_Data_1_tx = 1; return 8; } static int unpack_can_0x636_BMS_M3_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M3_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_1_Voltage = x; /* BMS_M3_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_2_Voltage = x; /* BMS_M3_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_3_Voltage = x; /* BMS_M3_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_4_Voltage = x; o->can_0x636_BMS_M3_Cell_Voltage_Data_1_rx = 1; o->can_0x636_BMS_M3_Cell_Voltage_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x636_BMS_M3_Cell_1_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_1_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x636_BMS_M3_Cell_1_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_1_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_1_Voltage = in; return 0; } int decode_can_0x636_BMS_M3_Cell_2_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_2_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x636_BMS_M3_Cell_2_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_2_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_2_Voltage = in; return 0; } int decode_can_0x636_BMS_M3_Cell_3_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_3_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x636_BMS_M3_Cell_3_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_3_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_3_Voltage = in; return 0; } int decode_can_0x636_BMS_M3_Cell_4_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_4_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x636_BMS_M3_Cell_4_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_4_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_4_Voltage = in; return 0; } int print_can_0x636_BMS_M3_Cell_Voltage_Data_1(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M3_Cell_1_Voltage = (wire: %.0f)\n", (double)(o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_1_Voltage))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_2_Voltage = (wire: %.0f)\n", (double)(o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_2_Voltage))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_3_Voltage = (wire: %.0f)\n", (double)(o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_3_Voltage))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_4_Voltage = (wire: %.0f)\n", (double)(o->can_0x636_BMS_M3_Cell_Voltage_Data_1.BMS_M3_Cell_4_Voltage))); return r; } static int pack_can_0x637_BMS_M3_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M3_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_5_Voltage)) & 0xffff; i |= x; /* BMS_M3_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_6_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M3_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_7_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M3_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_8_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x637_BMS_M3_Cell_Voltage_Data_2_tx = 1; return 8; } static int unpack_can_0x637_BMS_M3_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M3_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_5_Voltage = x; /* BMS_M3_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_6_Voltage = x; /* BMS_M3_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_7_Voltage = x; /* BMS_M3_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_8_Voltage = x; o->can_0x637_BMS_M3_Cell_Voltage_Data_2_rx = 1; o->can_0x637_BMS_M3_Cell_Voltage_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x637_BMS_M3_Cell_5_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_5_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x637_BMS_M3_Cell_5_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_5_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_5_Voltage = in; return 0; } int decode_can_0x637_BMS_M3_Cell_6_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_6_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x637_BMS_M3_Cell_6_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_6_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_6_Voltage = in; return 0; } int decode_can_0x637_BMS_M3_Cell_7_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_7_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x637_BMS_M3_Cell_7_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_7_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_7_Voltage = in; return 0; } int decode_can_0x637_BMS_M3_Cell_8_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_8_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x637_BMS_M3_Cell_8_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_8_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_8_Voltage = in; return 0; } int print_can_0x637_BMS_M3_Cell_Voltage_Data_2(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M3_Cell_5_Voltage = (wire: %.0f)\n", (double)(o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_5_Voltage))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_6_Voltage = (wire: %.0f)\n", (double)(o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_6_Voltage))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_7_Voltage = (wire: %.0f)\n", (double)(o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_7_Voltage))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_8_Voltage = (wire: %.0f)\n", (double)(o->can_0x637_BMS_M3_Cell_Voltage_Data_2.BMS_M3_Cell_8_Voltage))); return r; } static int pack_can_0x638_BMS_M3_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M3_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_9_Voltage)) & 0xffff; i |= x; /* BMS_M3_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_10_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M3_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_11_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M3_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_12_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x638_BMS_M3_Cell_Voltage_Data_3_tx = 1; return 8; } static int unpack_can_0x638_BMS_M3_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M3_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_9_Voltage = x; /* BMS_M3_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_10_Voltage = x; /* BMS_M3_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_11_Voltage = x; /* BMS_M3_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_12_Voltage = x; o->can_0x638_BMS_M3_Cell_Voltage_Data_3_rx = 1; o->can_0x638_BMS_M3_Cell_Voltage_Data_3_time_stamp_rx = time_stamp; return 8; } int decode_can_0x638_BMS_M3_Cell_9_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_9_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x638_BMS_M3_Cell_9_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_9_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_9_Voltage = in; return 0; } int decode_can_0x638_BMS_M3_Cell_10_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_10_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x638_BMS_M3_Cell_10_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_10_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_10_Voltage = in; return 0; } int decode_can_0x638_BMS_M3_Cell_11_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_11_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x638_BMS_M3_Cell_11_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_11_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_11_Voltage = in; return 0; } int decode_can_0x638_BMS_M3_Cell_12_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_12_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x638_BMS_M3_Cell_12_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_12_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_12_Voltage = in; return 0; } int print_can_0x638_BMS_M3_Cell_Voltage_Data_3(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M3_Cell_9_Voltage = (wire: %.0f)\n", (double)(o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_9_Voltage))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_10_Voltage = (wire: %.0f)\n", (double)(o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_10_Voltage))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_11_Voltage = (wire: %.0f)\n", (double)(o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_11_Voltage))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_12_Voltage = (wire: %.0f)\n", (double)(o->can_0x638_BMS_M3_Cell_Voltage_Data_3.BMS_M3_Cell_12_Voltage))); return r; } static int pack_can_0x639_BMS_M4_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M4_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_1_Voltage)) & 0xffff; i |= x; /* BMS_M4_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_2_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M4_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_3_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M4_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_4_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x639_BMS_M4_Cell_Voltage_Data_1_tx = 1; return 8; } static int unpack_can_0x639_BMS_M4_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M4_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_1_Voltage = x; /* BMS_M4_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_2_Voltage = x; /* BMS_M4_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_3_Voltage = x; /* BMS_M4_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_4_Voltage = x; o->can_0x639_BMS_M4_Cell_Voltage_Data_1_rx = 1; o->can_0x639_BMS_M4_Cell_Voltage_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x639_BMS_M4_Cell_1_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_1_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x639_BMS_M4_Cell_1_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_1_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_1_Voltage = in; return 0; } int decode_can_0x639_BMS_M4_Cell_2_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_2_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x639_BMS_M4_Cell_2_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_2_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_2_Voltage = in; return 0; } int decode_can_0x639_BMS_M4_Cell_3_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_3_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x639_BMS_M4_Cell_3_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_3_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_3_Voltage = in; return 0; } int decode_can_0x639_BMS_M4_Cell_4_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_4_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x639_BMS_M4_Cell_4_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_4_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_4_Voltage = in; return 0; } int print_can_0x639_BMS_M4_Cell_Voltage_Data_1(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M4_Cell_1_Voltage = (wire: %.0f)\n", (double)(o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_1_Voltage))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_2_Voltage = (wire: %.0f)\n", (double)(o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_2_Voltage))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_3_Voltage = (wire: %.0f)\n", (double)(o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_3_Voltage))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_4_Voltage = (wire: %.0f)\n", (double)(o->can_0x639_BMS_M4_Cell_Voltage_Data_1.BMS_M4_Cell_4_Voltage))); return r; } static int pack_can_0x63a_BMS_M4_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M4_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_5_Voltage)) & 0xffff; i |= x; /* BMS_M4_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_6_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M4_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_7_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M4_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_8_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x63a_BMS_M4_Cell_Voltage_Data_2_tx = 1; return 8; } static int unpack_can_0x63a_BMS_M4_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M4_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_5_Voltage = x; /* BMS_M4_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_6_Voltage = x; /* BMS_M4_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_7_Voltage = x; /* BMS_M4_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_8_Voltage = x; o->can_0x63a_BMS_M4_Cell_Voltage_Data_2_rx = 1; o->can_0x63a_BMS_M4_Cell_Voltage_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x63a_BMS_M4_Cell_5_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_5_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63a_BMS_M4_Cell_5_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_5_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_5_Voltage = in; return 0; } int decode_can_0x63a_BMS_M4_Cell_6_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_6_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63a_BMS_M4_Cell_6_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_6_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_6_Voltage = in; return 0; } int decode_can_0x63a_BMS_M4_Cell_7_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_7_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63a_BMS_M4_Cell_7_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_7_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_7_Voltage = in; return 0; } int decode_can_0x63a_BMS_M4_Cell_8_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_8_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63a_BMS_M4_Cell_8_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_8_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_8_Voltage = in; return 0; } int print_can_0x63a_BMS_M4_Cell_Voltage_Data_2(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M4_Cell_5_Voltage = (wire: %.0f)\n", (double)(o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_5_Voltage))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_6_Voltage = (wire: %.0f)\n", (double)(o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_6_Voltage))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_7_Voltage = (wire: %.0f)\n", (double)(o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_7_Voltage))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_8_Voltage = (wire: %.0f)\n", (double)(o->can_0x63a_BMS_M4_Cell_Voltage_Data_2.BMS_M4_Cell_8_Voltage))); return r; } static int pack_can_0x63b_BMS_M4_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M4_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_9_Voltage)) & 0xffff; i |= x; /* BMS_M4_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_10_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M4_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_11_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M4_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_12_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x63b_BMS_M4_Cell_Voltage_Data_3_tx = 1; return 8; } static int unpack_can_0x63b_BMS_M4_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M4_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_9_Voltage = x; /* BMS_M4_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_10_Voltage = x; /* BMS_M4_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_11_Voltage = x; /* BMS_M4_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_12_Voltage = x; o->can_0x63b_BMS_M4_Cell_Voltage_Data_3_rx = 1; o->can_0x63b_BMS_M4_Cell_Voltage_Data_3_time_stamp_rx = time_stamp; return 8; } int decode_can_0x63b_BMS_M4_Cell_9_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_9_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63b_BMS_M4_Cell_9_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_9_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_9_Voltage = in; return 0; } int decode_can_0x63b_BMS_M4_Cell_10_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_10_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63b_BMS_M4_Cell_10_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_10_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_10_Voltage = in; return 0; } int decode_can_0x63b_BMS_M4_Cell_11_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_11_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63b_BMS_M4_Cell_11_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_11_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_11_Voltage = in; return 0; } int decode_can_0x63b_BMS_M4_Cell_12_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_12_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63b_BMS_M4_Cell_12_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_12_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_12_Voltage = in; return 0; } int print_can_0x63b_BMS_M4_Cell_Voltage_Data_3(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M4_Cell_9_Voltage = (wire: %.0f)\n", (double)(o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_9_Voltage))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_10_Voltage = (wire: %.0f)\n", (double)(o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_10_Voltage))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_11_Voltage = (wire: %.0f)\n", (double)(o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_11_Voltage))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_12_Voltage = (wire: %.0f)\n", (double)(o->can_0x63b_BMS_M4_Cell_Voltage_Data_3.BMS_M4_Cell_12_Voltage))); return r; } static int pack_can_0x63c_BMS_M5_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M5_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_1_Voltage)) & 0xffff; i |= x; /* BMS_M5_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_2_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M5_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_3_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M5_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_4_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x63c_BMS_M5_Cell_Voltage_Data_1_tx = 1; return 8; } static int unpack_can_0x63c_BMS_M5_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M5_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_1_Voltage = x; /* BMS_M5_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_2_Voltage = x; /* BMS_M5_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_3_Voltage = x; /* BMS_M5_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_4_Voltage = x; o->can_0x63c_BMS_M5_Cell_Voltage_Data_1_rx = 1; o->can_0x63c_BMS_M5_Cell_Voltage_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x63c_BMS_M5_Cell_1_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_1_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63c_BMS_M5_Cell_1_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_1_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_1_Voltage = in; return 0; } int decode_can_0x63c_BMS_M5_Cell_2_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_2_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63c_BMS_M5_Cell_2_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_2_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_2_Voltage = in; return 0; } int decode_can_0x63c_BMS_M5_Cell_3_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_3_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63c_BMS_M5_Cell_3_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_3_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_3_Voltage = in; return 0; } int decode_can_0x63c_BMS_M5_Cell_4_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_4_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63c_BMS_M5_Cell_4_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_4_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_4_Voltage = in; return 0; } int print_can_0x63c_BMS_M5_Cell_Voltage_Data_1(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M5_Cell_1_Voltage = (wire: %.0f)\n", (double)(o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_1_Voltage))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_2_Voltage = (wire: %.0f)\n", (double)(o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_2_Voltage))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_3_Voltage = (wire: %.0f)\n", (double)(o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_3_Voltage))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_4_Voltage = (wire: %.0f)\n", (double)(o->can_0x63c_BMS_M5_Cell_Voltage_Data_1.BMS_M5_Cell_4_Voltage))); return r; } static int pack_can_0x63d_BMS_M5_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M5_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_5_Voltage)) & 0xffff; i |= x; /* BMS_M5_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_6_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M5_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_7_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M5_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_8_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x63d_BMS_M5_Cell_Voltage_Data_2_tx = 1; return 8; } static int unpack_can_0x63d_BMS_M5_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M5_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_5_Voltage = x; /* BMS_M5_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_6_Voltage = x; /* BMS_M5_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_7_Voltage = x; /* BMS_M5_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_8_Voltage = x; o->can_0x63d_BMS_M5_Cell_Voltage_Data_2_rx = 1; o->can_0x63d_BMS_M5_Cell_Voltage_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x63d_BMS_M5_Cell_5_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_5_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63d_BMS_M5_Cell_5_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_5_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_5_Voltage = in; return 0; } int decode_can_0x63d_BMS_M5_Cell_6_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_6_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63d_BMS_M5_Cell_6_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_6_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_6_Voltage = in; return 0; } int decode_can_0x63d_BMS_M5_Cell_7_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_7_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63d_BMS_M5_Cell_7_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_7_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_7_Voltage = in; return 0; } int decode_can_0x63d_BMS_M5_Cell_8_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_8_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63d_BMS_M5_Cell_8_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_8_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_8_Voltage = in; return 0; } int print_can_0x63d_BMS_M5_Cell_Voltage_Data_2(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M5_Cell_5_Voltage = (wire: %.0f)\n", (double)(o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_5_Voltage))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_6_Voltage = (wire: %.0f)\n", (double)(o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_6_Voltage))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_7_Voltage = (wire: %.0f)\n", (double)(o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_7_Voltage))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_8_Voltage = (wire: %.0f)\n", (double)(o->can_0x63d_BMS_M5_Cell_Voltage_Data_2.BMS_M5_Cell_8_Voltage))); return r; } static int pack_can_0x63e_BMS_M5_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M5_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_9_Voltage)) & 0xffff; i |= x; /* BMS_M5_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_10_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M5_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_11_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M5_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_12_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x63e_BMS_M5_Cell_Voltage_Data_3_tx = 1; return 8; } static int unpack_can_0x63e_BMS_M5_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M5_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_9_Voltage = x; /* BMS_M5_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_10_Voltage = x; /* BMS_M5_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_11_Voltage = x; /* BMS_M5_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_12_Voltage = x; o->can_0x63e_BMS_M5_Cell_Voltage_Data_3_rx = 1; o->can_0x63e_BMS_M5_Cell_Voltage_Data_3_time_stamp_rx = time_stamp; return 8; } int decode_can_0x63e_BMS_M5_Cell_9_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_9_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63e_BMS_M5_Cell_9_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_9_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_9_Voltage = in; return 0; } int decode_can_0x63e_BMS_M5_Cell_10_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_10_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63e_BMS_M5_Cell_10_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_10_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_10_Voltage = in; return 0; } int decode_can_0x63e_BMS_M5_Cell_11_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_11_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63e_BMS_M5_Cell_11_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_11_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_11_Voltage = in; return 0; } int decode_can_0x63e_BMS_M5_Cell_12_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_12_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63e_BMS_M5_Cell_12_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_12_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_12_Voltage = in; return 0; } int print_can_0x63e_BMS_M5_Cell_Voltage_Data_3(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M5_Cell_9_Voltage = (wire: %.0f)\n", (double)(o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_9_Voltage))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_10_Voltage = (wire: %.0f)\n", (double)(o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_10_Voltage))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_11_Voltage = (wire: %.0f)\n", (double)(o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_11_Voltage))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_12_Voltage = (wire: %.0f)\n", (double)(o->can_0x63e_BMS_M5_Cell_Voltage_Data_3.BMS_M5_Cell_12_Voltage))); return r; } static int pack_can_0x63f_BMS_M6_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M6_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_1_Voltage)) & 0xffff; i |= x; /* BMS_M6_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_2_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M6_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_3_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M6_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_4_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x63f_BMS_M6_Cell_Voltage_Data_1_tx = 1; return 8; } static int unpack_can_0x63f_BMS_M6_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M6_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_1_Voltage = x; /* BMS_M6_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_2_Voltage = x; /* BMS_M6_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_3_Voltage = x; /* BMS_M6_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_4_Voltage = x; o->can_0x63f_BMS_M6_Cell_Voltage_Data_1_rx = 1; o->can_0x63f_BMS_M6_Cell_Voltage_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x63f_BMS_M6_Cell_1_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_1_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63f_BMS_M6_Cell_1_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_1_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_1_Voltage = in; return 0; } int decode_can_0x63f_BMS_M6_Cell_2_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_2_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63f_BMS_M6_Cell_2_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_2_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_2_Voltage = in; return 0; } int decode_can_0x63f_BMS_M6_Cell_3_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_3_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63f_BMS_M6_Cell_3_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_3_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_3_Voltage = in; return 0; } int decode_can_0x63f_BMS_M6_Cell_4_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_4_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x63f_BMS_M6_Cell_4_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_4_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_4_Voltage = in; return 0; } int print_can_0x63f_BMS_M6_Cell_Voltage_Data_1(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M6_Cell_1_Voltage = (wire: %.0f)\n", (double)(o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_1_Voltage))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_2_Voltage = (wire: %.0f)\n", (double)(o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_2_Voltage))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_3_Voltage = (wire: %.0f)\n", (double)(o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_3_Voltage))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_4_Voltage = (wire: %.0f)\n", (double)(o->can_0x63f_BMS_M6_Cell_Voltage_Data_1.BMS_M6_Cell_4_Voltage))); return r; } static int pack_can_0x640_BMS_M6_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M6_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_5_Voltage)) & 0xffff; i |= x; /* BMS_M6_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_6_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M6_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_7_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M6_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_8_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x640_BMS_M6_Cell_Voltage_Data_2_tx = 1; return 8; } static int unpack_can_0x640_BMS_M6_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M6_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_5_Voltage = x; /* BMS_M6_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_6_Voltage = x; /* BMS_M6_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_7_Voltage = x; /* BMS_M6_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_8_Voltage = x; o->can_0x640_BMS_M6_Cell_Voltage_Data_2_rx = 1; o->can_0x640_BMS_M6_Cell_Voltage_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x640_BMS_M6_Cell_5_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_5_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x640_BMS_M6_Cell_5_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_5_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_5_Voltage = in; return 0; } int decode_can_0x640_BMS_M6_Cell_6_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_6_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x640_BMS_M6_Cell_6_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_6_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_6_Voltage = in; return 0; } int decode_can_0x640_BMS_M6_Cell_7_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_7_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x640_BMS_M6_Cell_7_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_7_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_7_Voltage = in; return 0; } int decode_can_0x640_BMS_M6_Cell_8_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_8_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x640_BMS_M6_Cell_8_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_8_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_8_Voltage = in; return 0; } int print_can_0x640_BMS_M6_Cell_Voltage_Data_2(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M6_Cell_5_Voltage = (wire: %.0f)\n", (double)(o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_5_Voltage))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_6_Voltage = (wire: %.0f)\n", (double)(o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_6_Voltage))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_7_Voltage = (wire: %.0f)\n", (double)(o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_7_Voltage))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_8_Voltage = (wire: %.0f)\n", (double)(o->can_0x640_BMS_M6_Cell_Voltage_Data_2.BMS_M6_Cell_8_Voltage))); return r; } static int pack_can_0x641_BMS_M6_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M6_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_9_Voltage)) & 0xffff; i |= x; /* BMS_M6_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_10_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M6_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_11_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M6_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_12_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x641_BMS_M6_Cell_Voltage_Data_3_tx = 1; return 8; } static int unpack_can_0x641_BMS_M6_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M6_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_9_Voltage = x; /* BMS_M6_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_10_Voltage = x; /* BMS_M6_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_11_Voltage = x; /* BMS_M6_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_12_Voltage = x; o->can_0x641_BMS_M6_Cell_Voltage_Data_3_rx = 1; o->can_0x641_BMS_M6_Cell_Voltage_Data_3_time_stamp_rx = time_stamp; return 8; } int decode_can_0x641_BMS_M6_Cell_9_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_9_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x641_BMS_M6_Cell_9_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_9_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_9_Voltage = in; return 0; } int decode_can_0x641_BMS_M6_Cell_10_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_10_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x641_BMS_M6_Cell_10_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_10_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_10_Voltage = in; return 0; } int decode_can_0x641_BMS_M6_Cell_11_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_11_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x641_BMS_M6_Cell_11_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_11_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_11_Voltage = in; return 0; } int decode_can_0x641_BMS_M6_Cell_12_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_12_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x641_BMS_M6_Cell_12_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_12_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_12_Voltage = in; return 0; } int print_can_0x641_BMS_M6_Cell_Voltage_Data_3(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M6_Cell_9_Voltage = (wire: %.0f)\n", (double)(o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_9_Voltage))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_10_Voltage = (wire: %.0f)\n", (double)(o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_10_Voltage))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_11_Voltage = (wire: %.0f)\n", (double)(o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_11_Voltage))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_12_Voltage = (wire: %.0f)\n", (double)(o->can_0x641_BMS_M6_Cell_Voltage_Data_3.BMS_M6_Cell_12_Voltage))); return r; } static int pack_can_0x642_BMS_M7_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M7_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_1_Voltage)) & 0xffff; i |= x; /* BMS_M7_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_2_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M7_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_3_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M7_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_4_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x642_BMS_M7_Cell_Voltage_Data_1_tx = 1; return 8; } static int unpack_can_0x642_BMS_M7_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M7_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_1_Voltage = x; /* BMS_M7_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_2_Voltage = x; /* BMS_M7_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_3_Voltage = x; /* BMS_M7_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_4_Voltage = x; o->can_0x642_BMS_M7_Cell_Voltage_Data_1_rx = 1; o->can_0x642_BMS_M7_Cell_Voltage_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x642_BMS_M7_Cell_1_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_1_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x642_BMS_M7_Cell_1_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_1_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_1_Voltage = in; return 0; } int decode_can_0x642_BMS_M7_Cell_2_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_2_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x642_BMS_M7_Cell_2_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_2_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_2_Voltage = in; return 0; } int decode_can_0x642_BMS_M7_Cell_3_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_3_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x642_BMS_M7_Cell_3_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_3_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_3_Voltage = in; return 0; } int decode_can_0x642_BMS_M7_Cell_4_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_4_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x642_BMS_M7_Cell_4_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_4_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_4_Voltage = in; return 0; } int print_can_0x642_BMS_M7_Cell_Voltage_Data_1(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M7_Cell_1_Voltage = (wire: %.0f)\n", (double)(o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_1_Voltage))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_2_Voltage = (wire: %.0f)\n", (double)(o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_2_Voltage))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_3_Voltage = (wire: %.0f)\n", (double)(o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_3_Voltage))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_4_Voltage = (wire: %.0f)\n", (double)(o->can_0x642_BMS_M7_Cell_Voltage_Data_1.BMS_M7_Cell_4_Voltage))); return r; } static int pack_can_0x643_BMS_M7_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M7_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_5_Voltage)) & 0xffff; i |= x; /* BMS_M7_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_6_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M7_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_7_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M7_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_8_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x643_BMS_M7_Cell_Voltage_Data_2_tx = 1; return 8; } static int unpack_can_0x643_BMS_M7_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M7_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_5_Voltage = x; /* BMS_M7_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_6_Voltage = x; /* BMS_M7_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_7_Voltage = x; /* BMS_M7_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_8_Voltage = x; o->can_0x643_BMS_M7_Cell_Voltage_Data_2_rx = 1; o->can_0x643_BMS_M7_Cell_Voltage_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x643_BMS_M7_Cell_5_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_5_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x643_BMS_M7_Cell_5_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_5_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_5_Voltage = in; return 0; } int decode_can_0x643_BMS_M7_Cell_6_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_6_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x643_BMS_M7_Cell_6_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_6_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_6_Voltage = in; return 0; } int decode_can_0x643_BMS_M7_Cell_7_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_7_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x643_BMS_M7_Cell_7_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_7_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_7_Voltage = in; return 0; } int decode_can_0x643_BMS_M7_Cell_8_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_8_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x643_BMS_M7_Cell_8_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_8_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_8_Voltage = in; return 0; } int print_can_0x643_BMS_M7_Cell_Voltage_Data_2(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M7_Cell_5_Voltage = (wire: %.0f)\n", (double)(o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_5_Voltage))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_6_Voltage = (wire: %.0f)\n", (double)(o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_6_Voltage))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_7_Voltage = (wire: %.0f)\n", (double)(o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_7_Voltage))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_8_Voltage = (wire: %.0f)\n", (double)(o->can_0x643_BMS_M7_Cell_Voltage_Data_2.BMS_M7_Cell_8_Voltage))); return r; } static int pack_can_0x644_BMS_M7_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M7_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_9_Voltage)) & 0xffff; i |= x; /* BMS_M7_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_10_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M7_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_11_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M7_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_12_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x644_BMS_M7_Cell_Voltage_Data_3_tx = 1; return 8; } static int unpack_can_0x644_BMS_M7_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M7_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_9_Voltage = x; /* BMS_M7_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_10_Voltage = x; /* BMS_M7_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_11_Voltage = x; /* BMS_M7_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_12_Voltage = x; o->can_0x644_BMS_M7_Cell_Voltage_Data_3_rx = 1; o->can_0x644_BMS_M7_Cell_Voltage_Data_3_time_stamp_rx = time_stamp; return 8; } int decode_can_0x644_BMS_M7_Cell_9_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_9_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x644_BMS_M7_Cell_9_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_9_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_9_Voltage = in; return 0; } int decode_can_0x644_BMS_M7_Cell_10_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_10_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x644_BMS_M7_Cell_10_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_10_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_10_Voltage = in; return 0; } int decode_can_0x644_BMS_M7_Cell_11_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_11_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x644_BMS_M7_Cell_11_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_11_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_11_Voltage = in; return 0; } int decode_can_0x644_BMS_M7_Cell_12_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_12_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x644_BMS_M7_Cell_12_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_12_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_12_Voltage = in; return 0; } int print_can_0x644_BMS_M7_Cell_Voltage_Data_3(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M7_Cell_9_Voltage = (wire: %.0f)\n", (double)(o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_9_Voltage))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_10_Voltage = (wire: %.0f)\n", (double)(o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_10_Voltage))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_11_Voltage = (wire: %.0f)\n", (double)(o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_11_Voltage))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_12_Voltage = (wire: %.0f)\n", (double)(o->can_0x644_BMS_M7_Cell_Voltage_Data_3.BMS_M7_Cell_12_Voltage))); return r; } static int pack_can_0x645_BMS_M8_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M8_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_1_Voltage)) & 0xffff; i |= x; /* BMS_M8_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_2_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M8_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_3_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M8_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_4_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x645_BMS_M8_Cell_Voltage_Data_1_tx = 1; return 8; } static int unpack_can_0x645_BMS_M8_Cell_Voltage_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M8_Cell_1_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_1_Voltage = x; /* BMS_M8_Cell_2_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_2_Voltage = x; /* BMS_M8_Cell_3_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_3_Voltage = x; /* BMS_M8_Cell_4_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_4_Voltage = x; o->can_0x645_BMS_M8_Cell_Voltage_Data_1_rx = 1; o->can_0x645_BMS_M8_Cell_Voltage_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x645_BMS_M8_Cell_1_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_1_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x645_BMS_M8_Cell_1_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_1_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_1_Voltage = in; return 0; } int decode_can_0x645_BMS_M8_Cell_2_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_2_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x645_BMS_M8_Cell_2_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_2_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_2_Voltage = in; return 0; } int decode_can_0x645_BMS_M8_Cell_3_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_3_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x645_BMS_M8_Cell_3_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_3_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_3_Voltage = in; return 0; } int decode_can_0x645_BMS_M8_Cell_4_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_4_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x645_BMS_M8_Cell_4_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_4_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_4_Voltage = in; return 0; } int print_can_0x645_BMS_M8_Cell_Voltage_Data_1(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M8_Cell_1_Voltage = (wire: %.0f)\n", (double)(o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_1_Voltage))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_2_Voltage = (wire: %.0f)\n", (double)(o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_2_Voltage))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_3_Voltage = (wire: %.0f)\n", (double)(o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_3_Voltage))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_4_Voltage = (wire: %.0f)\n", (double)(o->can_0x645_BMS_M8_Cell_Voltage_Data_1.BMS_M8_Cell_4_Voltage))); return r; } static int pack_can_0x646_BMS_M8_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M8_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_5_Voltage)) & 0xffff; i |= x; /* BMS_M8_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_6_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M8_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_7_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M8_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_8_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x646_BMS_M8_Cell_Voltage_Data_2_tx = 1; return 8; } static int unpack_can_0x646_BMS_M8_Cell_Voltage_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M8_Cell_5_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_5_Voltage = x; /* BMS_M8_Cell_6_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_6_Voltage = x; /* BMS_M8_Cell_7_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_7_Voltage = x; /* BMS_M8_Cell_8_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_8_Voltage = x; o->can_0x646_BMS_M8_Cell_Voltage_Data_2_rx = 1; o->can_0x646_BMS_M8_Cell_Voltage_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x646_BMS_M8_Cell_5_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_5_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x646_BMS_M8_Cell_5_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_5_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_5_Voltage = in; return 0; } int decode_can_0x646_BMS_M8_Cell_6_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_6_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x646_BMS_M8_Cell_6_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_6_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_6_Voltage = in; return 0; } int decode_can_0x646_BMS_M8_Cell_7_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_7_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x646_BMS_M8_Cell_7_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_7_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_7_Voltage = in; return 0; } int decode_can_0x646_BMS_M8_Cell_8_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_8_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x646_BMS_M8_Cell_8_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_8_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_8_Voltage = in; return 0; } int print_can_0x646_BMS_M8_Cell_Voltage_Data_2(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M8_Cell_5_Voltage = (wire: %.0f)\n", (double)(o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_5_Voltage))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_6_Voltage = (wire: %.0f)\n", (double)(o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_6_Voltage))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_7_Voltage = (wire: %.0f)\n", (double)(o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_7_Voltage))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_8_Voltage = (wire: %.0f)\n", (double)(o->can_0x646_BMS_M8_Cell_Voltage_Data_2.BMS_M8_Cell_8_Voltage))); return r; } static int pack_can_0x647_BMS_M8_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M8_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_9_Voltage)) & 0xffff; i |= x; /* BMS_M8_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_10_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_M8_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_11_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_M8_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_12_Voltage)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x647_BMS_M8_Cell_Voltage_Data_3_tx = 1; return 8; } static int unpack_can_0x647_BMS_M8_Cell_Voltage_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M8_Cell_9_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_9_Voltage = x; /* BMS_M8_Cell_10_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_10_Voltage = x; /* BMS_M8_Cell_11_Voltage: start-bit 32, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_11_Voltage = x; /* BMS_M8_Cell_12_Voltage: start-bit 48, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_12_Voltage = x; o->can_0x647_BMS_M8_Cell_Voltage_Data_3_rx = 1; o->can_0x647_BMS_M8_Cell_Voltage_Data_3_time_stamp_rx = time_stamp; return 8; } int decode_can_0x647_BMS_M8_Cell_9_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_9_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x647_BMS_M8_Cell_9_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_9_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_9_Voltage = in; return 0; } int decode_can_0x647_BMS_M8_Cell_10_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_10_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x647_BMS_M8_Cell_10_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_10_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_10_Voltage = in; return 0; } int decode_can_0x647_BMS_M8_Cell_11_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_11_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x647_BMS_M8_Cell_11_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_11_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_11_Voltage = in; return 0; } int decode_can_0x647_BMS_M8_Cell_12_Voltage(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_12_Voltage); rval *= 0.0001; if (rval <= 5) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x647_BMS_M8_Cell_12_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_12_Voltage = 0; if (in > 5) return -1; in *= 10000; o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_12_Voltage = in; return 0; } int print_can_0x647_BMS_M8_Cell_Voltage_Data_3(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M8_Cell_9_Voltage = (wire: %.0f)\n", (double)(o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_9_Voltage))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_10_Voltage = (wire: %.0f)\n", (double)(o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_10_Voltage))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_11_Voltage = (wire: %.0f)\n", (double)(o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_11_Voltage))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_12_Voltage = (wire: %.0f)\n", (double)(o->can_0x647_BMS_M8_Cell_Voltage_Data_3.BMS_M8_Cell_12_Voltage))); return r; } static int pack_can_0x680_BMS_M1_Cell_Temperature_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M1_Cell_1_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_1_Temperature)) & 0xffff; i |= x; /* BMS_M1_Cell_2_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_2_Temperature)) & 0xffff; x <<= 16; i |= x; /* BMS_M1_Cell_3_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_3_Temperature)) & 0xffff; x <<= 32; i |= x; /* BMS_M1_Cell_4_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_4_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x680_BMS_M1_Cell_Temperature_Data_1_tx = 1; return 8; } static int unpack_can_0x680_BMS_M1_Cell_Temperature_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M1_Cell_1_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_1_Temperature = x; /* BMS_M1_Cell_2_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_2_Temperature = x; /* BMS_M1_Cell_3_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_3_Temperature = x; /* BMS_M1_Cell_4_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_4_Temperature = x; o->can_0x680_BMS_M1_Cell_Temperature_Data_1_rx = 1; o->can_0x680_BMS_M1_Cell_Temperature_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x680_BMS_M1_Cell_1_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_1_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x680_BMS_M1_Cell_1_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_1_Temperature = 0; if (in > 100) return -1; o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_1_Temperature = in; return 0; } int decode_can_0x680_BMS_M1_Cell_2_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_2_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x680_BMS_M1_Cell_2_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_2_Temperature = 0; if (in > 100) return -1; o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_2_Temperature = in; return 0; } int decode_can_0x680_BMS_M1_Cell_3_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_3_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x680_BMS_M1_Cell_3_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_3_Temperature = 0; if (in > 100) return -1; o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_3_Temperature = in; return 0; } int decode_can_0x680_BMS_M1_Cell_4_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_4_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x680_BMS_M1_Cell_4_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_4_Temperature = 0; if (in > 100) return -1; o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_4_Temperature = in; return 0; } int print_can_0x680_BMS_M1_Cell_Temperature_Data_1(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M1_Cell_1_Temperature = (wire: %.0f)\n", (double)(o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_1_Temperature))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_2_Temperature = (wire: %.0f)\n", (double)(o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_2_Temperature))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_3_Temperature = (wire: %.0f)\n", (double)(o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_3_Temperature))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_4_Temperature = (wire: %.0f)\n", (double)(o->can_0x680_BMS_M1_Cell_Temperature_Data_1.BMS_M1_Cell_4_Temperature))); return r; } static int pack_can_0x681_BMS_M1_Cell_Temperature_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M1_Cell_5_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_5_Temperature)) & 0xffff; i |= x; /* BMS_M1_Cell_6_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_6_Temperature)) & 0xffff; x <<= 16; i |= x; /* BMS_M1_Cell_7_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_7_Temperature)) & 0xffff; x <<= 32; i |= x; /* BMS_M1_Cell_8_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_8_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x681_BMS_M1_Cell_Temperature_Data_2_tx = 1; return 8; } static int unpack_can_0x681_BMS_M1_Cell_Temperature_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M1_Cell_5_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_5_Temperature = x; /* BMS_M1_Cell_6_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_6_Temperature = x; /* BMS_M1_Cell_7_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_7_Temperature = x; /* BMS_M1_Cell_8_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_8_Temperature = x; o->can_0x681_BMS_M1_Cell_Temperature_Data_2_rx = 1; o->can_0x681_BMS_M1_Cell_Temperature_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x681_BMS_M1_Cell_5_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_5_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x681_BMS_M1_Cell_5_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_5_Temperature = 0; if (in > 100) return -1; o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_5_Temperature = in; return 0; } int decode_can_0x681_BMS_M1_Cell_6_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_6_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x681_BMS_M1_Cell_6_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_6_Temperature = 0; if (in > 100) return -1; o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_6_Temperature = in; return 0; } int decode_can_0x681_BMS_M1_Cell_7_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_7_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x681_BMS_M1_Cell_7_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_7_Temperature = 0; if (in > 100) return -1; o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_7_Temperature = in; return 0; } int decode_can_0x681_BMS_M1_Cell_8_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_8_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x681_BMS_M1_Cell_8_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_8_Temperature = 0; if (in > 100) return -1; o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_8_Temperature = in; return 0; } int print_can_0x681_BMS_M1_Cell_Temperature_Data_2(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M1_Cell_5_Temperature = (wire: %.0f)\n", (double)(o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_5_Temperature))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_6_Temperature = (wire: %.0f)\n", (double)(o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_6_Temperature))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_7_Temperature = (wire: %.0f)\n", (double)(o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_7_Temperature))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_8_Temperature = (wire: %.0f)\n", (double)(o->can_0x681_BMS_M1_Cell_Temperature_Data_2.BMS_M1_Cell_8_Temperature))); return r; } static int pack_can_0x682_BMS_M1_Cell_Temperature_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M1_Cell_9_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_9_Temperature)) & 0xffff; i |= x; /* BMS_M1_Cell_10_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_10_Temperature)) & 0xffff; x <<= 16; i |= x; /* BMS_M1_Cell_11_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_11_Temperature)) & 0xffff; x <<= 32; i |= x; /* BMS_M1_Cell_12_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_12_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x682_BMS_M1_Cell_Temperature_Data_3_tx = 1; return 8; } static int unpack_can_0x682_BMS_M1_Cell_Temperature_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M1_Cell_9_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_9_Temperature = x; /* BMS_M1_Cell_10_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_10_Temperature = x; /* BMS_M1_Cell_11_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_11_Temperature = x; /* BMS_M1_Cell_12_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_12_Temperature = x; o->can_0x682_BMS_M1_Cell_Temperature_Data_3_rx = 1; o->can_0x682_BMS_M1_Cell_Temperature_Data_3_time_stamp_rx = time_stamp; return 8; } int decode_can_0x682_BMS_M1_Cell_9_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_9_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x682_BMS_M1_Cell_9_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_9_Temperature = 0; if (in > 100) return -1; o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_9_Temperature = in; return 0; } int decode_can_0x682_BMS_M1_Cell_10_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_10_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x682_BMS_M1_Cell_10_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_10_Temperature = 0; if (in > 100) return -1; o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_10_Temperature = in; return 0; } int decode_can_0x682_BMS_M1_Cell_11_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_11_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x682_BMS_M1_Cell_11_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_11_Temperature = 0; if (in > 100) return -1; o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_11_Temperature = in; return 0; } int decode_can_0x682_BMS_M1_Cell_12_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_12_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x682_BMS_M1_Cell_12_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_12_Temperature = 0; if (in > 100) return -1; o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_12_Temperature = in; return 0; } int print_can_0x682_BMS_M1_Cell_Temperature_Data_3(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M1_Cell_9_Temperature = (wire: %.0f)\n", (double)(o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_9_Temperature))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_10_Temperature = (wire: %.0f)\n", (double)(o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_10_Temperature))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_11_Temperature = (wire: %.0f)\n", (double)(o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_11_Temperature))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_12_Temperature = (wire: %.0f)\n", (double)(o->can_0x682_BMS_M1_Cell_Temperature_Data_3.BMS_M1_Cell_12_Temperature))); return r; } static int pack_can_0x683_BMS_M2_Cell_Temperature_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M2_Cell_1_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_1_Temperature)) & 0xffff; i |= x; /* BMS_M2_Cell_2_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_2_Temperature)) & 0xffff; x <<= 16; i |= x; /* BMS_M2_Cell_3_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_3_Temperature)) & 0xffff; x <<= 32; i |= x; /* BMS_M2_Cell_4_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_4_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x683_BMS_M2_Cell_Temperature_Data_1_tx = 1; return 8; } static int unpack_can_0x683_BMS_M2_Cell_Temperature_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M2_Cell_1_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_1_Temperature = x; /* BMS_M2_Cell_2_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_2_Temperature = x; /* BMS_M2_Cell_3_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_3_Temperature = x; /* BMS_M2_Cell_4_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_4_Temperature = x; o->can_0x683_BMS_M2_Cell_Temperature_Data_1_rx = 1; o->can_0x683_BMS_M2_Cell_Temperature_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x683_BMS_M2_Cell_1_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_1_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x683_BMS_M2_Cell_1_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_1_Temperature = 0; if (in > 100) return -1; o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_1_Temperature = in; return 0; } int decode_can_0x683_BMS_M2_Cell_2_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_2_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x683_BMS_M2_Cell_2_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_2_Temperature = 0; if (in > 100) return -1; o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_2_Temperature = in; return 0; } int decode_can_0x683_BMS_M2_Cell_3_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_3_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x683_BMS_M2_Cell_3_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_3_Temperature = 0; if (in > 100) return -1; o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_3_Temperature = in; return 0; } int decode_can_0x683_BMS_M2_Cell_4_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_4_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x683_BMS_M2_Cell_4_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_4_Temperature = 0; if (in > 100) return -1; o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_4_Temperature = in; return 0; } int print_can_0x683_BMS_M2_Cell_Temperature_Data_1(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M2_Cell_1_Temperature = (wire: %.0f)\n", (double)(o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_1_Temperature))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_2_Temperature = (wire: %.0f)\n", (double)(o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_2_Temperature))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_3_Temperature = (wire: %.0f)\n", (double)(o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_3_Temperature))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_4_Temperature = (wire: %.0f)\n", (double)(o->can_0x683_BMS_M2_Cell_Temperature_Data_1.BMS_M2_Cell_4_Temperature))); return r; } static int pack_can_0x684_BMS_M2_Cell_Temperature_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M2_Cell_5_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_5_Temperature)) & 0xffff; i |= x; /* BMS_M2_Cell_6_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_6_Temperature)) & 0xffff; x <<= 16; i |= x; /* BMS_M2_Cell_7_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_7_Temperature)) & 0xffff; x <<= 32; i |= x; /* BMS_M2_Cell_8_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_8_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x684_BMS_M2_Cell_Temperature_Data_2_tx = 1; return 8; } static int unpack_can_0x684_BMS_M2_Cell_Temperature_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M2_Cell_5_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_5_Temperature = x; /* BMS_M2_Cell_6_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_6_Temperature = x; /* BMS_M2_Cell_7_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_7_Temperature = x; /* BMS_M2_Cell_8_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_8_Temperature = x; o->can_0x684_BMS_M2_Cell_Temperature_Data_2_rx = 1; o->can_0x684_BMS_M2_Cell_Temperature_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x684_BMS_M2_Cell_5_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_5_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x684_BMS_M2_Cell_5_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_5_Temperature = 0; if (in > 100) return -1; o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_5_Temperature = in; return 0; } int decode_can_0x684_BMS_M2_Cell_6_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_6_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x684_BMS_M2_Cell_6_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_6_Temperature = 0; if (in > 100) return -1; o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_6_Temperature = in; return 0; } int decode_can_0x684_BMS_M2_Cell_7_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_7_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x684_BMS_M2_Cell_7_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_7_Temperature = 0; if (in > 100) return -1; o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_7_Temperature = in; return 0; } int decode_can_0x684_BMS_M2_Cell_8_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_8_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x684_BMS_M2_Cell_8_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_8_Temperature = 0; if (in > 100) return -1; o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_8_Temperature = in; return 0; } int print_can_0x684_BMS_M2_Cell_Temperature_Data_2(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M2_Cell_5_Temperature = (wire: %.0f)\n", (double)(o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_5_Temperature))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_6_Temperature = (wire: %.0f)\n", (double)(o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_6_Temperature))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_7_Temperature = (wire: %.0f)\n", (double)(o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_7_Temperature))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_8_Temperature = (wire: %.0f)\n", (double)(o->can_0x684_BMS_M2_Cell_Temperature_Data_2.BMS_M2_Cell_8_Temperature))); return r; } static int pack_can_0x685_BMS_M2_Cell_Temperature_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M2_Cell_9_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_9_Temperature)) & 0xffff; i |= x; /* BMS_M2_Cell_10_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_10_Temperature)) & 0xffff; x <<= 16; i |= x; /* BMS_M2_Cell_11_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_11_Temperature)) & 0xffff; x <<= 32; i |= x; /* BMS_M2_Cell_12_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_12_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x685_BMS_M2_Cell_Temperature_Data_3_tx = 1; return 8; } static int unpack_can_0x685_BMS_M2_Cell_Temperature_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M2_Cell_9_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_9_Temperature = x; /* BMS_M2_Cell_10_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_10_Temperature = x; /* BMS_M2_Cell_11_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_11_Temperature = x; /* BMS_M2_Cell_12_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_12_Temperature = x; o->can_0x685_BMS_M2_Cell_Temperature_Data_3_rx = 1; o->can_0x685_BMS_M2_Cell_Temperature_Data_3_time_stamp_rx = time_stamp; return 8; } int decode_can_0x685_BMS_M2_Cell_9_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_9_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x685_BMS_M2_Cell_9_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_9_Temperature = 0; if (in > 100) return -1; o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_9_Temperature = in; return 0; } int decode_can_0x685_BMS_M2_Cell_10_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_10_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x685_BMS_M2_Cell_10_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_10_Temperature = 0; if (in > 100) return -1; o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_10_Temperature = in; return 0; } int decode_can_0x685_BMS_M2_Cell_11_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_11_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x685_BMS_M2_Cell_11_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_11_Temperature = 0; if (in > 100) return -1; o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_11_Temperature = in; return 0; } int decode_can_0x685_BMS_M2_Cell_12_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_12_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x685_BMS_M2_Cell_12_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_12_Temperature = 0; if (in > 100) return -1; o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_12_Temperature = in; return 0; } int print_can_0x685_BMS_M2_Cell_Temperature_Data_3(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M2_Cell_9_Temperature = (wire: %.0f)\n", (double)(o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_9_Temperature))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_10_Temperature = (wire: %.0f)\n", (double)(o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_10_Temperature))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_11_Temperature = (wire: %.0f)\n", (double)(o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_11_Temperature))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_12_Temperature = (wire: %.0f)\n", (double)(o->can_0x685_BMS_M2_Cell_Temperature_Data_3.BMS_M2_Cell_12_Temperature))); return r; } static int pack_can_0x686_BMS_M3_Cell_Temperature_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M3_Cell_1_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_1_Temperature)) & 0xffff; i |= x; /* BMS_M3_Cell_2_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_2_Temperature)) & 0xffff; x <<= 16; i |= x; /* BMS_M3_Cell_3_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_3_Temperature)) & 0xffff; x <<= 32; i |= x; /* BMS_M3_Cell_4_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_4_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x686_BMS_M3_Cell_Temperature_Data_1_tx = 1; return 8; } static int unpack_can_0x686_BMS_M3_Cell_Temperature_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M3_Cell_1_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_1_Temperature = x; /* BMS_M3_Cell_2_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_2_Temperature = x; /* BMS_M3_Cell_3_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_3_Temperature = x; /* BMS_M3_Cell_4_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_4_Temperature = x; o->can_0x686_BMS_M3_Cell_Temperature_Data_1_rx = 1; o->can_0x686_BMS_M3_Cell_Temperature_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x686_BMS_M3_Cell_1_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_1_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x686_BMS_M3_Cell_1_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_1_Temperature = 0; if (in > 100) return -1; o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_1_Temperature = in; return 0; } int decode_can_0x686_BMS_M3_Cell_2_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_2_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x686_BMS_M3_Cell_2_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_2_Temperature = 0; if (in > 100) return -1; o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_2_Temperature = in; return 0; } int decode_can_0x686_BMS_M3_Cell_3_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_3_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x686_BMS_M3_Cell_3_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_3_Temperature = 0; if (in > 100) return -1; o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_3_Temperature = in; return 0; } int decode_can_0x686_BMS_M3_Cell_4_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_4_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x686_BMS_M3_Cell_4_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_4_Temperature = 0; if (in > 100) return -1; o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_4_Temperature = in; return 0; } int print_can_0x686_BMS_M3_Cell_Temperature_Data_1(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M3_Cell_1_Temperature = (wire: %.0f)\n", (double)(o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_1_Temperature))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_2_Temperature = (wire: %.0f)\n", (double)(o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_2_Temperature))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_3_Temperature = (wire: %.0f)\n", (double)(o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_3_Temperature))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_4_Temperature = (wire: %.0f)\n", (double)(o->can_0x686_BMS_M3_Cell_Temperature_Data_1.BMS_M3_Cell_4_Temperature))); return r; } static int pack_can_0x687_BMS_M3_Cell_Temperature_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M3_Cell_5_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_5_Temperature)) & 0xffff; i |= x; /* BMS_M3_Cell_6_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_6_Temperature)) & 0xffff; x <<= 16; i |= x; /* BMS_M3_Cell_7_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_7_Temperature)) & 0xffff; x <<= 32; i |= x; /* BMS_M3_Cell_8_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_8_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x687_BMS_M3_Cell_Temperature_Data_2_tx = 1; return 8; } static int unpack_can_0x687_BMS_M3_Cell_Temperature_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M3_Cell_5_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_5_Temperature = x; /* BMS_M3_Cell_6_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_6_Temperature = x; /* BMS_M3_Cell_7_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_7_Temperature = x; /* BMS_M3_Cell_8_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_8_Temperature = x; o->can_0x687_BMS_M3_Cell_Temperature_Data_2_rx = 1; o->can_0x687_BMS_M3_Cell_Temperature_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x687_BMS_M3_Cell_5_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_5_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x687_BMS_M3_Cell_5_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_5_Temperature = 0; if (in > 100) return -1; o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_5_Temperature = in; return 0; } int decode_can_0x687_BMS_M3_Cell_6_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_6_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x687_BMS_M3_Cell_6_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_6_Temperature = 0; if (in > 100) return -1; o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_6_Temperature = in; return 0; } int decode_can_0x687_BMS_M3_Cell_7_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_7_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x687_BMS_M3_Cell_7_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_7_Temperature = 0; if (in > 100) return -1; o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_7_Temperature = in; return 0; } int decode_can_0x687_BMS_M3_Cell_8_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_8_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x687_BMS_M3_Cell_8_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_8_Temperature = 0; if (in > 100) return -1; o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_8_Temperature = in; return 0; } int print_can_0x687_BMS_M3_Cell_Temperature_Data_2(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M3_Cell_5_Temperature = (wire: %.0f)\n", (double)(o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_5_Temperature))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_6_Temperature = (wire: %.0f)\n", (double)(o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_6_Temperature))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_7_Temperature = (wire: %.0f)\n", (double)(o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_7_Temperature))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_8_Temperature = (wire: %.0f)\n", (double)(o->can_0x687_BMS_M3_Cell_Temperature_Data_2.BMS_M3_Cell_8_Temperature))); return r; } static int pack_can_0x688_BMS_M3_Cell_Temperature_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M3_Cell_9_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_9_Temperature)) & 0xffff; i |= x; /* BMS_M3_Cell_10_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_10_Temperature)) & 0xffff; x <<= 16; i |= x; /* BMS_M3_Cell_11_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_11_Temperature)) & 0xffff; x <<= 32; i |= x; /* BMS_M3_Cell_12_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_12_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x688_BMS_M3_Cell_Temperature_Data_3_tx = 1; return 8; } static int unpack_can_0x688_BMS_M3_Cell_Temperature_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M3_Cell_9_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_9_Temperature = x; /* BMS_M3_Cell_10_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_10_Temperature = x; /* BMS_M3_Cell_11_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_11_Temperature = x; /* BMS_M3_Cell_12_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_12_Temperature = x; o->can_0x688_BMS_M3_Cell_Temperature_Data_3_rx = 1; o->can_0x688_BMS_M3_Cell_Temperature_Data_3_time_stamp_rx = time_stamp; return 8; } int decode_can_0x688_BMS_M3_Cell_9_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_9_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x688_BMS_M3_Cell_9_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_9_Temperature = 0; if (in > 100) return -1; o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_9_Temperature = in; return 0; } int decode_can_0x688_BMS_M3_Cell_10_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_10_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x688_BMS_M3_Cell_10_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_10_Temperature = 0; if (in > 100) return -1; o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_10_Temperature = in; return 0; } int decode_can_0x688_BMS_M3_Cell_11_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_11_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x688_BMS_M3_Cell_11_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_11_Temperature = 0; if (in > 100) return -1; o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_11_Temperature = in; return 0; } int decode_can_0x688_BMS_M3_Cell_12_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_12_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x688_BMS_M3_Cell_12_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_12_Temperature = 0; if (in > 100) return -1; o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_12_Temperature = in; return 0; } int print_can_0x688_BMS_M3_Cell_Temperature_Data_3(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M3_Cell_9_Temperature = (wire: %.0f)\n", (double)(o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_9_Temperature))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_10_Temperature = (wire: %.0f)\n", (double)(o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_10_Temperature))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_11_Temperature = (wire: %.0f)\n", (double)(o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_11_Temperature))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_12_Temperature = (wire: %.0f)\n", (double)(o->can_0x688_BMS_M3_Cell_Temperature_Data_3.BMS_M3_Cell_12_Temperature))); return r; } static int pack_can_0x689_BMS_M4_Cell_Temperature_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M4_Cell_1_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_1_Temperature)) & 0xffff; i |= x; /* BMS_M4_Cell_2_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_2_Temperature)) & 0xffff; x <<= 16; i |= x; /* BMS_M4_Cell_3_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_3_Temperature)) & 0xffff; x <<= 32; i |= x; /* BMS_M4_Cell_4_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_4_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x689_BMS_M4_Cell_Temperature_Data_1_tx = 1; return 8; } static int unpack_can_0x689_BMS_M4_Cell_Temperature_Data_1(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M4_Cell_1_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_1_Temperature = x; /* BMS_M4_Cell_2_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_2_Temperature = x; /* BMS_M4_Cell_3_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_3_Temperature = x; /* BMS_M4_Cell_4_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_4_Temperature = x; o->can_0x689_BMS_M4_Cell_Temperature_Data_1_rx = 1; o->can_0x689_BMS_M4_Cell_Temperature_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x689_BMS_M4_Cell_1_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_1_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x689_BMS_M4_Cell_1_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_1_Temperature = 0; if (in > 100) return -1; o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_1_Temperature = in; return 0; } int decode_can_0x689_BMS_M4_Cell_2_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_2_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x689_BMS_M4_Cell_2_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_2_Temperature = 0; if (in > 100) return -1; o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_2_Temperature = in; return 0; } int decode_can_0x689_BMS_M4_Cell_3_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_3_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x689_BMS_M4_Cell_3_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_3_Temperature = 0; if (in > 100) return -1; o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_3_Temperature = in; return 0; } int decode_can_0x689_BMS_M4_Cell_4_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_4_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x689_BMS_M4_Cell_4_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_4_Temperature = 0; if (in > 100) return -1; o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_4_Temperature = in; return 0; } int print_can_0x689_BMS_M4_Cell_Temperature_Data_1(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M4_Cell_1_Temperature = (wire: %.0f)\n", (double)(o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_1_Temperature))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_2_Temperature = (wire: %.0f)\n", (double)(o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_2_Temperature))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_3_Temperature = (wire: %.0f)\n", (double)(o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_3_Temperature))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_4_Temperature = (wire: %.0f)\n", (double)(o->can_0x689_BMS_M4_Cell_Temperature_Data_1.BMS_M4_Cell_4_Temperature))); return r; } static int pack_can_0x68a_BMS_M4_Cell_Temperature_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M4_Cell_5_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_5_Temperature)) & 0xffff; i |= x; /* BMS_M4_Cell_6_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_6_Temperature)) & 0xffff; x <<= 16; i |= x; /* BMS_M4_Cell_7_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_7_Temperature)) & 0xffff; x <<= 32; i |= x; /* BMS_M4_Cell_8_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_8_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x68a_BMS_M4_Cell_Temperature_Data_2_tx = 1; return 8; } static int unpack_can_0x68a_BMS_M4_Cell_Temperature_Data_2(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M4_Cell_5_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_5_Temperature = x; /* BMS_M4_Cell_6_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_6_Temperature = x; /* BMS_M4_Cell_7_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_7_Temperature = x; /* BMS_M4_Cell_8_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_8_Temperature = x; o->can_0x68a_BMS_M4_Cell_Temperature_Data_2_rx = 1; o->can_0x68a_BMS_M4_Cell_Temperature_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x68a_BMS_M4_Cell_5_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_5_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x68a_BMS_M4_Cell_5_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_5_Temperature = 0; if (in > 100) return -1; o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_5_Temperature = in; return 0; } int decode_can_0x68a_BMS_M4_Cell_6_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_6_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x68a_BMS_M4_Cell_6_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_6_Temperature = 0; if (in > 100) return -1; o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_6_Temperature = in; return 0; } int decode_can_0x68a_BMS_M4_Cell_7_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_7_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x68a_BMS_M4_Cell_7_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_7_Temperature = 0; if (in > 100) return -1; o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_7_Temperature = in; return 0; } int decode_can_0x68a_BMS_M4_Cell_8_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_8_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x68a_BMS_M4_Cell_8_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_8_Temperature = 0; if (in > 100) return -1; o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_8_Temperature = in; return 0; } int print_can_0x68a_BMS_M4_Cell_Temperature_Data_2(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M4_Cell_5_Temperature = (wire: %.0f)\n", (double)(o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_5_Temperature))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_6_Temperature = (wire: %.0f)\n", (double)(o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_6_Temperature))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_7_Temperature = (wire: %.0f)\n", (double)(o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_7_Temperature))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_8_Temperature = (wire: %.0f)\n", (double)(o->can_0x68a_BMS_M4_Cell_Temperature_Data_2.BMS_M4_Cell_8_Temperature))); return r; } static int pack_can_0x68b_BMS_M4_Cell_Temperature_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t *data) { assert(o); assert(data); register uint64_t x; register uint64_t i = 0; /* BMS_M4_Cell_9_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_9_Temperature)) & 0xffff; i |= x; /* BMS_M4_Cell_10_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_10_Temperature)) & 0xffff; x <<= 16; i |= x; /* BMS_M4_Cell_11_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_11_Temperature)) & 0xffff; x <<= 32; i |= x; /* BMS_M4_Cell_12_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_12_Temperature)) & 0xffff; x <<= 48; i |= x; *data = (i); o->can_0x68b_BMS_M4_Cell_Temperature_Data_3_tx = 1; return 8; } static int unpack_can_0x68b_BMS_M4_Cell_Temperature_Data_3(can_obj_all_sre_edited_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(dlc <= 8); register uint64_t x; register uint64_t i = (data); if (dlc < 8) return -1; /* BMS_M4_Cell_9_Temperature: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_9_Temperature = x; /* BMS_M4_Cell_10_Temperature: start-bit 16, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_10_Temperature = x; /* BMS_M4_Cell_11_Temperature: start-bit 32, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_11_Temperature = x; /* BMS_M4_Cell_12_Temperature: start-bit 48, length 16, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_12_Temperature = x; o->can_0x68b_BMS_M4_Cell_Temperature_Data_3_rx = 1; o->can_0x68b_BMS_M4_Cell_Temperature_Data_3_time_stamp_rx = time_stamp; return 8; } int decode_can_0x68b_BMS_M4_Cell_9_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_9_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x68b_BMS_M4_Cell_9_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_9_Temperature = 0; if (in > 100) return -1; o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_9_Temperature = in; return 0; } int decode_can_0x68b_BMS_M4_Cell_10_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_10_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x68b_BMS_M4_Cell_10_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_10_Temperature = 0; if (in > 100) return -1; o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_10_Temperature = in; return 0; } int decode_can_0x68b_BMS_M4_Cell_11_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_11_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x68b_BMS_M4_Cell_11_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_11_Temperature = 0; if (in > 100) return -1; o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_11_Temperature = in; return 0; } int decode_can_0x68b_BMS_M4_Cell_12_Temperature(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_12_Temperature); if (rval <= 100) { *out = rval; return 0; } else { *out = (uint16_t)0; return -1; } } int encode_can_0x68b_BMS_M4_Cell_12_Temperature(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_12_Temperature = 0; if (in > 100) return -1; o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_12_Temperature = in; return 0; } int print_can_0x68b_BMS_M4_Cell_Temperature_Data_3(const can_obj_all_sre_edited_h_t *o, FILE *output) { assert(o); assert(output); int r = 0; r = print_helper(r, fprintf(output, "BMS_M4_Cell_9_Temperature = (wire: %.0f)\n", (double)(o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_9_Temperature))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_10_Temperature = (wire: %.0f)\n", (double)(o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_10_Temperature))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_11_Temperature = (wire: %.0f)\n", (double)(o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_11_Temperature))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_12_Temperature = (wire: %.0f)\n", (double)(o->can_0x68b_BMS_M4_Cell_Temperature_Data_3.BMS_M4_Cell_12_Temperature))); return r; } int unpack_message(can_obj_all_sre_edited_h_t *o, const unsigned long id, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) { assert(o); assert(id < (1ul << 29)); /* 29-bit CAN ID is largest possible */ assert(dlc <= 8); /* Maximum of 8 bytes in a CAN packet */ switch (id) { case 0x600: return unpack_can_0x600_BMS_Safety_Checker(o, data, dlc, time_stamp); case 0x622: return unpack_can_0x622_BMS_Cell_Summary(o, data, dlc, time_stamp); case 0x630: return unpack_can_0x630_BMS_M1_Cell_Voltage_Data_1(o, data, dlc, time_stamp); case 0x631: return unpack_can_0x631_BMS_M1_Cell_Voltage_Data_2(o, data, dlc, time_stamp); case 0x632: return unpack_can_0x632_BMS_M1_Cell_Voltage_Data_3(o, data, dlc, time_stamp); case 0x633: return unpack_can_0x633_BMS_M2_Cell_Voltage_Data_1(o, data, dlc, time_stamp); case 0x634: return unpack_can_0x634_BMS_M2_Cell_Voltage_Data_2(o, data, dlc, time_stamp); case 0x635: return unpack_can_0x635_BMS_M2_Cell_Voltage_Data_3(o, data, dlc, time_stamp); case 0x636: return unpack_can_0x636_BMS_M3_Cell_Voltage_Data_1(o, data, dlc, time_stamp); case 0x637: return unpack_can_0x637_BMS_M3_Cell_Voltage_Data_2(o, data, dlc, time_stamp); case 0x638: return unpack_can_0x638_BMS_M3_Cell_Voltage_Data_3(o, data, dlc, time_stamp); case 0x639: return unpack_can_0x639_BMS_M4_Cell_Voltage_Data_1(o, data, dlc, time_stamp); case 0x63a: return unpack_can_0x63a_BMS_M4_Cell_Voltage_Data_2(o, data, dlc, time_stamp); case 0x63b: return unpack_can_0x63b_BMS_M4_Cell_Voltage_Data_3(o, data, dlc, time_stamp); case 0x63c: return unpack_can_0x63c_BMS_M5_Cell_Voltage_Data_1(o, data, dlc, time_stamp); case 0x63d: return unpack_can_0x63d_BMS_M5_Cell_Voltage_Data_2(o, data, dlc, time_stamp); case 0x63e: return unpack_can_0x63e_BMS_M5_Cell_Voltage_Data_3(o, data, dlc, time_stamp); case 0x63f: return unpack_can_0x63f_BMS_M6_Cell_Voltage_Data_1(o, data, dlc, time_stamp); case 0x640: return unpack_can_0x640_BMS_M6_Cell_Voltage_Data_2(o, data, dlc, time_stamp); case 0x641: return unpack_can_0x641_BMS_M6_Cell_Voltage_Data_3(o, data, dlc, time_stamp); case 0x642: return unpack_can_0x642_BMS_M7_Cell_Voltage_Data_1(o, data, dlc, time_stamp); case 0x643: return unpack_can_0x643_BMS_M7_Cell_Voltage_Data_2(o, data, dlc, time_stamp); case 0x644: return unpack_can_0x644_BMS_M7_Cell_Voltage_Data_3(o, data, dlc, time_stamp); case 0x645: return unpack_can_0x645_BMS_M8_Cell_Voltage_Data_1(o, data, dlc, time_stamp); case 0x646: return unpack_can_0x646_BMS_M8_Cell_Voltage_Data_2(o, data, dlc, time_stamp); case 0x647: return unpack_can_0x647_BMS_M8_Cell_Voltage_Data_3(o, data, dlc, time_stamp); case 0x680: return unpack_can_0x680_BMS_M1_Cell_Temperature_Data_1(o, data, dlc, time_stamp); case 0x681: return unpack_can_0x681_BMS_M1_Cell_Temperature_Data_2(o, data, dlc, time_stamp); case 0x682: return unpack_can_0x682_BMS_M1_Cell_Temperature_Data_3(o, data, dlc, time_stamp); case 0x683: return unpack_can_0x683_BMS_M2_Cell_Temperature_Data_1(o, data, dlc, time_stamp); case 0x684: return unpack_can_0x684_BMS_M2_Cell_Temperature_Data_2(o, data, dlc, time_stamp); case 0x685: return unpack_can_0x685_BMS_M2_Cell_Temperature_Data_3(o, data, dlc, time_stamp); case 0x686: return unpack_can_0x686_BMS_M3_Cell_Temperature_Data_1(o, data, dlc, time_stamp); case 0x687: return unpack_can_0x687_BMS_M3_Cell_Temperature_Data_2(o, data, dlc, time_stamp); case 0x688: return unpack_can_0x688_BMS_M3_Cell_Temperature_Data_3(o, data, dlc, time_stamp); case 0x689: return unpack_can_0x689_BMS_M4_Cell_Temperature_Data_1(o, data, dlc, time_stamp); case 0x68a: return unpack_can_0x68a_BMS_M4_Cell_Temperature_Data_2(o, data, dlc, time_stamp); case 0x68b: return unpack_can_0x68b_BMS_M4_Cell_Temperature_Data_3(o, data, dlc, time_stamp); default: break; } return -1; } int pack_message(can_obj_all_sre_edited_h_t *o, const unsigned long id, uint64_t *data) { assert(o); assert(id < (1ul << 29)); /* 29-bit CAN ID is largest possible */ switch (id) { case 0x600: return pack_can_0x600_BMS_Safety_Checker(o, data); case 0x622: return pack_can_0x622_BMS_Cell_Summary(o, data); case 0x630: return pack_can_0x630_BMS_M1_Cell_Voltage_Data_1(o, data); case 0x631: return pack_can_0x631_BMS_M1_Cell_Voltage_Data_2(o, data); case 0x632: return pack_can_0x632_BMS_M1_Cell_Voltage_Data_3(o, data); case 0x633: return pack_can_0x633_BMS_M2_Cell_Voltage_Data_1(o, data); case 0x634: return pack_can_0x634_BMS_M2_Cell_Voltage_Data_2(o, data); case 0x635: return pack_can_0x635_BMS_M2_Cell_Voltage_Data_3(o, data); case 0x636: return pack_can_0x636_BMS_M3_Cell_Voltage_Data_1(o, data); case 0x637: return pack_can_0x637_BMS_M3_Cell_Voltage_Data_2(o, data); case 0x638: return pack_can_0x638_BMS_M3_Cell_Voltage_Data_3(o, data); case 0x639: return pack_can_0x639_BMS_M4_Cell_Voltage_Data_1(o, data); case 0x63a: return pack_can_0x63a_BMS_M4_Cell_Voltage_Data_2(o, data); case 0x63b: return pack_can_0x63b_BMS_M4_Cell_Voltage_Data_3(o, data); case 0x63c: return pack_can_0x63c_BMS_M5_Cell_Voltage_Data_1(o, data); case 0x63d: return pack_can_0x63d_BMS_M5_Cell_Voltage_Data_2(o, data); case 0x63e: return pack_can_0x63e_BMS_M5_Cell_Voltage_Data_3(o, data); case 0x63f: return pack_can_0x63f_BMS_M6_Cell_Voltage_Data_1(o, data); case 0x640: return pack_can_0x640_BMS_M6_Cell_Voltage_Data_2(o, data); case 0x641: return pack_can_0x641_BMS_M6_Cell_Voltage_Data_3(o, data); case 0x642: return pack_can_0x642_BMS_M7_Cell_Voltage_Data_1(o, data); case 0x643: return pack_can_0x643_BMS_M7_Cell_Voltage_Data_2(o, data); case 0x644: return pack_can_0x644_BMS_M7_Cell_Voltage_Data_3(o, data); case 0x645: return pack_can_0x645_BMS_M8_Cell_Voltage_Data_1(o, data); case 0x646: return pack_can_0x646_BMS_M8_Cell_Voltage_Data_2(o, data); case 0x647: return pack_can_0x647_BMS_M8_Cell_Voltage_Data_3(o, data); case 0x680: return pack_can_0x680_BMS_M1_Cell_Temperature_Data_1(o, data); case 0x681: return pack_can_0x681_BMS_M1_Cell_Temperature_Data_2(o, data); case 0x682: return pack_can_0x682_BMS_M1_Cell_Temperature_Data_3(o, data); case 0x683: return pack_can_0x683_BMS_M2_Cell_Temperature_Data_1(o, data); case 0x684: return pack_can_0x684_BMS_M2_Cell_Temperature_Data_2(o, data); case 0x685: return pack_can_0x685_BMS_M2_Cell_Temperature_Data_3(o, data); case 0x686: return pack_can_0x686_BMS_M3_Cell_Temperature_Data_1(o, data); case 0x687: return pack_can_0x687_BMS_M3_Cell_Temperature_Data_2(o, data); case 0x688: return pack_can_0x688_BMS_M3_Cell_Temperature_Data_3(o, data); case 0x689: return pack_can_0x689_BMS_M4_Cell_Temperature_Data_1(o, data); case 0x68a: return pack_can_0x68a_BMS_M4_Cell_Temperature_Data_2(o, data); case 0x68b: return pack_can_0x68b_BMS_M4_Cell_Temperature_Data_3(o, data); default: break; } return -1; } int print_message(const can_obj_all_sre_edited_h_t *o, const unsigned long id, FILE *output) { assert(o); assert(id < (1ul << 29)); /* 29-bit CAN ID is largest possible */ assert(output); switch (id) { case 0x600: return print_can_0x600_BMS_Safety_Checker(o, output); case 0x622: return print_can_0x622_BMS_Cell_Summary(o, output); case 0x630: return print_can_0x630_BMS_M1_Cell_Voltage_Data_1(o, output); case 0x631: return print_can_0x631_BMS_M1_Cell_Voltage_Data_2(o, output); case 0x632: return print_can_0x632_BMS_M1_Cell_Voltage_Data_3(o, output); case 0x633: return print_can_0x633_BMS_M2_Cell_Voltage_Data_1(o, output); case 0x634: return print_can_0x634_BMS_M2_Cell_Voltage_Data_2(o, output); case 0x635: return print_can_0x635_BMS_M2_Cell_Voltage_Data_3(o, output); case 0x636: return print_can_0x636_BMS_M3_Cell_Voltage_Data_1(o, output); case 0x637: return print_can_0x637_BMS_M3_Cell_Voltage_Data_2(o, output); case 0x638: return print_can_0x638_BMS_M3_Cell_Voltage_Data_3(o, output); case 0x639: return print_can_0x639_BMS_M4_Cell_Voltage_Data_1(o, output); case 0x63a: return print_can_0x63a_BMS_M4_Cell_Voltage_Data_2(o, output); case 0x63b: return print_can_0x63b_BMS_M4_Cell_Voltage_Data_3(o, output); case 0x63c: return print_can_0x63c_BMS_M5_Cell_Voltage_Data_1(o, output); case 0x63d: return print_can_0x63d_BMS_M5_Cell_Voltage_Data_2(o, output); case 0x63e: return print_can_0x63e_BMS_M5_Cell_Voltage_Data_3(o, output); case 0x63f: return print_can_0x63f_BMS_M6_Cell_Voltage_Data_1(o, output); case 0x640: return print_can_0x640_BMS_M6_Cell_Voltage_Data_2(o, output); case 0x641: return print_can_0x641_BMS_M6_Cell_Voltage_Data_3(o, output); case 0x642: return print_can_0x642_BMS_M7_Cell_Voltage_Data_1(o, output); case 0x643: return print_can_0x643_BMS_M7_Cell_Voltage_Data_2(o, output); case 0x644: return print_can_0x644_BMS_M7_Cell_Voltage_Data_3(o, output); case 0x645: return print_can_0x645_BMS_M8_Cell_Voltage_Data_1(o, output); case 0x646: return print_can_0x646_BMS_M8_Cell_Voltage_Data_2(o, output); case 0x647: return print_can_0x647_BMS_M8_Cell_Voltage_Data_3(o, output); case 0x680: return print_can_0x680_BMS_M1_Cell_Temperature_Data_1(o, output); case 0x681: return print_can_0x681_BMS_M1_Cell_Temperature_Data_2(o, output); case 0x682: return print_can_0x682_BMS_M1_Cell_Temperature_Data_3(o, output); case 0x683: return print_can_0x683_BMS_M2_Cell_Temperature_Data_1(o, output); case 0x684: return print_can_0x684_BMS_M2_Cell_Temperature_Data_2(o, output); case 0x685: return print_can_0x685_BMS_M2_Cell_Temperature_Data_3(o, output); case 0x686: return print_can_0x686_BMS_M3_Cell_Temperature_Data_1(o, output); case 0x687: return print_can_0x687_BMS_M3_Cell_Temperature_Data_2(o, output); case 0x688: return print_can_0x688_BMS_M3_Cell_Temperature_Data_3(o, output); case 0x689: return print_can_0x689_BMS_M4_Cell_Temperature_Data_1(o, output); case 0x68a: return print_can_0x68a_BMS_M4_Cell_Temperature_Data_2(o, output); case 0x68b: return print_can_0x68b_BMS_M4_Cell_Temperature_Data_3(o, output); default: break; } return -1; }