/* 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; /* BMS_Cell_Max_Min_Difference: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Max_Min_Difference)) & 0xffff; x <<= 16; i |= x; /* BMS_HVsens_Pack_Voltage: start-bit 32, length 16, endianess intel, scaling 0.01, offset 0 */ x = ((uint16_t)(o->can_0x600_BMS_Safety_Checker.BMS_HVsens_Pack_Voltage)) & 0xffff; x <<= 32; i |= x; /* BMS_Sum_Pack_Voltage: start-bit 48, length 16, endianess intel, scaling 0.01, offset 0 */ x = ((uint16_t)(o->can_0x600_BMS_Safety_Checker.BMS_Sum_Pack_Voltage)) & 0xffff; x <<= 48; i |= x; /* BMS_Cell_High_Temp_Warning: start-bit 2, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Temp_Warning)) & 0x1; x <<= 2; i |= x; /* BMS_Cell_Volt_Imbalance_Warning: start-bit 3, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Volt_Imbalance_Warning)) & 0x1; x <<= 3; i |= x; /* BMS_Cell_Low_Volt_Warning: start-bit 4, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Low_Volt_Warning)) & 0x1; x <<= 4; i |= x; /* BMS_Cell_High_Volt_Warning: start-bit 5, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Volt_Warning)) & 0x1; x <<= 5; i |= x; /* BMS_Pack_Low_Volt_Warning: start-bit 6, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Pack_Low_Volt_Warning)) & 0x1; x <<= 6; i |= x; /* BMS_Pack_High_Volt_Warning: start-bit 7, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Pack_High_Volt_Warning)) & 0x1; x <<= 7; i |= x; /* BMS_Cell_High_Temp_Fault: start-bit 10, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Temp_Fault)) & 0x1; x <<= 10; i |= x; /* BMS_Cell_Volt_Imbalance_Fault: start-bit 11, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Volt_Imbalance_Fault)) & 0x1; x <<= 11; i |= x; /* BMS_Cell_Low_Volt_Fault: start-bit 12, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Low_Volt_Fault)) & 0x1; x <<= 12; i |= x; /* BMS_Cell_High_Volt_Fault: start-bit 13, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Volt_Fault)) & 0x1; x <<= 13; i |= x; /* BMS_Pack_Low_Volt_Fault: start-bit 14, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Pack_Low_Volt_Fault)) & 0x1; x <<= 14; i |= x; /* BMS_Pack_High_Volt_Fault: start-bit 15, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Pack_High_Volt_Fault)) & 0x1; x <<= 15; 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; /* BMS_Cell_Max_Min_Difference: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = (i >> 16) & 0xffff; o->can_0x600_BMS_Safety_Checker.BMS_Cell_Max_Min_Difference = x; /* BMS_HVsens_Pack_Voltage: start-bit 32, length 16, endianess intel, scaling 0.01, offset 0 */ x = (i >> 32) & 0xffff; o->can_0x600_BMS_Safety_Checker.BMS_HVsens_Pack_Voltage = x; /* BMS_Sum_Pack_Voltage: start-bit 48, length 16, endianess intel, scaling 0.01, offset 0 */ x = (i >> 48) & 0xffff; o->can_0x600_BMS_Safety_Checker.BMS_Sum_Pack_Voltage = x; /* BMS_Cell_High_Temp_Warning: start-bit 2, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 2) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Temp_Warning = x; /* BMS_Cell_Volt_Imbalance_Warning: start-bit 3, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 3) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x600_BMS_Safety_Checker.BMS_Cell_Volt_Imbalance_Warning = x; /* BMS_Cell_Low_Volt_Warning: start-bit 4, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 4) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x600_BMS_Safety_Checker.BMS_Cell_Low_Volt_Warning = x; /* BMS_Cell_High_Volt_Warning: start-bit 5, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 5) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Volt_Warning = x; /* BMS_Pack_Low_Volt_Warning: start-bit 6, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 6) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x600_BMS_Safety_Checker.BMS_Pack_Low_Volt_Warning = x; /* BMS_Pack_High_Volt_Warning: start-bit 7, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 7) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x600_BMS_Safety_Checker.BMS_Pack_High_Volt_Warning = x; /* BMS_Cell_High_Temp_Fault: start-bit 10, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 10) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Temp_Fault = x; /* BMS_Cell_Volt_Imbalance_Fault: start-bit 11, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 11) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x600_BMS_Safety_Checker.BMS_Cell_Volt_Imbalance_Fault = x; /* BMS_Cell_Low_Volt_Fault: start-bit 12, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 12) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x600_BMS_Safety_Checker.BMS_Cell_Low_Volt_Fault = x; /* BMS_Cell_High_Volt_Fault: start-bit 13, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 13) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Volt_Fault = x; /* BMS_Pack_Low_Volt_Fault: start-bit 14, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 14) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x600_BMS_Safety_Checker.BMS_Pack_Low_Volt_Fault = x; /* BMS_Pack_High_Volt_Fault: start-bit 15, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 15) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x600_BMS_Safety_Checker.BMS_Pack_High_Volt_Fault = 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_BMS_Cell_Max_Min_Difference(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Max_Min_Difference); rval *= 0.0001; if (rval <= 6.5535) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x600_BMS_Cell_Max_Min_Difference(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Cell_Max_Min_Difference = 0; if (in > 6.5535) return -1; in *= 10000; o->can_0x600_BMS_Safety_Checker.BMS_Cell_Max_Min_Difference = in; return 0; } int decode_can_0x600_BMS_HVsens_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.BMS_HVsens_Pack_Voltage); rval *= 0.01; if (rval <= 655.35) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x600_BMS_HVsens_Pack_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_HVsens_Pack_Voltage = 0; if (in > 655.35) return -1; in *= 100; o->can_0x600_BMS_Safety_Checker.BMS_HVsens_Pack_Voltage = in; return 0; } int decode_can_0x600_BMS_Sum_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.BMS_Sum_Pack_Voltage); rval *= 0.01; if (rval <= 655.35) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x600_BMS_Sum_Pack_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Sum_Pack_Voltage = 0; if (in > 655.35) return -1; in *= 100; o->can_0x600_BMS_Safety_Checker.BMS_Sum_Pack_Voltage = in; return 0; } int decode_can_0x600_BMS_Cell_High_Temp_Warning(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Temp_Warning); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x600_BMS_Cell_High_Temp_Warning(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Temp_Warning = 0; if (in < 0) return -1; o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Temp_Warning = in; return 0; } int decode_can_0x600_BMS_Cell_Volt_Imbalance_Warning(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Volt_Imbalance_Warning); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x600_BMS_Cell_Volt_Imbalance_Warning(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Cell_Volt_Imbalance_Warning = 0; if (in < 0) return -1; o->can_0x600_BMS_Safety_Checker.BMS_Cell_Volt_Imbalance_Warning = in; return 0; } int decode_can_0x600_BMS_Cell_Low_Volt_Warning(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Low_Volt_Warning); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x600_BMS_Cell_Low_Volt_Warning(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Cell_Low_Volt_Warning = 0; if (in < 0) return -1; o->can_0x600_BMS_Safety_Checker.BMS_Cell_Low_Volt_Warning = in; return 0; } int decode_can_0x600_BMS_Cell_High_Volt_Warning(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Volt_Warning); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x600_BMS_Cell_High_Volt_Warning(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Volt_Warning = 0; if (in < 0) return -1; o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Volt_Warning = in; return 0; } int decode_can_0x600_BMS_Pack_Low_Volt_Warning(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Pack_Low_Volt_Warning); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x600_BMS_Pack_Low_Volt_Warning(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Pack_Low_Volt_Warning = 0; if (in < 0) return -1; o->can_0x600_BMS_Safety_Checker.BMS_Pack_Low_Volt_Warning = in; return 0; } int decode_can_0x600_BMS_Pack_High_Volt_Warning(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Pack_High_Volt_Warning); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x600_BMS_Pack_High_Volt_Warning(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Pack_High_Volt_Warning = 0; if (in < 0) return -1; o->can_0x600_BMS_Safety_Checker.BMS_Pack_High_Volt_Warning = in; return 0; } int decode_can_0x600_BMS_Cell_High_Temp_Fault(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Temp_Fault); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x600_BMS_Cell_High_Temp_Fault(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Temp_Fault = 0; if (in < 0) return -1; o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Temp_Fault = in; return 0; } int decode_can_0x600_BMS_Cell_Volt_Imbalance_Fault(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Volt_Imbalance_Fault); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x600_BMS_Cell_Volt_Imbalance_Fault(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Cell_Volt_Imbalance_Fault = 0; if (in < 0) return -1; o->can_0x600_BMS_Safety_Checker.BMS_Cell_Volt_Imbalance_Fault = in; return 0; } int decode_can_0x600_BMS_Cell_Low_Volt_Fault(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Low_Volt_Fault); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x600_BMS_Cell_Low_Volt_Fault(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Cell_Low_Volt_Fault = 0; if (in < 0) return -1; o->can_0x600_BMS_Safety_Checker.BMS_Cell_Low_Volt_Fault = in; return 0; } int decode_can_0x600_BMS_Cell_High_Volt_Fault(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Volt_Fault); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x600_BMS_Cell_High_Volt_Fault(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Volt_Fault = 0; if (in < 0) return -1; o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Volt_Fault = in; return 0; } int decode_can_0x600_BMS_Pack_Low_Volt_Fault(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Pack_Low_Volt_Fault); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x600_BMS_Pack_Low_Volt_Fault(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Pack_Low_Volt_Fault = 0; if (in < 0) return -1; o->can_0x600_BMS_Safety_Checker.BMS_Pack_Low_Volt_Fault = in; return 0; } int decode_can_0x600_BMS_Pack_High_Volt_Fault(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x600_BMS_Safety_Checker.BMS_Pack_High_Volt_Fault); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x600_BMS_Pack_High_Volt_Fault(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x600_BMS_Safety_Checker.BMS_Pack_High_Volt_Fault = 0; if (in < 0) return -1; o->can_0x600_BMS_Safety_Checker.BMS_Pack_High_Volt_Fault = 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, "BMS_Cell_Max_Min_Difference = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Max_Min_Difference))); r = print_helper(r, fprintf(output, "BMS_HVsens_Pack_Voltage = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_HVsens_Pack_Voltage))); r = print_helper(r, fprintf(output, "BMS_Sum_Pack_Voltage = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Sum_Pack_Voltage))); r = print_helper(r, fprintf(output, "BMS_Cell_High_Temp_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Temp_Warning))); r = print_helper(r, fprintf(output, "BMS_Cell_Volt_Imbalance_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Volt_Imbalance_Warning))); r = print_helper(r, fprintf(output, "BMS_Cell_Low_Volt_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Low_Volt_Warning))); r = print_helper(r, fprintf(output, "BMS_Cell_High_Volt_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Volt_Warning))); r = print_helper(r, fprintf(output, "BMS_Pack_Low_Volt_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Pack_Low_Volt_Warning))); r = print_helper(r, fprintf(output, "BMS_Pack_High_Volt_Warning = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Pack_High_Volt_Warning))); r = print_helper(r, fprintf(output, "BMS_Cell_High_Temp_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Temp_Fault))); r = print_helper(r, fprintf(output, "BMS_Cell_Volt_Imbalance_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Volt_Imbalance_Fault))); r = print_helper(r, fprintf(output, "BMS_Cell_Low_Volt_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_Low_Volt_Fault))); r = print_helper(r, fprintf(output, "BMS_Cell_High_Volt_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Cell_High_Volt_Fault))); r = print_helper(r, fprintf(output, "BMS_Pack_Low_Volt_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Pack_Low_Volt_Fault))); r = print_helper(r, fprintf(output, "BMS_Pack_High_Volt_Fault = (wire: %.0f)\n", (double)(o->can_0x600_BMS_Safety_Checker.BMS_Pack_High_Volt_Fault))); return r; } static int pack_can_0x604_BMS_Balance_Enable(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_Balance_Enable: start-bit 0, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x604_BMS_Balance_Enable.BMS_Balance_Enable)) & 0x1; i |= x; *data = (i); o->can_0x604_BMS_Balance_Enable_tx = 1; return 1; } static int unpack_can_0x604_BMS_Balance_Enable(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 < 1) return -1; /* BMS_Balance_Enable: start-bit 0, length 1, endianess intel, scaling 1, offset 0 */ x = i & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x604_BMS_Balance_Enable.BMS_Balance_Enable = x; o->can_0x604_BMS_Balance_Enable_rx = 1; o->can_0x604_BMS_Balance_Enable_time_stamp_rx = time_stamp; return 1; } int decode_can_0x604_BMS_Balance_Enable(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x604_BMS_Balance_Enable.BMS_Balance_Enable); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x604_BMS_Balance_Enable(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x604_BMS_Balance_Enable.BMS_Balance_Enable = 0; if (in < 0) return -1; o->can_0x604_BMS_Balance_Enable.BMS_Balance_Enable = in; return 0; } int print_can_0x604_BMS_Balance_Enable(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_Balance_Enable = (wire: %.0f)\n", (double)(o->can_0x604_BMS_Balance_Enable.BMS_Balance_Enable))); return r; } static int pack_can_0x621_BMS_State_of_Charge(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_Current: start-bit 24, length 32, endianess intel, scaling 1, offset 0 */ x = ((uint32_t)(o->can_0x621_BMS_State_of_Charge.BMS_Current)) & 0xffffffff; x <<= 24; i |= x; /* BMS_Capacity: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = ((uint16_t)(o->can_0x621_BMS_State_of_Charge.BMS_Capacity)) & 0xffff; i |= x; /* BMS_Percent: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x621_BMS_State_of_Charge.BMS_Percent)) & 0xff; x <<= 16; i |= x; *data = (i); o->can_0x621_BMS_State_of_Charge_tx = 1; return 7; } static int unpack_can_0x621_BMS_State_of_Charge(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 < 7) return -1; /* BMS_Current: start-bit 24, length 32, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xffffffff; o->can_0x621_BMS_State_of_Charge.BMS_Current = x; /* BMS_Capacity: start-bit 0, length 16, endianess intel, scaling 1, offset 0 */ x = i & 0xffff; o->can_0x621_BMS_State_of_Charge.BMS_Capacity = x; /* BMS_Percent: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x621_BMS_State_of_Charge.BMS_Percent = x; o->can_0x621_BMS_State_of_Charge_rx = 1; o->can_0x621_BMS_State_of_Charge_time_stamp_rx = time_stamp; return 7; } int decode_can_0x621_BMS_Current(const can_obj_all_sre_edited_h_t *o, uint32_t *out) { assert(o); assert(out); uint32_t rval = (uint32_t)(o->can_0x621_BMS_State_of_Charge.BMS_Current); *out = rval; return 0; } int encode_can_0x621_BMS_Current(can_obj_all_sre_edited_h_t *o, uint32_t in) { assert(o); o->can_0x621_BMS_State_of_Charge.BMS_Current = in; return 0; } int decode_can_0x621_BMS_Capacity(const can_obj_all_sre_edited_h_t *o, uint16_t *out) { assert(o); assert(out); uint16_t rval = (uint16_t)(o->can_0x621_BMS_State_of_Charge.BMS_Capacity); *out = rval; return 0; } int encode_can_0x621_BMS_Capacity(can_obj_all_sre_edited_h_t *o, uint16_t in) { assert(o); o->can_0x621_BMS_State_of_Charge.BMS_Capacity = in; return 0; } int decode_can_0x621_BMS_Percent(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x621_BMS_State_of_Charge.BMS_Percent); *out = rval; return 0; } int encode_can_0x621_BMS_Percent(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x621_BMS_State_of_Charge.BMS_Percent = in; return 0; } int print_can_0x621_BMS_State_of_Charge(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_Current = (wire: %.0f)\n", (double)(o->can_0x621_BMS_State_of_Charge.BMS_Current))); r = print_helper(r, fprintf(output, "BMS_Capacity = (wire: %.0f)\n", (double)(o->can_0x621_BMS_State_of_Charge.BMS_Capacity))); r = print_helper(r, fprintf(output, "BMS_Percent = (wire: %.0f)\n", (double)(o->can_0x621_BMS_State_of_Charge.BMS_Percent))); 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; /* BMS_Highest_Cell_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x622_BMS_Cell_Summary.BMS_Highest_Cell_Voltage)) & 0xffff; i |= x; /* BMS_Lowest_Cell_Voltage: start-bit 16, length 16, endianess intel, scaling 0.0001, offset 0 */ x = ((uint16_t)(o->can_0x622_BMS_Cell_Summary.BMS_Lowest_Cell_Voltage)) & 0xffff; x <<= 16; i |= x; /* BMS_Higest_Cell_Temperature: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x622_BMS_Cell_Summary.BMS_Higest_Cell_Temperature)) & 0xff; x <<= 32; i |= x; /* BMS_Lowest_Cell_Temperature: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x622_BMS_Cell_Summary.BMS_Lowest_Cell_Temperature)) & 0xff; x <<= 40; i |= x; *data = (i); o->can_0x622_BMS_Cell_Summary_tx = 1; return 6; } 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 < 6) return -1; /* BMS_Highest_Cell_Voltage: start-bit 0, length 16, endianess intel, scaling 0.0001, offset 0 */ x = i & 0xffff; o->can_0x622_BMS_Cell_Summary.BMS_Highest_Cell_Voltage = x; /* BMS_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.BMS_Lowest_Cell_Voltage = x; /* BMS_Higest_Cell_Temperature: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xff; o->can_0x622_BMS_Cell_Summary.BMS_Higest_Cell_Temperature = x; /* BMS_Lowest_Cell_Temperature: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x622_BMS_Cell_Summary.BMS_Lowest_Cell_Temperature = x; o->can_0x622_BMS_Cell_Summary_rx = 1; o->can_0x622_BMS_Cell_Summary_time_stamp_rx = time_stamp; return 6; } int decode_can_0x622_BMS_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.BMS_Highest_Cell_Voltage); rval *= 0.0001; if (rval <= 6.5535) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x622_BMS_Highest_Cell_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x622_BMS_Cell_Summary.BMS_Highest_Cell_Voltage = 0; if (in > 6.5535) return -1; in *= 10000; o->can_0x622_BMS_Cell_Summary.BMS_Highest_Cell_Voltage = in; return 0; } int decode_can_0x622_BMS_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.BMS_Lowest_Cell_Voltage); rval *= 0.0001; if (rval <= 6.5535) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x622_BMS_Lowest_Cell_Voltage(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x622_BMS_Cell_Summary.BMS_Lowest_Cell_Voltage = 0; if (in > 6.5535) return -1; in *= 10000; o->can_0x622_BMS_Cell_Summary.BMS_Lowest_Cell_Voltage = in; return 0; } int decode_can_0x622_BMS_Higest_Cell_Temperature(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x622_BMS_Cell_Summary.BMS_Higest_Cell_Temperature); *out = rval; return 0; } int encode_can_0x622_BMS_Higest_Cell_Temperature(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x622_BMS_Cell_Summary.BMS_Higest_Cell_Temperature = in; return 0; } int decode_can_0x622_BMS_Lowest_Cell_Temperature(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x622_BMS_Cell_Summary.BMS_Lowest_Cell_Temperature); *out = rval; return 0; } int encode_can_0x622_BMS_Lowest_Cell_Temperature(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x622_BMS_Cell_Summary.BMS_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, "BMS_Highest_Cell_Voltage = (wire: %.0f)\n", (double)(o->can_0x622_BMS_Cell_Summary.BMS_Highest_Cell_Voltage))); r = print_helper(r, fprintf(output, "BMS_Lowest_Cell_Voltage = (wire: %.0f)\n", (double)(o->can_0x622_BMS_Cell_Summary.BMS_Lowest_Cell_Voltage))); r = print_helper(r, fprintf(output, "BMS_Higest_Cell_Temperature = (wire: %.0f)\n", (double)(o->can_0x622_BMS_Cell_Summary.BMS_Higest_Cell_Temperature))); r = print_helper(r, fprintf(output, "BMS_Lowest_Cell_Temperature = (wire: %.0f)\n", (double)(o->can_0x622_BMS_Cell_Summary.BMS_Lowest_Cell_Temperature))); return r; } static int pack_can_0x623_BMS_Balance_Status_M1_to_M4(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: start-bit 0, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_1)) & 0x1; i |= x; /* BMS_M1_Cell_2: start-bit 1, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_2)) & 0x1; x <<= 1; i |= x; /* BMS_M1_Cell_3: start-bit 2, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_3)) & 0x1; x <<= 2; i |= x; /* BMS_M1_Cell_4: start-bit 3, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_4)) & 0x1; x <<= 3; i |= x; /* BMS_M1_Cell_5: start-bit 4, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_5)) & 0x1; x <<= 4; i |= x; /* BMS_M1_Cell_6: start-bit 5, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_6)) & 0x1; x <<= 5; i |= x; /* BMS_M1_Cell_7: start-bit 6, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_7)) & 0x1; x <<= 6; i |= x; /* BMS_M1_Cell_8: start-bit 7, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_8)) & 0x1; x <<= 7; i |= x; /* BMS_M1_Cell_9: start-bit 8, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_9)) & 0x1; x <<= 8; i |= x; /* BMS_M1_Cell_10: start-bit 9, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_10)) & 0x1; x <<= 9; i |= x; /* BMS_M1_Cell_11: start-bit 10, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_11)) & 0x1; x <<= 10; i |= x; /* BMS_M1_Cell_12: start-bit 11, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_12)) & 0x1; x <<= 11; i |= x; /* BMS_M2_Cell_1: start-bit 16, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_1)) & 0x1; x <<= 16; i |= x; /* BMS_M2_Cell_2: start-bit 17, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_2)) & 0x1; x <<= 17; i |= x; /* BMS_M2_Cell_3: start-bit 18, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_3)) & 0x1; x <<= 18; i |= x; /* BMS_M2_Cell_4: start-bit 19, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_4)) & 0x1; x <<= 19; i |= x; /* BMS_M2_Cell_5: start-bit 20, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_5)) & 0x1; x <<= 20; i |= x; /* BMS_M2_Cell_6: start-bit 21, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_6)) & 0x1; x <<= 21; i |= x; /* BMS_M2_Cell_7: start-bit 22, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_7)) & 0x1; x <<= 22; i |= x; /* BMS_M2_Cell_8: start-bit 23, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_8)) & 0x1; x <<= 23; i |= x; /* BMS_M2_Cell_9: start-bit 24, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_9)) & 0x1; x <<= 24; i |= x; /* BMS_M2_Cell_10: start-bit 25, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_10)) & 0x1; x <<= 25; i |= x; /* BMS_M2_Cell_11: start-bit 26, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_11)) & 0x1; x <<= 26; i |= x; /* BMS_M2_Cell_12: start-bit 27, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_12)) & 0x1; x <<= 27; i |= x; /* BMS_M3_Cell_1: start-bit 32, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_1)) & 0x1; x <<= 32; i |= x; /* BMS_M3_Cell_2: start-bit 33, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_2)) & 0x1; x <<= 33; i |= x; /* BMS_M3_Cell_3: start-bit 34, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_3)) & 0x1; x <<= 34; i |= x; /* BMS_M3_Cell_4: start-bit 35, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_4)) & 0x1; x <<= 35; i |= x; /* BMS_M3_Cell_5: start-bit 36, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_5)) & 0x1; x <<= 36; i |= x; /* BMS_M3_Cell_6: start-bit 37, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_6)) & 0x1; x <<= 37; i |= x; /* BMS_M3_Cell_7: start-bit 38, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_7)) & 0x1; x <<= 38; i |= x; /* BMS_M3_Cell_8: start-bit 39, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_8)) & 0x1; x <<= 39; i |= x; /* BMS_M3_Cell_9: start-bit 40, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_9)) & 0x1; x <<= 40; i |= x; /* BMS_M3_Cell_10: start-bit 41, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_10)) & 0x1; x <<= 41; i |= x; /* BMS_M3_Cell_11: start-bit 42, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_11)) & 0x1; x <<= 42; i |= x; /* BMS_M3_Cell_12: start-bit 43, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_12)) & 0x1; x <<= 43; i |= x; /* BMS_M4_Cell_1: start-bit 48, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_1)) & 0x1; x <<= 48; i |= x; /* BMS_M4_Cell_2: start-bit 49, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_2)) & 0x1; x <<= 49; i |= x; /* BMS_M4_Cell_3: start-bit 50, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_3)) & 0x1; x <<= 50; i |= x; /* BMS_M4_Cell_4: start-bit 51, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_4)) & 0x1; x <<= 51; i |= x; /* BMS_M4_Cell_5: start-bit 52, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_5)) & 0x1; x <<= 52; i |= x; /* BMS_M4_Cell_6: start-bit 53, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_6)) & 0x1; x <<= 53; i |= x; /* BMS_M4_Cell_7: start-bit 54, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_7)) & 0x1; x <<= 54; i |= x; /* BMS_M4_Cell_8: start-bit 55, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_8)) & 0x1; x <<= 55; i |= x; /* BMS_M4_Cell_9: start-bit 56, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_9)) & 0x1; x <<= 56; i |= x; /* BMS_M4_Cell_10: start-bit 57, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_10)) & 0x1; x <<= 57; i |= x; /* BMS_M4_Cell_11: start-bit 58, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_11)) & 0x1; x <<= 58; i |= x; /* BMS_M4_Cell_12: start-bit 59, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_12)) & 0x1; x <<= 59; i |= x; *data = (i); o->can_0x623_BMS_Balance_Status_M1_to_M4_tx = 1; return 8; } static int unpack_can_0x623_BMS_Balance_Status_M1_to_M4(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: start-bit 0, length 1, endianess intel, scaling 1, offset 0 */ x = i & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_1 = x; /* BMS_M1_Cell_2: start-bit 1, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 1) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_2 = x; /* BMS_M1_Cell_3: start-bit 2, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 2) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_3 = x; /* BMS_M1_Cell_4: start-bit 3, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 3) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_4 = x; /* BMS_M1_Cell_5: start-bit 4, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 4) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_5 = x; /* BMS_M1_Cell_6: start-bit 5, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 5) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_6 = x; /* BMS_M1_Cell_7: start-bit 6, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 6) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_7 = x; /* BMS_M1_Cell_8: start-bit 7, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 7) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_8 = x; /* BMS_M1_Cell_9: start-bit 8, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_9 = x; /* BMS_M1_Cell_10: start-bit 9, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 9) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_10 = x; /* BMS_M1_Cell_11: start-bit 10, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 10) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_11 = x; /* BMS_M1_Cell_12: start-bit 11, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 11) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_12 = x; /* BMS_M2_Cell_1: start-bit 16, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_1 = x; /* BMS_M2_Cell_2: start-bit 17, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 17) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_2 = x; /* BMS_M2_Cell_3: start-bit 18, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 18) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_3 = x; /* BMS_M2_Cell_4: start-bit 19, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 19) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_4 = x; /* BMS_M2_Cell_5: start-bit 20, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 20) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_5 = x; /* BMS_M2_Cell_6: start-bit 21, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 21) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_6 = x; /* BMS_M2_Cell_7: start-bit 22, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 22) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_7 = x; /* BMS_M2_Cell_8: start-bit 23, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 23) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_8 = x; /* BMS_M2_Cell_9: start-bit 24, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_9 = x; /* BMS_M2_Cell_10: start-bit 25, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 25) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_10 = x; /* BMS_M2_Cell_11: start-bit 26, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 26) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_11 = x; /* BMS_M2_Cell_12: start-bit 27, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 27) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_12 = x; /* BMS_M3_Cell_1: start-bit 32, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_1 = x; /* BMS_M3_Cell_2: start-bit 33, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 33) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_2 = x; /* BMS_M3_Cell_3: start-bit 34, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 34) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_3 = x; /* BMS_M3_Cell_4: start-bit 35, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 35) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_4 = x; /* BMS_M3_Cell_5: start-bit 36, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 36) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_5 = x; /* BMS_M3_Cell_6: start-bit 37, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 37) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_6 = x; /* BMS_M3_Cell_7: start-bit 38, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 38) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_7 = x; /* BMS_M3_Cell_8: start-bit 39, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 39) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_8 = x; /* BMS_M3_Cell_9: start-bit 40, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_9 = x; /* BMS_M3_Cell_10: start-bit 41, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 41) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_10 = x; /* BMS_M3_Cell_11: start-bit 42, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 42) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_11 = x; /* BMS_M3_Cell_12: start-bit 43, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 43) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_12 = x; /* BMS_M4_Cell_1: start-bit 48, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_1 = x; /* BMS_M4_Cell_2: start-bit 49, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 49) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_2 = x; /* BMS_M4_Cell_3: start-bit 50, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 50) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_3 = x; /* BMS_M4_Cell_4: start-bit 51, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 51) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_4 = x; /* BMS_M4_Cell_5: start-bit 52, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 52) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_5 = x; /* BMS_M4_Cell_6: start-bit 53, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 53) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_6 = x; /* BMS_M4_Cell_7: start-bit 54, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 54) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_7 = x; /* BMS_M4_Cell_8: start-bit 55, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 55) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_8 = x; /* BMS_M4_Cell_9: start-bit 56, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_9 = x; /* BMS_M4_Cell_10: start-bit 57, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 57) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_10 = x; /* BMS_M4_Cell_11: start-bit 58, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 58) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_11 = x; /* BMS_M4_Cell_12: start-bit 59, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 59) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_12 = x; o->can_0x623_BMS_Balance_Status_M1_to_M4_rx = 1; o->can_0x623_BMS_Balance_Status_M1_to_M4_time_stamp_rx = time_stamp; return 8; } int decode_can_0x623_BMS_M1_Cell_1(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_1); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M1_Cell_1(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_1 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_1 = in; return 0; } int decode_can_0x623_BMS_M1_Cell_2(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_2); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M1_Cell_2(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_2 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_2 = in; return 0; } int decode_can_0x623_BMS_M1_Cell_3(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_3); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M1_Cell_3(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_3 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_3 = in; return 0; } int decode_can_0x623_BMS_M1_Cell_4(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_4); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M1_Cell_4(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_4 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_4 = in; return 0; } int decode_can_0x623_BMS_M1_Cell_5(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_5); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M1_Cell_5(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_5 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_5 = in; return 0; } int decode_can_0x623_BMS_M1_Cell_6(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_6); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M1_Cell_6(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_6 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_6 = in; return 0; } int decode_can_0x623_BMS_M1_Cell_7(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_7); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M1_Cell_7(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_7 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_7 = in; return 0; } int decode_can_0x623_BMS_M1_Cell_8(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_8); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M1_Cell_8(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_8 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_8 = in; return 0; } int decode_can_0x623_BMS_M1_Cell_9(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_9); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M1_Cell_9(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_9 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_9 = in; return 0; } int decode_can_0x623_BMS_M1_Cell_10(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_10); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M1_Cell_10(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_10 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_10 = in; return 0; } int decode_can_0x623_BMS_M1_Cell_11(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_11); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M1_Cell_11(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_11 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_11 = in; return 0; } int decode_can_0x623_BMS_M1_Cell_12(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_12); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M1_Cell_12(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_12 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_12 = in; return 0; } int decode_can_0x623_BMS_M2_Cell_1(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_1); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M2_Cell_1(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_1 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_1 = in; return 0; } int decode_can_0x623_BMS_M2_Cell_2(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_2); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M2_Cell_2(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_2 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_2 = in; return 0; } int decode_can_0x623_BMS_M2_Cell_3(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_3); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M2_Cell_3(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_3 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_3 = in; return 0; } int decode_can_0x623_BMS_M2_Cell_4(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_4); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M2_Cell_4(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_4 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_4 = in; return 0; } int decode_can_0x623_BMS_M2_Cell_5(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_5); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M2_Cell_5(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_5 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_5 = in; return 0; } int decode_can_0x623_BMS_M2_Cell_6(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_6); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M2_Cell_6(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_6 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_6 = in; return 0; } int decode_can_0x623_BMS_M2_Cell_7(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_7); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M2_Cell_7(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_7 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_7 = in; return 0; } int decode_can_0x623_BMS_M2_Cell_8(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_8); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M2_Cell_8(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_8 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_8 = in; return 0; } int decode_can_0x623_BMS_M2_Cell_9(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_9); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M2_Cell_9(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_9 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_9 = in; return 0; } int decode_can_0x623_BMS_M2_Cell_10(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_10); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M2_Cell_10(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_10 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_10 = in; return 0; } int decode_can_0x623_BMS_M2_Cell_11(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_11); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M2_Cell_11(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_11 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_11 = in; return 0; } int decode_can_0x623_BMS_M2_Cell_12(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_12); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M2_Cell_12(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_12 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_12 = in; return 0; } int decode_can_0x623_BMS_M3_Cell_1(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_1); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M3_Cell_1(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_1 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_1 = in; return 0; } int decode_can_0x623_BMS_M3_Cell_2(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_2); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M3_Cell_2(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_2 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_2 = in; return 0; } int decode_can_0x623_BMS_M3_Cell_3(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_3); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M3_Cell_3(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_3 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_3 = in; return 0; } int decode_can_0x623_BMS_M3_Cell_4(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_4); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M3_Cell_4(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_4 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_4 = in; return 0; } int decode_can_0x623_BMS_M3_Cell_5(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_5); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M3_Cell_5(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_5 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_5 = in; return 0; } int decode_can_0x623_BMS_M3_Cell_6(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_6); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M3_Cell_6(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_6 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_6 = in; return 0; } int decode_can_0x623_BMS_M3_Cell_7(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_7); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M3_Cell_7(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_7 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_7 = in; return 0; } int decode_can_0x623_BMS_M3_Cell_8(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_8); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M3_Cell_8(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_8 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_8 = in; return 0; } int decode_can_0x623_BMS_M3_Cell_9(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_9); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M3_Cell_9(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_9 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_9 = in; return 0; } int decode_can_0x623_BMS_M3_Cell_10(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_10); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M3_Cell_10(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_10 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_10 = in; return 0; } int decode_can_0x623_BMS_M3_Cell_11(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_11); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M3_Cell_11(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_11 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_11 = in; return 0; } int decode_can_0x623_BMS_M3_Cell_12(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_12); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M3_Cell_12(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_12 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_12 = in; return 0; } int decode_can_0x623_BMS_M4_Cell_1(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_1); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M4_Cell_1(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_1 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_1 = in; return 0; } int decode_can_0x623_BMS_M4_Cell_2(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_2); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M4_Cell_2(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_2 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_2 = in; return 0; } int decode_can_0x623_BMS_M4_Cell_3(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_3); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M4_Cell_3(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_3 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_3 = in; return 0; } int decode_can_0x623_BMS_M4_Cell_4(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_4); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M4_Cell_4(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_4 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_4 = in; return 0; } int decode_can_0x623_BMS_M4_Cell_5(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_5); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M4_Cell_5(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_5 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_5 = in; return 0; } int decode_can_0x623_BMS_M4_Cell_6(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_6); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M4_Cell_6(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_6 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_6 = in; return 0; } int decode_can_0x623_BMS_M4_Cell_7(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_7); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M4_Cell_7(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_7 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_7 = in; return 0; } int decode_can_0x623_BMS_M4_Cell_8(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_8); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M4_Cell_8(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_8 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_8 = in; return 0; } int decode_can_0x623_BMS_M4_Cell_9(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_9); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M4_Cell_9(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_9 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_9 = in; return 0; } int decode_can_0x623_BMS_M4_Cell_10(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_10); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M4_Cell_10(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_10 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_10 = in; return 0; } int decode_can_0x623_BMS_M4_Cell_11(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_11); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M4_Cell_11(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_11 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_11 = in; return 0; } int decode_can_0x623_BMS_M4_Cell_12(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_12); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x623_BMS_M4_Cell_12(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_12 = 0; if (in < 0) return -1; o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_12 = in; return 0; } int print_can_0x623_BMS_Balance_Status_M1_to_M4(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 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_1))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_2 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_2))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_3 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_3))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_4 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_4))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_5 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_5))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_6 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_6))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_7 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_7))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_8 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_8))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_9 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_9))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_10 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_10))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_11 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_11))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_12 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M1_Cell_12))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_1 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_1))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_2 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_2))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_3 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_3))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_4 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_4))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_5 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_5))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_6 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_6))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_7 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_7))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_8 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_8))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_9 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_9))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_10 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_10))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_11 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_11))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_12 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M2_Cell_12))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_1 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_1))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_2 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_2))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_3 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_3))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_4 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_4))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_5 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_5))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_6 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_6))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_7 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_7))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_8 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_8))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_9 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_9))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_10 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_10))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_11 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_11))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_12 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M3_Cell_12))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_1 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_1))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_2 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_2))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_3 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_3))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_4 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_4))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_5 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_5))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_6 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_6))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_7 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_7))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_8 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_8))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_9 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_9))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_10 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_10))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_11 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_11))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_12 = (wire: %.0f)\n", (double)(o->can_0x623_BMS_Balance_Status_M1_to_M4.BMS_M4_Cell_12))); return r; } static int pack_can_0x624_BMS_Balance_Status_M5_to_M8(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: start-bit 0, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_1)) & 0x1; i |= x; /* BMS_M5_Cell_2: start-bit 1, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_2)) & 0x1; x <<= 1; i |= x; /* BMS_M5_Cell_3: start-bit 2, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_3)) & 0x1; x <<= 2; i |= x; /* BMS_M5_Cell_4: start-bit 3, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_4)) & 0x1; x <<= 3; i |= x; /* BMS_M5_Cell_5: start-bit 4, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_5)) & 0x1; x <<= 4; i |= x; /* BMS_M5_Cell_6: start-bit 5, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_6)) & 0x1; x <<= 5; i |= x; /* BMS_M5_Cell_7: start-bit 6, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_7)) & 0x1; x <<= 6; i |= x; /* BMS_M5_Cell_8: start-bit 7, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_8)) & 0x1; x <<= 7; i |= x; /* BMS_M5_Cell_9: start-bit 8, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_9)) & 0x1; x <<= 8; i |= x; /* BMS_M5_Cell_10: start-bit 9, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_10)) & 0x1; x <<= 9; i |= x; /* BMS_M5_Cell_11: start-bit 10, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_11)) & 0x1; x <<= 10; i |= x; /* BMS_M5_Cell_12: start-bit 11, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_12)) & 0x1; x <<= 11; i |= x; /* BMS_M6_Cell_1: start-bit 16, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_1)) & 0x1; x <<= 16; i |= x; /* BMS_M6_Cell_2: start-bit 17, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_2)) & 0x1; x <<= 17; i |= x; /* BMS_M6_Cell_3: start-bit 18, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_3)) & 0x1; x <<= 18; i |= x; /* BMS_M6_Cell_4: start-bit 19, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_4)) & 0x1; x <<= 19; i |= x; /* BMS_M6_Cell_5: start-bit 20, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_5)) & 0x1; x <<= 20; i |= x; /* BMS_M6_Cell_6: start-bit 21, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_6)) & 0x1; x <<= 21; i |= x; /* BMS_M6_Cell_7: start-bit 22, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_7)) & 0x1; x <<= 22; i |= x; /* BMS_M6_Cell_8: start-bit 23, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_8)) & 0x1; x <<= 23; i |= x; /* BMS_M6_Cell_9: start-bit 24, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_9)) & 0x1; x <<= 24; i |= x; /* BMS_M6_Cell_10: start-bit 25, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_10)) & 0x1; x <<= 25; i |= x; /* BMS_M6_Cell_11: start-bit 26, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_11)) & 0x1; x <<= 26; i |= x; /* BMS_M6_Cell_12: start-bit 27, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_12)) & 0x1; x <<= 27; i |= x; /* BMS_M7_Cell_1: start-bit 32, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_1)) & 0x1; x <<= 32; i |= x; /* BMS_M7_Cell_2: start-bit 33, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_2)) & 0x1; x <<= 33; i |= x; /* BMS_M7_Cell_3: start-bit 34, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_3)) & 0x1; x <<= 34; i |= x; /* BMS_M7_Cell_4: start-bit 35, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_4)) & 0x1; x <<= 35; i |= x; /* BMS_M7_Cell_5: start-bit 36, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_5)) & 0x1; x <<= 36; i |= x; /* BMS_M7_Cell_6: start-bit 37, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_6)) & 0x1; x <<= 37; i |= x; /* BMS_M7_Cell_7: start-bit 38, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_7)) & 0x1; x <<= 38; i |= x; /* BMS_M7_Cell_8: start-bit 39, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_8)) & 0x1; x <<= 39; i |= x; /* BMS_M7_Cell_9: start-bit 40, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_9)) & 0x1; x <<= 40; i |= x; /* BMS_M7_Cell_10: start-bit 41, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_10)) & 0x1; x <<= 41; i |= x; /* BMS_M7_Cell_11: start-bit 42, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_11)) & 0x1; x <<= 42; i |= x; /* BMS_M7_Cell_12: start-bit 43, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_12)) & 0x1; x <<= 43; i |= x; /* BMS_M8_Cell_1: start-bit 48, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_1)) & 0x1; x <<= 48; i |= x; /* BMS_M8_Cell_2: start-bit 49, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_2)) & 0x1; x <<= 49; i |= x; /* BMS_M8_Cell_3: start-bit 50, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_3)) & 0x1; x <<= 50; i |= x; /* BMS_M8_Cell_4: start-bit 51, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_4)) & 0x1; x <<= 51; i |= x; /* BMS_M8_Cell_5: start-bit 52, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_5)) & 0x1; x <<= 52; i |= x; /* BMS_M8_Cell_6: start-bit 53, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_6)) & 0x1; x <<= 53; i |= x; /* BMS_M8_Cell_7: start-bit 54, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_7)) & 0x1; x <<= 54; i |= x; /* BMS_M8_Cell_8: start-bit 55, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_8)) & 0x1; x <<= 55; i |= x; /* BMS_M8_Cell_9: start-bit 56, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_9)) & 0x1; x <<= 56; i |= x; /* BMS_M8_Cell_10: start-bit 57, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_10)) & 0x1; x <<= 57; i |= x; /* BMS_M8_Cell_11: start-bit 58, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_11)) & 0x1; x <<= 58; i |= x; /* BMS_M8_Cell_12: start-bit 59, length 1, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_12)) & 0x1; x <<= 59; i |= x; *data = (i); o->can_0x624_BMS_Balance_Status_M5_to_M8_tx = 1; return 8; } static int unpack_can_0x624_BMS_Balance_Status_M5_to_M8(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: start-bit 0, length 1, endianess intel, scaling 1, offset 0 */ x = i & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_1 = x; /* BMS_M5_Cell_2: start-bit 1, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 1) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_2 = x; /* BMS_M5_Cell_3: start-bit 2, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 2) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_3 = x; /* BMS_M5_Cell_4: start-bit 3, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 3) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_4 = x; /* BMS_M5_Cell_5: start-bit 4, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 4) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_5 = x; /* BMS_M5_Cell_6: start-bit 5, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 5) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_6 = x; /* BMS_M5_Cell_7: start-bit 6, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 6) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_7 = x; /* BMS_M5_Cell_8: start-bit 7, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 7) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_8 = x; /* BMS_M5_Cell_9: start-bit 8, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_9 = x; /* BMS_M5_Cell_10: start-bit 9, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 9) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_10 = x; /* BMS_M5_Cell_11: start-bit 10, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 10) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_11 = x; /* BMS_M5_Cell_12: start-bit 11, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 11) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_12 = x; /* BMS_M6_Cell_1: start-bit 16, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_1 = x; /* BMS_M6_Cell_2: start-bit 17, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 17) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_2 = x; /* BMS_M6_Cell_3: start-bit 18, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 18) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_3 = x; /* BMS_M6_Cell_4: start-bit 19, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 19) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_4 = x; /* BMS_M6_Cell_5: start-bit 20, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 20) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_5 = x; /* BMS_M6_Cell_6: start-bit 21, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 21) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_6 = x; /* BMS_M6_Cell_7: start-bit 22, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 22) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_7 = x; /* BMS_M6_Cell_8: start-bit 23, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 23) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_8 = x; /* BMS_M6_Cell_9: start-bit 24, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_9 = x; /* BMS_M6_Cell_10: start-bit 25, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 25) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_10 = x; /* BMS_M6_Cell_11: start-bit 26, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 26) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_11 = x; /* BMS_M6_Cell_12: start-bit 27, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 27) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_12 = x; /* BMS_M7_Cell_1: start-bit 32, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_1 = x; /* BMS_M7_Cell_2: start-bit 33, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 33) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_2 = x; /* BMS_M7_Cell_3: start-bit 34, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 34) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_3 = x; /* BMS_M7_Cell_4: start-bit 35, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 35) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_4 = x; /* BMS_M7_Cell_5: start-bit 36, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 36) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_5 = x; /* BMS_M7_Cell_6: start-bit 37, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 37) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_6 = x; /* BMS_M7_Cell_7: start-bit 38, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 38) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_7 = x; /* BMS_M7_Cell_8: start-bit 39, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 39) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_8 = x; /* BMS_M7_Cell_9: start-bit 40, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_9 = x; /* BMS_M7_Cell_10: start-bit 41, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 41) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_10 = x; /* BMS_M7_Cell_11: start-bit 42, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 42) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_11 = x; /* BMS_M7_Cell_12: start-bit 43, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 43) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_12 = x; /* BMS_M8_Cell_1: start-bit 48, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_1 = x; /* BMS_M8_Cell_2: start-bit 49, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 49) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_2 = x; /* BMS_M8_Cell_3: start-bit 50, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 50) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_3 = x; /* BMS_M8_Cell_4: start-bit 51, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 51) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_4 = x; /* BMS_M8_Cell_5: start-bit 52, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 52) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_5 = x; /* BMS_M8_Cell_6: start-bit 53, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 53) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_6 = x; /* BMS_M8_Cell_7: start-bit 54, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 54) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_7 = x; /* BMS_M8_Cell_8: start-bit 55, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 55) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_8 = x; /* BMS_M8_Cell_9: start-bit 56, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_9 = x; /* BMS_M8_Cell_10: start-bit 57, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 57) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_10 = x; /* BMS_M8_Cell_11: start-bit 58, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 58) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_11 = x; /* BMS_M8_Cell_12: start-bit 59, length 1, endianess intel, scaling 1, offset 0 */ x = (i >> 59) & 0x1; x = (x & 0x1) ? (x | 0xfe) : x; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_12 = x; o->can_0x624_BMS_Balance_Status_M5_to_M8_rx = 1; o->can_0x624_BMS_Balance_Status_M5_to_M8_time_stamp_rx = time_stamp; return 8; } int decode_can_0x624_BMS_M5_Cell_1(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_1); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M5_Cell_1(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_1 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_1 = in; return 0; } int decode_can_0x624_BMS_M5_Cell_2(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_2); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M5_Cell_2(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_2 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_2 = in; return 0; } int decode_can_0x624_BMS_M5_Cell_3(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_3); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M5_Cell_3(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_3 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_3 = in; return 0; } int decode_can_0x624_BMS_M5_Cell_4(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_4); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M5_Cell_4(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_4 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_4 = in; return 0; } int decode_can_0x624_BMS_M5_Cell_5(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_5); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M5_Cell_5(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_5 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_5 = in; return 0; } int decode_can_0x624_BMS_M5_Cell_6(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_6); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M5_Cell_6(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_6 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_6 = in; return 0; } int decode_can_0x624_BMS_M5_Cell_7(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_7); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M5_Cell_7(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_7 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_7 = in; return 0; } int decode_can_0x624_BMS_M5_Cell_8(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_8); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M5_Cell_8(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_8 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_8 = in; return 0; } int decode_can_0x624_BMS_M5_Cell_9(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_9); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M5_Cell_9(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_9 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_9 = in; return 0; } int decode_can_0x624_BMS_M5_Cell_10(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_10); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M5_Cell_10(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_10 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_10 = in; return 0; } int decode_can_0x624_BMS_M5_Cell_11(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_11); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M5_Cell_11(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_11 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_11 = in; return 0; } int decode_can_0x624_BMS_M5_Cell_12(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_12); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M5_Cell_12(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_12 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_12 = in; return 0; } int decode_can_0x624_BMS_M6_Cell_1(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_1); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M6_Cell_1(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_1 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_1 = in; return 0; } int decode_can_0x624_BMS_M6_Cell_2(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_2); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M6_Cell_2(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_2 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_2 = in; return 0; } int decode_can_0x624_BMS_M6_Cell_3(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_3); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M6_Cell_3(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_3 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_3 = in; return 0; } int decode_can_0x624_BMS_M6_Cell_4(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_4); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M6_Cell_4(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_4 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_4 = in; return 0; } int decode_can_0x624_BMS_M6_Cell_5(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_5); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M6_Cell_5(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_5 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_5 = in; return 0; } int decode_can_0x624_BMS_M6_Cell_6(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_6); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M6_Cell_6(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_6 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_6 = in; return 0; } int decode_can_0x624_BMS_M6_Cell_7(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_7); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M6_Cell_7(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_7 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_7 = in; return 0; } int decode_can_0x624_BMS_M6_Cell_8(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_8); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M6_Cell_8(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_8 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_8 = in; return 0; } int decode_can_0x624_BMS_M6_Cell_9(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_9); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M6_Cell_9(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_9 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_9 = in; return 0; } int decode_can_0x624_BMS_M6_Cell_10(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_10); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M6_Cell_10(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_10 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_10 = in; return 0; } int decode_can_0x624_BMS_M6_Cell_11(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_11); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M6_Cell_11(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_11 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_11 = in; return 0; } int decode_can_0x624_BMS_M6_Cell_12(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_12); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M6_Cell_12(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_12 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_12 = in; return 0; } int decode_can_0x624_BMS_M7_Cell_1(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_1); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M7_Cell_1(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_1 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_1 = in; return 0; } int decode_can_0x624_BMS_M7_Cell_2(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_2); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M7_Cell_2(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_2 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_2 = in; return 0; } int decode_can_0x624_BMS_M7_Cell_3(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_3); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M7_Cell_3(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_3 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_3 = in; return 0; } int decode_can_0x624_BMS_M7_Cell_4(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_4); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M7_Cell_4(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_4 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_4 = in; return 0; } int decode_can_0x624_BMS_M7_Cell_5(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_5); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M7_Cell_5(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_5 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_5 = in; return 0; } int decode_can_0x624_BMS_M7_Cell_6(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_6); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M7_Cell_6(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_6 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_6 = in; return 0; } int decode_can_0x624_BMS_M7_Cell_7(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_7); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M7_Cell_7(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_7 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_7 = in; return 0; } int decode_can_0x624_BMS_M7_Cell_8(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_8); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M7_Cell_8(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_8 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_8 = in; return 0; } int decode_can_0x624_BMS_M7_Cell_9(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_9); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M7_Cell_9(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_9 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_9 = in; return 0; } int decode_can_0x624_BMS_M7_Cell_10(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_10); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M7_Cell_10(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_10 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_10 = in; return 0; } int decode_can_0x624_BMS_M7_Cell_11(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_11); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M7_Cell_11(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_11 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_11 = in; return 0; } int decode_can_0x624_BMS_M7_Cell_12(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_12); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M7_Cell_12(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_12 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_12 = in; return 0; } int decode_can_0x624_BMS_M8_Cell_1(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_1); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M8_Cell_1(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_1 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_1 = in; return 0; } int decode_can_0x624_BMS_M8_Cell_2(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_2); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M8_Cell_2(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_2 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_2 = in; return 0; } int decode_can_0x624_BMS_M8_Cell_3(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_3); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M8_Cell_3(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_3 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_3 = in; return 0; } int decode_can_0x624_BMS_M8_Cell_4(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_4); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M8_Cell_4(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_4 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_4 = in; return 0; } int decode_can_0x624_BMS_M8_Cell_5(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_5); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M8_Cell_5(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_5 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_5 = in; return 0; } int decode_can_0x624_BMS_M8_Cell_6(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_6); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M8_Cell_6(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_6 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_6 = in; return 0; } int decode_can_0x624_BMS_M8_Cell_7(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_7); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M8_Cell_7(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_7 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_7 = in; return 0; } int decode_can_0x624_BMS_M8_Cell_8(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_8); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M8_Cell_8(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_8 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_8 = in; return 0; } int decode_can_0x624_BMS_M8_Cell_9(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_9); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M8_Cell_9(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_9 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_9 = in; return 0; } int decode_can_0x624_BMS_M8_Cell_10(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_10); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M8_Cell_10(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_10 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_10 = in; return 0; } int decode_can_0x624_BMS_M8_Cell_11(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_11); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M8_Cell_11(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_11 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_11 = in; return 0; } int decode_can_0x624_BMS_M8_Cell_12(const can_obj_all_sre_edited_h_t *o, int8_t *out) { assert(o); assert(out); int8_t rval = (int8_t)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_12); if (rval >= 0) { *out = rval; return 0; } else { *out = (int8_t)0; return -1; } } int encode_can_0x624_BMS_M8_Cell_12(can_obj_all_sre_edited_h_t *o, int8_t in) { assert(o); o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_12 = 0; if (in < 0) return -1; o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_12 = in; return 0; } int print_can_0x624_BMS_Balance_Status_M5_to_M8(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 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_1))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_2 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_2))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_3 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_3))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_4 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_4))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_5 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_5))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_6 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_6))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_7 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_7))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_8 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_8))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_9 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_9))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_10 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_10))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_11 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_11))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_12 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M5_Cell_12))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_1 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_1))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_2 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_2))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_3 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_3))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_4 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_4))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_5 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_5))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_6 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_6))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_7 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_7))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_8 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_8))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_9 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_9))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_10 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_10))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_11 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_11))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_12 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M6_Cell_12))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_1 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_1))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_2 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_2))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_3 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_3))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_4 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_4))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_5 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_5))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_6 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_6))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_7 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_7))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_8 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_8))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_9 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_9))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_10 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_10))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_11 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_11))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_12 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M7_Cell_12))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_1 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_1))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_2 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_2))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_3 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_3))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_4 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_4))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_5 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_5))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_6 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_6))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_7 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_7))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_8 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_8))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_9 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_9))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_10 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_10))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_11 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_11))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_12 = (wire: %.0f)\n", (double)(o->can_0x624_BMS_Balance_Status_M5_to_M8.BMS_M8_Cell_12))); 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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 <= 6.5535) { *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 > 6.5535) 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_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_1_Thermistor)) & 0xff; i |= x; /* BMS_M1_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_2_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M1_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_3_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M1_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_4_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M1_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_5_Thermistor)) & 0xff; x <<= 32; i |= x; /* BMS_M1_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_6_Thermistor)) & 0xff; x <<= 40; i |= x; /* BMS_M1_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_7_Thermistor)) & 0xff; x <<= 48; i |= x; /* BMS_M1_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_8_Thermistor)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x680_BMS_M1_Cell_Thermistor_Data_1_tx = 1; return 8; } static int unpack_can_0x680_BMS_M1_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_1_Thermistor = x; /* BMS_M1_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_2_Thermistor = x; /* BMS_M1_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_3_Thermistor = x; /* BMS_M1_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_4_Thermistor = x; /* BMS_M1_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xff; o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_5_Thermistor = x; /* BMS_M1_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_6_Thermistor = x; /* BMS_M1_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_7_Thermistor = x; /* BMS_M1_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_8_Thermistor = x; o->can_0x680_BMS_M1_Cell_Thermistor_Data_1_rx = 1; o->can_0x680_BMS_M1_Cell_Thermistor_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x680_BMS_M1_Cell_1_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_1_Thermistor); *out = rval; return 0; } int encode_can_0x680_BMS_M1_Cell_1_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_1_Thermistor = in; return 0; } int decode_can_0x680_BMS_M1_Cell_2_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_2_Thermistor); *out = rval; return 0; } int encode_can_0x680_BMS_M1_Cell_2_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_2_Thermistor = in; return 0; } int decode_can_0x680_BMS_M1_Cell_3_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_3_Thermistor); *out = rval; return 0; } int encode_can_0x680_BMS_M1_Cell_3_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_3_Thermistor = in; return 0; } int decode_can_0x680_BMS_M1_Cell_4_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_4_Thermistor); *out = rval; return 0; } int encode_can_0x680_BMS_M1_Cell_4_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_4_Thermistor = in; return 0; } int decode_can_0x680_BMS_M1_Cell_5_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_5_Thermistor); *out = rval; return 0; } int encode_can_0x680_BMS_M1_Cell_5_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_5_Thermistor = in; return 0; } int decode_can_0x680_BMS_M1_Cell_6_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_6_Thermistor); *out = rval; return 0; } int encode_can_0x680_BMS_M1_Cell_6_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_6_Thermistor = in; return 0; } int decode_can_0x680_BMS_M1_Cell_7_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_7_Thermistor); *out = rval; return 0; } int encode_can_0x680_BMS_M1_Cell_7_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_7_Thermistor = in; return 0; } int decode_can_0x680_BMS_M1_Cell_8_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_8_Thermistor); *out = rval; return 0; } int encode_can_0x680_BMS_M1_Cell_8_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_8_Thermistor = in; return 0; } int print_can_0x680_BMS_M1_Cell_Thermistor_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_Thermistor = (wire: %.0f)\n", (double)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_1_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_2_Thermistor = (wire: %.0f)\n", (double)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_2_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_3_Thermistor = (wire: %.0f)\n", (double)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_3_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_4_Thermistor = (wire: %.0f)\n", (double)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_4_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_5_Thermistor = (wire: %.0f)\n", (double)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_5_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_6_Thermistor = (wire: %.0f)\n", (double)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_6_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_7_Thermistor = (wire: %.0f)\n", (double)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_7_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_8_Thermistor = (wire: %.0f)\n", (double)(o->can_0x680_BMS_M1_Cell_Thermistor_Data_1.BMS_M1_Cell_8_Thermistor))); return r; } static int pack_can_0x681_BMS_M1_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_9_Thermistor)) & 0xff; i |= x; /* BMS_M1_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_10_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M1_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_11_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M1_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_12_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M1_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = ((uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Pressure)) & 0xff; x <<= 32; i |= x; /* BMS_M1_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Atmosphere_Temp)) & 0xff; x <<= 40; i |= x; /* BMS_M1_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Humidity)) & 0xff; x <<= 48; i |= x; /* BMS_M1_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Dew_Point)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x681_BMS_M1_Cell_Thermistor_Data_2_tx = 1; return 8; } static int unpack_can_0x681_BMS_M1_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_9_Thermistor = x; /* BMS_M1_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_10_Thermistor = x; /* BMS_M1_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_11_Thermistor = x; /* BMS_M1_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_12_Thermistor = x; /* BMS_M1_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = (i >> 32) & 0xff; o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Pressure = x; /* BMS_M1_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Atmosphere_Temp = x; /* BMS_M1_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Humidity = x; /* BMS_M1_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Dew_Point = x; o->can_0x681_BMS_M1_Cell_Thermistor_Data_2_rx = 1; o->can_0x681_BMS_M1_Cell_Thermistor_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x681_BMS_M1_Cell_9_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_9_Thermistor); *out = rval; return 0; } int encode_can_0x681_BMS_M1_Cell_9_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_9_Thermistor = in; return 0; } int decode_can_0x681_BMS_M1_Cell_10_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_10_Thermistor); *out = rval; return 0; } int encode_can_0x681_BMS_M1_Cell_10_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_10_Thermistor = in; return 0; } int decode_can_0x681_BMS_M1_Cell_11_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_11_Thermistor); *out = rval; return 0; } int encode_can_0x681_BMS_M1_Cell_11_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_11_Thermistor = in; return 0; } int decode_can_0x681_BMS_M1_Cell_12_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_12_Thermistor); *out = rval; return 0; } int encode_can_0x681_BMS_M1_Cell_12_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_12_Thermistor = in; return 0; } int decode_can_0x681_BMS_M1_Pressure(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Pressure); rval *= 0.01; if (rval <= 2.55) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x681_BMS_M1_Pressure(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Pressure = 0; if (in > 2.55) return -1; in *= 100; o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Pressure = in; return 0; } int decode_can_0x681_BMS_M1_Atmosphere_Temp(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Atmosphere_Temp); *out = rval; return 0; } int encode_can_0x681_BMS_M1_Atmosphere_Temp(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Atmosphere_Temp = in; return 0; } int decode_can_0x681_BMS_M1_Humidity(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Humidity); *out = rval; return 0; } int encode_can_0x681_BMS_M1_Humidity(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Humidity = in; return 0; } int decode_can_0x681_BMS_M1_Dew_Point(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Dew_Point); *out = rval; return 0; } int encode_can_0x681_BMS_M1_Dew_Point(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Dew_Point = in; return 0; } int print_can_0x681_BMS_M1_Cell_Thermistor_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_9_Thermistor = (wire: %.0f)\n", (double)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_9_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_10_Thermistor = (wire: %.0f)\n", (double)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_10_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_11_Thermistor = (wire: %.0f)\n", (double)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_11_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M1_Cell_12_Thermistor = (wire: %.0f)\n", (double)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Cell_12_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M1_Pressure = (wire: %.0f)\n", (double)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Pressure))); r = print_helper(r, fprintf(output, "BMS_M1_Atmosphere_Temp = (wire: %.0f)\n", (double)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Atmosphere_Temp))); r = print_helper(r, fprintf(output, "BMS_M1_Humidity = (wire: %.0f)\n", (double)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Humidity))); r = print_helper(r, fprintf(output, "BMS_M1_Dew_Point = (wire: %.0f)\n", (double)(o->can_0x681_BMS_M1_Cell_Thermistor_Data_2.BMS_M1_Dew_Point))); return r; } static int pack_can_0x682_BMS_M2_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_1_Thermistor)) & 0xff; i |= x; /* BMS_M2_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_2_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M2_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_3_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M2_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_4_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M2_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_5_Thermistor)) & 0xff; x <<= 32; i |= x; /* BMS_M2_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_6_Thermistor)) & 0xff; x <<= 40; i |= x; /* BMS_M2_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_7_Thermistor)) & 0xff; x <<= 48; i |= x; /* BMS_M2_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_8_Thermistor)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x682_BMS_M2_Cell_Thermistor_Data_1_tx = 1; return 8; } static int unpack_can_0x682_BMS_M2_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_1_Thermistor = x; /* BMS_M2_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_2_Thermistor = x; /* BMS_M2_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_3_Thermistor = x; /* BMS_M2_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_4_Thermistor = x; /* BMS_M2_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xff; o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_5_Thermistor = x; /* BMS_M2_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_6_Thermistor = x; /* BMS_M2_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_7_Thermistor = x; /* BMS_M2_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_8_Thermistor = x; o->can_0x682_BMS_M2_Cell_Thermistor_Data_1_rx = 1; o->can_0x682_BMS_M2_Cell_Thermistor_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x682_BMS_M2_Cell_1_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_1_Thermistor); *out = rval; return 0; } int encode_can_0x682_BMS_M2_Cell_1_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_1_Thermistor = in; return 0; } int decode_can_0x682_BMS_M2_Cell_2_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_2_Thermistor); *out = rval; return 0; } int encode_can_0x682_BMS_M2_Cell_2_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_2_Thermistor = in; return 0; } int decode_can_0x682_BMS_M2_Cell_3_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_3_Thermistor); *out = rval; return 0; } int encode_can_0x682_BMS_M2_Cell_3_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_3_Thermistor = in; return 0; } int decode_can_0x682_BMS_M2_Cell_4_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_4_Thermistor); *out = rval; return 0; } int encode_can_0x682_BMS_M2_Cell_4_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_4_Thermistor = in; return 0; } int decode_can_0x682_BMS_M2_Cell_5_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_5_Thermistor); *out = rval; return 0; } int encode_can_0x682_BMS_M2_Cell_5_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_5_Thermistor = in; return 0; } int decode_can_0x682_BMS_M2_Cell_6_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_6_Thermistor); *out = rval; return 0; } int encode_can_0x682_BMS_M2_Cell_6_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_6_Thermistor = in; return 0; } int decode_can_0x682_BMS_M2_Cell_7_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_7_Thermistor); *out = rval; return 0; } int encode_can_0x682_BMS_M2_Cell_7_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_7_Thermistor = in; return 0; } int decode_can_0x682_BMS_M2_Cell_8_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_8_Thermistor); *out = rval; return 0; } int encode_can_0x682_BMS_M2_Cell_8_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_8_Thermistor = in; return 0; } int print_can_0x682_BMS_M2_Cell_Thermistor_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_Thermistor = (wire: %.0f)\n", (double)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_1_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_2_Thermistor = (wire: %.0f)\n", (double)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_2_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_3_Thermistor = (wire: %.0f)\n", (double)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_3_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_4_Thermistor = (wire: %.0f)\n", (double)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_4_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_5_Thermistor = (wire: %.0f)\n", (double)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_5_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_6_Thermistor = (wire: %.0f)\n", (double)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_6_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_7_Thermistor = (wire: %.0f)\n", (double)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_7_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_8_Thermistor = (wire: %.0f)\n", (double)(o->can_0x682_BMS_M2_Cell_Thermistor_Data_1.BMS_M2_Cell_8_Thermistor))); return r; } static int pack_can_0x683_BMS_M2_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_9_Thermistor)) & 0xff; i |= x; /* BMS_M2_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_10_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M2_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_11_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M2_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_12_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M2_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = ((uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Pressure)) & 0xff; x <<= 32; i |= x; /* BMS_M2_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Atmosphere_Temp)) & 0xff; x <<= 40; i |= x; /* BMS_M2_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Humidity)) & 0xff; x <<= 48; i |= x; /* BMS_M2_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Dew_Point)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x683_BMS_M2_Cell_Thermistor_Data_2_tx = 1; return 8; } static int unpack_can_0x683_BMS_M2_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_9_Thermistor = x; /* BMS_M2_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_10_Thermistor = x; /* BMS_M2_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_11_Thermistor = x; /* BMS_M2_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_12_Thermistor = x; /* BMS_M2_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = (i >> 32) & 0xff; o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Pressure = x; /* BMS_M2_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Atmosphere_Temp = x; /* BMS_M2_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Humidity = x; /* BMS_M2_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Dew_Point = x; o->can_0x683_BMS_M2_Cell_Thermistor_Data_2_rx = 1; o->can_0x683_BMS_M2_Cell_Thermistor_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x683_BMS_M2_Cell_9_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_9_Thermistor); *out = rval; return 0; } int encode_can_0x683_BMS_M2_Cell_9_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_9_Thermistor = in; return 0; } int decode_can_0x683_BMS_M2_Cell_10_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_10_Thermistor); *out = rval; return 0; } int encode_can_0x683_BMS_M2_Cell_10_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_10_Thermistor = in; return 0; } int decode_can_0x683_BMS_M2_Cell_11_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_11_Thermistor); *out = rval; return 0; } int encode_can_0x683_BMS_M2_Cell_11_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_11_Thermistor = in; return 0; } int decode_can_0x683_BMS_M2_Cell_12_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_12_Thermistor); *out = rval; return 0; } int encode_can_0x683_BMS_M2_Cell_12_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_12_Thermistor = in; return 0; } int decode_can_0x683_BMS_M2_Pressure(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Pressure); rval *= 0.01; if (rval <= 2.55) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x683_BMS_M2_Pressure(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Pressure = 0; if (in > 2.55) return -1; in *= 100; o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Pressure = in; return 0; } int decode_can_0x683_BMS_M2_Atmosphere_Temp(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Atmosphere_Temp); *out = rval; return 0; } int encode_can_0x683_BMS_M2_Atmosphere_Temp(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Atmosphere_Temp = in; return 0; } int decode_can_0x683_BMS_M2_Humidity(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Humidity); *out = rval; return 0; } int encode_can_0x683_BMS_M2_Humidity(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Humidity = in; return 0; } int decode_can_0x683_BMS_M2_Dew_Point(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Dew_Point); *out = rval; return 0; } int encode_can_0x683_BMS_M2_Dew_Point(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Dew_Point = in; return 0; } int print_can_0x683_BMS_M2_Cell_Thermistor_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_9_Thermistor = (wire: %.0f)\n", (double)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_9_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_10_Thermistor = (wire: %.0f)\n", (double)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_10_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_11_Thermistor = (wire: %.0f)\n", (double)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_11_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M2_Cell_12_Thermistor = (wire: %.0f)\n", (double)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Cell_12_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M2_Pressure = (wire: %.0f)\n", (double)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Pressure))); r = print_helper(r, fprintf(output, "BMS_M2_Atmosphere_Temp = (wire: %.0f)\n", (double)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Atmosphere_Temp))); r = print_helper(r, fprintf(output, "BMS_M2_Humidity = (wire: %.0f)\n", (double)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Humidity))); r = print_helper(r, fprintf(output, "BMS_M2_Dew_Point = (wire: %.0f)\n", (double)(o->can_0x683_BMS_M2_Cell_Thermistor_Data_2.BMS_M2_Dew_Point))); return r; } static int pack_can_0x684_BMS_M3_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_1_Thermistor)) & 0xff; i |= x; /* BMS_M3_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_2_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M3_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_3_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M3_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_4_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M3_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_5_Thermistor)) & 0xff; x <<= 32; i |= x; /* BMS_M3_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_6_Thermistor)) & 0xff; x <<= 40; i |= x; /* BMS_M3_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_7_Thermistor)) & 0xff; x <<= 48; i |= x; /* BMS_M3_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_8_Thermistor)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x684_BMS_M3_Cell_Thermistor_Data_1_tx = 1; return 8; } static int unpack_can_0x684_BMS_M3_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_1_Thermistor = x; /* BMS_M3_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_2_Thermistor = x; /* BMS_M3_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_3_Thermistor = x; /* BMS_M3_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_4_Thermistor = x; /* BMS_M3_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xff; o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_5_Thermistor = x; /* BMS_M3_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_6_Thermistor = x; /* BMS_M3_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_7_Thermistor = x; /* BMS_M3_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_8_Thermistor = x; o->can_0x684_BMS_M3_Cell_Thermistor_Data_1_rx = 1; o->can_0x684_BMS_M3_Cell_Thermistor_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x684_BMS_M3_Cell_1_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_1_Thermistor); *out = rval; return 0; } int encode_can_0x684_BMS_M3_Cell_1_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_1_Thermistor = in; return 0; } int decode_can_0x684_BMS_M3_Cell_2_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_2_Thermistor); *out = rval; return 0; } int encode_can_0x684_BMS_M3_Cell_2_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_2_Thermistor = in; return 0; } int decode_can_0x684_BMS_M3_Cell_3_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_3_Thermistor); *out = rval; return 0; } int encode_can_0x684_BMS_M3_Cell_3_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_3_Thermistor = in; return 0; } int decode_can_0x684_BMS_M3_Cell_4_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_4_Thermistor); *out = rval; return 0; } int encode_can_0x684_BMS_M3_Cell_4_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_4_Thermistor = in; return 0; } int decode_can_0x684_BMS_M3_Cell_5_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_5_Thermistor); *out = rval; return 0; } int encode_can_0x684_BMS_M3_Cell_5_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_5_Thermistor = in; return 0; } int decode_can_0x684_BMS_M3_Cell_6_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_6_Thermistor); *out = rval; return 0; } int encode_can_0x684_BMS_M3_Cell_6_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_6_Thermistor = in; return 0; } int decode_can_0x684_BMS_M3_Cell_7_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_7_Thermistor); *out = rval; return 0; } int encode_can_0x684_BMS_M3_Cell_7_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_7_Thermistor = in; return 0; } int decode_can_0x684_BMS_M3_Cell_8_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_8_Thermistor); *out = rval; return 0; } int encode_can_0x684_BMS_M3_Cell_8_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_8_Thermistor = in; return 0; } int print_can_0x684_BMS_M3_Cell_Thermistor_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_Thermistor = (wire: %.0f)\n", (double)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_1_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_2_Thermistor = (wire: %.0f)\n", (double)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_2_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_3_Thermistor = (wire: %.0f)\n", (double)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_3_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_4_Thermistor = (wire: %.0f)\n", (double)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_4_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_5_Thermistor = (wire: %.0f)\n", (double)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_5_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_6_Thermistor = (wire: %.0f)\n", (double)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_6_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_7_Thermistor = (wire: %.0f)\n", (double)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_7_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_8_Thermistor = (wire: %.0f)\n", (double)(o->can_0x684_BMS_M3_Cell_Thermistor_Data_1.BMS_M3_Cell_8_Thermistor))); return r; } static int pack_can_0x685_BMS_M3_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_9_Thermistor)) & 0xff; i |= x; /* BMS_M3_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_10_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M3_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_11_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M3_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_12_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M3_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = ((uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Pressure)) & 0xff; x <<= 32; i |= x; /* BMS_M3_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Atmosphere_Temp)) & 0xff; x <<= 40; i |= x; /* BMS_M3_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Humidity)) & 0xff; x <<= 48; i |= x; /* BMS_M3_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Dew_Point)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x685_BMS_M3_Cell_Thermistor_Data_2_tx = 1; return 8; } static int unpack_can_0x685_BMS_M3_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_9_Thermistor = x; /* BMS_M3_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_10_Thermistor = x; /* BMS_M3_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_11_Thermistor = x; /* BMS_M3_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_12_Thermistor = x; /* BMS_M3_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = (i >> 32) & 0xff; o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Pressure = x; /* BMS_M3_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Atmosphere_Temp = x; /* BMS_M3_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Humidity = x; /* BMS_M3_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Dew_Point = x; o->can_0x685_BMS_M3_Cell_Thermistor_Data_2_rx = 1; o->can_0x685_BMS_M3_Cell_Thermistor_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x685_BMS_M3_Cell_9_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_9_Thermistor); *out = rval; return 0; } int encode_can_0x685_BMS_M3_Cell_9_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_9_Thermistor = in; return 0; } int decode_can_0x685_BMS_M3_Cell_10_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_10_Thermistor); *out = rval; return 0; } int encode_can_0x685_BMS_M3_Cell_10_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_10_Thermistor = in; return 0; } int decode_can_0x685_BMS_M3_Cell_11_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_11_Thermistor); *out = rval; return 0; } int encode_can_0x685_BMS_M3_Cell_11_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_11_Thermistor = in; return 0; } int decode_can_0x685_BMS_M3_Cell_12_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_12_Thermistor); *out = rval; return 0; } int encode_can_0x685_BMS_M3_Cell_12_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_12_Thermistor = in; return 0; } int decode_can_0x685_BMS_M3_Pressure(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Pressure); rval *= 0.01; if (rval <= 2.55) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x685_BMS_M3_Pressure(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Pressure = 0; if (in > 2.55) return -1; in *= 100; o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Pressure = in; return 0; } int decode_can_0x685_BMS_M3_Atmosphere_Temp(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Atmosphere_Temp); *out = rval; return 0; } int encode_can_0x685_BMS_M3_Atmosphere_Temp(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Atmosphere_Temp = in; return 0; } int decode_can_0x685_BMS_M3_Humidity(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Humidity); *out = rval; return 0; } int encode_can_0x685_BMS_M3_Humidity(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Humidity = in; return 0; } int decode_can_0x685_BMS_M3_Dew_Point(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Dew_Point); *out = rval; return 0; } int encode_can_0x685_BMS_M3_Dew_Point(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Dew_Point = in; return 0; } int print_can_0x685_BMS_M3_Cell_Thermistor_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_9_Thermistor = (wire: %.0f)\n", (double)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_9_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_10_Thermistor = (wire: %.0f)\n", (double)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_10_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_11_Thermistor = (wire: %.0f)\n", (double)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_11_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M3_Cell_12_Thermistor = (wire: %.0f)\n", (double)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Cell_12_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M3_Pressure = (wire: %.0f)\n", (double)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Pressure))); r = print_helper(r, fprintf(output, "BMS_M3_Atmosphere_Temp = (wire: %.0f)\n", (double)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Atmosphere_Temp))); r = print_helper(r, fprintf(output, "BMS_M3_Humidity = (wire: %.0f)\n", (double)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Humidity))); r = print_helper(r, fprintf(output, "BMS_M3_Dew_Point = (wire: %.0f)\n", (double)(o->can_0x685_BMS_M3_Cell_Thermistor_Data_2.BMS_M3_Dew_Point))); return r; } static int pack_can_0x686_BMS_M4_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_1_Thermistor)) & 0xff; i |= x; /* BMS_M4_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_2_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M4_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_3_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M4_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_4_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M4_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_5_Thermistor)) & 0xff; x <<= 32; i |= x; /* BMS_M4_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_6_Thermistor)) & 0xff; x <<= 40; i |= x; /* BMS_M4_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_7_Thermistor)) & 0xff; x <<= 48; i |= x; /* BMS_M4_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_8_Thermistor)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x686_BMS_M4_Cell_Thermistor_Data_1_tx = 1; return 8; } static int unpack_can_0x686_BMS_M4_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_1_Thermistor = x; /* BMS_M4_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_2_Thermistor = x; /* BMS_M4_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_3_Thermistor = x; /* BMS_M4_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_4_Thermistor = x; /* BMS_M4_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xff; o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_5_Thermistor = x; /* BMS_M4_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_6_Thermistor = x; /* BMS_M4_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_7_Thermistor = x; /* BMS_M4_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_8_Thermistor = x; o->can_0x686_BMS_M4_Cell_Thermistor_Data_1_rx = 1; o->can_0x686_BMS_M4_Cell_Thermistor_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x686_BMS_M4_Cell_1_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_1_Thermistor); *out = rval; return 0; } int encode_can_0x686_BMS_M4_Cell_1_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_1_Thermistor = in; return 0; } int decode_can_0x686_BMS_M4_Cell_2_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_2_Thermistor); *out = rval; return 0; } int encode_can_0x686_BMS_M4_Cell_2_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_2_Thermistor = in; return 0; } int decode_can_0x686_BMS_M4_Cell_3_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_3_Thermistor); *out = rval; return 0; } int encode_can_0x686_BMS_M4_Cell_3_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_3_Thermistor = in; return 0; } int decode_can_0x686_BMS_M4_Cell_4_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_4_Thermistor); *out = rval; return 0; } int encode_can_0x686_BMS_M4_Cell_4_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_4_Thermistor = in; return 0; } int decode_can_0x686_BMS_M4_Cell_5_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_5_Thermistor); *out = rval; return 0; } int encode_can_0x686_BMS_M4_Cell_5_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_5_Thermistor = in; return 0; } int decode_can_0x686_BMS_M4_Cell_6_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_6_Thermistor); *out = rval; return 0; } int encode_can_0x686_BMS_M4_Cell_6_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_6_Thermistor = in; return 0; } int decode_can_0x686_BMS_M4_Cell_7_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_7_Thermistor); *out = rval; return 0; } int encode_can_0x686_BMS_M4_Cell_7_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_7_Thermistor = in; return 0; } int decode_can_0x686_BMS_M4_Cell_8_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_8_Thermistor); *out = rval; return 0; } int encode_can_0x686_BMS_M4_Cell_8_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_8_Thermistor = in; return 0; } int print_can_0x686_BMS_M4_Cell_Thermistor_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_Thermistor = (wire: %.0f)\n", (double)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_1_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_2_Thermistor = (wire: %.0f)\n", (double)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_2_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_3_Thermistor = (wire: %.0f)\n", (double)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_3_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_4_Thermistor = (wire: %.0f)\n", (double)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_4_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_5_Thermistor = (wire: %.0f)\n", (double)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_5_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_6_Thermistor = (wire: %.0f)\n", (double)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_6_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_7_Thermistor = (wire: %.0f)\n", (double)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_7_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_8_Thermistor = (wire: %.0f)\n", (double)(o->can_0x686_BMS_M4_Cell_Thermistor_Data_1.BMS_M4_Cell_8_Thermistor))); return r; } static int pack_can_0x687_BMS_M4_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_9_Thermistor)) & 0xff; i |= x; /* BMS_M4_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_10_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M4_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_11_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M4_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_12_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M4_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = ((uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Pressure)) & 0xff; x <<= 32; i |= x; /* BMS_M4_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Atmosphere_Temp)) & 0xff; x <<= 40; i |= x; /* BMS_M4_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Humidity)) & 0xff; x <<= 48; i |= x; /* BMS_M4_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Dew_Point)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x687_BMS_M4_Cell_Thermistor_Data_2_tx = 1; return 8; } static int unpack_can_0x687_BMS_M4_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_9_Thermistor = x; /* BMS_M4_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_10_Thermistor = x; /* BMS_M4_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_11_Thermistor = x; /* BMS_M4_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_12_Thermistor = x; /* BMS_M4_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = (i >> 32) & 0xff; o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Pressure = x; /* BMS_M4_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Atmosphere_Temp = x; /* BMS_M4_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Humidity = x; /* BMS_M4_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Dew_Point = x; o->can_0x687_BMS_M4_Cell_Thermistor_Data_2_rx = 1; o->can_0x687_BMS_M4_Cell_Thermistor_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x687_BMS_M4_Cell_9_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_9_Thermistor); *out = rval; return 0; } int encode_can_0x687_BMS_M4_Cell_9_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_9_Thermistor = in; return 0; } int decode_can_0x687_BMS_M4_Cell_10_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_10_Thermistor); *out = rval; return 0; } int encode_can_0x687_BMS_M4_Cell_10_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_10_Thermistor = in; return 0; } int decode_can_0x687_BMS_M4_Cell_11_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_11_Thermistor); *out = rval; return 0; } int encode_can_0x687_BMS_M4_Cell_11_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_11_Thermistor = in; return 0; } int decode_can_0x687_BMS_M4_Cell_12_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_12_Thermistor); *out = rval; return 0; } int encode_can_0x687_BMS_M4_Cell_12_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_12_Thermistor = in; return 0; } int decode_can_0x687_BMS_M4_Pressure(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Pressure); rval *= 0.01; if (rval <= 2.55) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x687_BMS_M4_Pressure(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Pressure = 0; if (in > 2.55) return -1; in *= 100; o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Pressure = in; return 0; } int decode_can_0x687_BMS_M4_Atmosphere_Temp(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Atmosphere_Temp); *out = rval; return 0; } int encode_can_0x687_BMS_M4_Atmosphere_Temp(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Atmosphere_Temp = in; return 0; } int decode_can_0x687_BMS_M4_Humidity(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Humidity); *out = rval; return 0; } int encode_can_0x687_BMS_M4_Humidity(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Humidity = in; return 0; } int decode_can_0x687_BMS_M4_Dew_Point(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Dew_Point); *out = rval; return 0; } int encode_can_0x687_BMS_M4_Dew_Point(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Dew_Point = in; return 0; } int print_can_0x687_BMS_M4_Cell_Thermistor_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_9_Thermistor = (wire: %.0f)\n", (double)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_9_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_10_Thermistor = (wire: %.0f)\n", (double)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_10_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_11_Thermistor = (wire: %.0f)\n", (double)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_11_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M4_Cell_12_Thermistor = (wire: %.0f)\n", (double)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Cell_12_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M4_Pressure = (wire: %.0f)\n", (double)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Pressure))); r = print_helper(r, fprintf(output, "BMS_M4_Atmosphere_Temp = (wire: %.0f)\n", (double)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Atmosphere_Temp))); r = print_helper(r, fprintf(output, "BMS_M4_Humidity = (wire: %.0f)\n", (double)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Humidity))); r = print_helper(r, fprintf(output, "BMS_M4_Dew_Point = (wire: %.0f)\n", (double)(o->can_0x687_BMS_M4_Cell_Thermistor_Data_2.BMS_M4_Dew_Point))); return r; } static int pack_can_0x688_BMS_M5_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_1_Thermistor)) & 0xff; i |= x; /* BMS_M5_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_2_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M5_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_3_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M5_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_4_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M5_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_5_Thermistor)) & 0xff; x <<= 32; i |= x; /* BMS_M5_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_6_Thermistor)) & 0xff; x <<= 40; i |= x; /* BMS_M5_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_7_Thermistor)) & 0xff; x <<= 48; i |= x; /* BMS_M5_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_8_Thermistor)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x688_BMS_M5_Cell_Thermistor_Data_1_tx = 1; return 8; } static int unpack_can_0x688_BMS_M5_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_1_Thermistor = x; /* BMS_M5_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_2_Thermistor = x; /* BMS_M5_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_3_Thermistor = x; /* BMS_M5_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_4_Thermistor = x; /* BMS_M5_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xff; o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_5_Thermistor = x; /* BMS_M5_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_6_Thermistor = x; /* BMS_M5_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_7_Thermistor = x; /* BMS_M5_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_8_Thermistor = x; o->can_0x688_BMS_M5_Cell_Thermistor_Data_1_rx = 1; o->can_0x688_BMS_M5_Cell_Thermistor_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x688_BMS_M5_Cell_1_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_1_Thermistor); *out = rval; return 0; } int encode_can_0x688_BMS_M5_Cell_1_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_1_Thermistor = in; return 0; } int decode_can_0x688_BMS_M5_Cell_2_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_2_Thermistor); *out = rval; return 0; } int encode_can_0x688_BMS_M5_Cell_2_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_2_Thermistor = in; return 0; } int decode_can_0x688_BMS_M5_Cell_3_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_3_Thermistor); *out = rval; return 0; } int encode_can_0x688_BMS_M5_Cell_3_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_3_Thermistor = in; return 0; } int decode_can_0x688_BMS_M5_Cell_4_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_4_Thermistor); *out = rval; return 0; } int encode_can_0x688_BMS_M5_Cell_4_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_4_Thermistor = in; return 0; } int decode_can_0x688_BMS_M5_Cell_5_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_5_Thermistor); *out = rval; return 0; } int encode_can_0x688_BMS_M5_Cell_5_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_5_Thermistor = in; return 0; } int decode_can_0x688_BMS_M5_Cell_6_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_6_Thermistor); *out = rval; return 0; } int encode_can_0x688_BMS_M5_Cell_6_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_6_Thermistor = in; return 0; } int decode_can_0x688_BMS_M5_Cell_7_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_7_Thermistor); *out = rval; return 0; } int encode_can_0x688_BMS_M5_Cell_7_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_7_Thermistor = in; return 0; } int decode_can_0x688_BMS_M5_Cell_8_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_8_Thermistor); *out = rval; return 0; } int encode_can_0x688_BMS_M5_Cell_8_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_8_Thermistor = in; return 0; } int print_can_0x688_BMS_M5_Cell_Thermistor_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_Thermistor = (wire: %.0f)\n", (double)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_1_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_2_Thermistor = (wire: %.0f)\n", (double)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_2_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_3_Thermistor = (wire: %.0f)\n", (double)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_3_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_4_Thermistor = (wire: %.0f)\n", (double)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_4_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_5_Thermistor = (wire: %.0f)\n", (double)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_5_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_6_Thermistor = (wire: %.0f)\n", (double)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_6_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_7_Thermistor = (wire: %.0f)\n", (double)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_7_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_8_Thermistor = (wire: %.0f)\n", (double)(o->can_0x688_BMS_M5_Cell_Thermistor_Data_1.BMS_M5_Cell_8_Thermistor))); return r; } static int pack_can_0x689_BMS_M5_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_9_Thermistor)) & 0xff; i |= x; /* BMS_M5_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_10_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M5_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_11_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M5_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_12_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M5_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = ((uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Pressure)) & 0xff; x <<= 32; i |= x; /* BMS_M5_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Atmosphere_Temp)) & 0xff; x <<= 40; i |= x; /* BMS_M5_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Humidity)) & 0xff; x <<= 48; i |= x; /* BMS_M5_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Dew_Point)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x689_BMS_M5_Cell_Thermistor_Data_2_tx = 1; return 8; } static int unpack_can_0x689_BMS_M5_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_9_Thermistor = x; /* BMS_M5_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_10_Thermistor = x; /* BMS_M5_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_11_Thermistor = x; /* BMS_M5_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_12_Thermistor = x; /* BMS_M5_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = (i >> 32) & 0xff; o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Pressure = x; /* BMS_M5_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Atmosphere_Temp = x; /* BMS_M5_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Humidity = x; /* BMS_M5_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Dew_Point = x; o->can_0x689_BMS_M5_Cell_Thermistor_Data_2_rx = 1; o->can_0x689_BMS_M5_Cell_Thermistor_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x689_BMS_M5_Cell_9_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_9_Thermistor); *out = rval; return 0; } int encode_can_0x689_BMS_M5_Cell_9_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_9_Thermistor = in; return 0; } int decode_can_0x689_BMS_M5_Cell_10_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_10_Thermistor); *out = rval; return 0; } int encode_can_0x689_BMS_M5_Cell_10_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_10_Thermistor = in; return 0; } int decode_can_0x689_BMS_M5_Cell_11_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_11_Thermistor); *out = rval; return 0; } int encode_can_0x689_BMS_M5_Cell_11_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_11_Thermistor = in; return 0; } int decode_can_0x689_BMS_M5_Cell_12_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_12_Thermistor); *out = rval; return 0; } int encode_can_0x689_BMS_M5_Cell_12_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_12_Thermistor = in; return 0; } int decode_can_0x689_BMS_M5_Pressure(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Pressure); rval *= 0.01; if (rval <= 2.55) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x689_BMS_M5_Pressure(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Pressure = 0; if (in > 2.55) return -1; in *= 100; o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Pressure = in; return 0; } int decode_can_0x689_BMS_M5_Atmosphere_Temp(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Atmosphere_Temp); *out = rval; return 0; } int encode_can_0x689_BMS_M5_Atmosphere_Temp(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Atmosphere_Temp = in; return 0; } int decode_can_0x689_BMS_M5_Humidity(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Humidity); *out = rval; return 0; } int encode_can_0x689_BMS_M5_Humidity(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Humidity = in; return 0; } int decode_can_0x689_BMS_M5_Dew_Point(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Dew_Point); *out = rval; return 0; } int encode_can_0x689_BMS_M5_Dew_Point(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Dew_Point = in; return 0; } int print_can_0x689_BMS_M5_Cell_Thermistor_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_9_Thermistor = (wire: %.0f)\n", (double)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_9_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_10_Thermistor = (wire: %.0f)\n", (double)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_10_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_11_Thermistor = (wire: %.0f)\n", (double)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_11_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M5_Cell_12_Thermistor = (wire: %.0f)\n", (double)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Cell_12_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M5_Pressure = (wire: %.0f)\n", (double)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Pressure))); r = print_helper(r, fprintf(output, "BMS_M5_Atmosphere_Temp = (wire: %.0f)\n", (double)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Atmosphere_Temp))); r = print_helper(r, fprintf(output, "BMS_M5_Humidity = (wire: %.0f)\n", (double)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Humidity))); r = print_helper(r, fprintf(output, "BMS_M5_Dew_Point = (wire: %.0f)\n", (double)(o->can_0x689_BMS_M5_Cell_Thermistor_Data_2.BMS_M5_Dew_Point))); return r; } static int pack_can_0x68a_BMS_M6_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_1_Thermistor)) & 0xff; i |= x; /* BMS_M6_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_2_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M6_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_3_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M6_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_4_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M6_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_5_Thermistor)) & 0xff; x <<= 32; i |= x; /* BMS_M6_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_6_Thermistor)) & 0xff; x <<= 40; i |= x; /* BMS_M6_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_7_Thermistor)) & 0xff; x <<= 48; i |= x; /* BMS_M6_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_8_Thermistor)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1_tx = 1; return 8; } static int unpack_can_0x68a_BMS_M6_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_1_Thermistor = x; /* BMS_M6_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_2_Thermistor = x; /* BMS_M6_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_3_Thermistor = x; /* BMS_M6_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_4_Thermistor = x; /* BMS_M6_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xff; o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_5_Thermistor = x; /* BMS_M6_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_6_Thermistor = x; /* BMS_M6_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_7_Thermistor = x; /* BMS_M6_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_8_Thermistor = x; o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1_rx = 1; o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x68a_BMS_M6_Cell_1_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_1_Thermistor); *out = rval; return 0; } int encode_can_0x68a_BMS_M6_Cell_1_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_1_Thermistor = in; return 0; } int decode_can_0x68a_BMS_M6_Cell_2_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_2_Thermistor); *out = rval; return 0; } int encode_can_0x68a_BMS_M6_Cell_2_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_2_Thermistor = in; return 0; } int decode_can_0x68a_BMS_M6_Cell_3_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_3_Thermistor); *out = rval; return 0; } int encode_can_0x68a_BMS_M6_Cell_3_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_3_Thermistor = in; return 0; } int decode_can_0x68a_BMS_M6_Cell_4_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_4_Thermistor); *out = rval; return 0; } int encode_can_0x68a_BMS_M6_Cell_4_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_4_Thermistor = in; return 0; } int decode_can_0x68a_BMS_M6_Cell_5_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_5_Thermistor); *out = rval; return 0; } int encode_can_0x68a_BMS_M6_Cell_5_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_5_Thermistor = in; return 0; } int decode_can_0x68a_BMS_M6_Cell_6_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_6_Thermistor); *out = rval; return 0; } int encode_can_0x68a_BMS_M6_Cell_6_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_6_Thermistor = in; return 0; } int decode_can_0x68a_BMS_M6_Cell_7_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_7_Thermistor); *out = rval; return 0; } int encode_can_0x68a_BMS_M6_Cell_7_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_7_Thermistor = in; return 0; } int decode_can_0x68a_BMS_M6_Cell_8_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_8_Thermistor); *out = rval; return 0; } int encode_can_0x68a_BMS_M6_Cell_8_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_8_Thermistor = in; return 0; } int print_can_0x68a_BMS_M6_Cell_Thermistor_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_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_1_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_2_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_2_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_3_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_3_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_4_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_4_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_5_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_5_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_6_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_6_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_7_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_7_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_8_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68a_BMS_M6_Cell_Thermistor_Data_1.BMS_M6_Cell_8_Thermistor))); return r; } static int pack_can_0x68b_BMS_M6_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_9_Thermistor)) & 0xff; i |= x; /* BMS_M6_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_10_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M6_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_11_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M6_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_12_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M6_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = ((uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Pressure)) & 0xff; x <<= 32; i |= x; /* BMS_M6_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Atmosphere_Temp)) & 0xff; x <<= 40; i |= x; /* BMS_M6_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Humidity)) & 0xff; x <<= 48; i |= x; /* BMS_M6_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Dew_Point)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2_tx = 1; return 8; } static int unpack_can_0x68b_BMS_M6_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_9_Thermistor = x; /* BMS_M6_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_10_Thermistor = x; /* BMS_M6_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_11_Thermistor = x; /* BMS_M6_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_12_Thermistor = x; /* BMS_M6_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = (i >> 32) & 0xff; o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Pressure = x; /* BMS_M6_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Atmosphere_Temp = x; /* BMS_M6_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Humidity = x; /* BMS_M6_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Dew_Point = x; o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2_rx = 1; o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x68b_BMS_M6_Cell_9_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_9_Thermistor); *out = rval; return 0; } int encode_can_0x68b_BMS_M6_Cell_9_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_9_Thermistor = in; return 0; } int decode_can_0x68b_BMS_M6_Cell_10_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_10_Thermistor); *out = rval; return 0; } int encode_can_0x68b_BMS_M6_Cell_10_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_10_Thermistor = in; return 0; } int decode_can_0x68b_BMS_M6_Cell_11_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_11_Thermistor); *out = rval; return 0; } int encode_can_0x68b_BMS_M6_Cell_11_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_11_Thermistor = in; return 0; } int decode_can_0x68b_BMS_M6_Cell_12_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_12_Thermistor); *out = rval; return 0; } int encode_can_0x68b_BMS_M6_Cell_12_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_12_Thermistor = in; return 0; } int decode_can_0x68b_BMS_M6_Pressure(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Pressure); rval *= 0.01; if (rval <= 2.55) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x68b_BMS_M6_Pressure(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Pressure = 0; if (in > 2.55) return -1; in *= 100; o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Pressure = in; return 0; } int decode_can_0x68b_BMS_M6_Atmosphere_Temp(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Atmosphere_Temp); *out = rval; return 0; } int encode_can_0x68b_BMS_M6_Atmosphere_Temp(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Atmosphere_Temp = in; return 0; } int decode_can_0x68b_BMS_M6_Humidity(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Humidity); *out = rval; return 0; } int encode_can_0x68b_BMS_M6_Humidity(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Humidity = in; return 0; } int decode_can_0x68b_BMS_M6_Dew_Point(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Dew_Point); *out = rval; return 0; } int encode_can_0x68b_BMS_M6_Dew_Point(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Dew_Point = in; return 0; } int print_can_0x68b_BMS_M6_Cell_Thermistor_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_9_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_9_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_10_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_10_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_11_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_11_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M6_Cell_12_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Cell_12_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M6_Pressure = (wire: %.0f)\n", (double)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Pressure))); r = print_helper(r, fprintf(output, "BMS_M6_Atmosphere_Temp = (wire: %.0f)\n", (double)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Atmosphere_Temp))); r = print_helper(r, fprintf(output, "BMS_M6_Humidity = (wire: %.0f)\n", (double)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Humidity))); r = print_helper(r, fprintf(output, "BMS_M6_Dew_Point = (wire: %.0f)\n", (double)(o->can_0x68b_BMS_M6_Cell_Thermistor_Data_2.BMS_M6_Dew_Point))); return r; } static int pack_can_0x68c_BMS_M7_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_1_Thermistor)) & 0xff; i |= x; /* BMS_M7_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_2_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M7_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_3_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M7_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_4_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M7_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_5_Thermistor)) & 0xff; x <<= 32; i |= x; /* BMS_M7_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_6_Thermistor)) & 0xff; x <<= 40; i |= x; /* BMS_M7_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_7_Thermistor)) & 0xff; x <<= 48; i |= x; /* BMS_M7_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_8_Thermistor)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1_tx = 1; return 8; } static int unpack_can_0x68c_BMS_M7_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_1_Thermistor = x; /* BMS_M7_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_2_Thermistor = x; /* BMS_M7_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_3_Thermistor = x; /* BMS_M7_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_4_Thermistor = x; /* BMS_M7_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xff; o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_5_Thermistor = x; /* BMS_M7_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_6_Thermistor = x; /* BMS_M7_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_7_Thermistor = x; /* BMS_M7_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_8_Thermistor = x; o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1_rx = 1; o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x68c_BMS_M7_Cell_1_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_1_Thermistor); *out = rval; return 0; } int encode_can_0x68c_BMS_M7_Cell_1_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_1_Thermistor = in; return 0; } int decode_can_0x68c_BMS_M7_Cell_2_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_2_Thermistor); *out = rval; return 0; } int encode_can_0x68c_BMS_M7_Cell_2_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_2_Thermistor = in; return 0; } int decode_can_0x68c_BMS_M7_Cell_3_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_3_Thermistor); *out = rval; return 0; } int encode_can_0x68c_BMS_M7_Cell_3_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_3_Thermistor = in; return 0; } int decode_can_0x68c_BMS_M7_Cell_4_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_4_Thermistor); *out = rval; return 0; } int encode_can_0x68c_BMS_M7_Cell_4_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_4_Thermistor = in; return 0; } int decode_can_0x68c_BMS_M7_Cell_5_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_5_Thermistor); *out = rval; return 0; } int encode_can_0x68c_BMS_M7_Cell_5_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_5_Thermistor = in; return 0; } int decode_can_0x68c_BMS_M7_Cell_6_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_6_Thermistor); *out = rval; return 0; } int encode_can_0x68c_BMS_M7_Cell_6_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_6_Thermistor = in; return 0; } int decode_can_0x68c_BMS_M7_Cell_7_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_7_Thermistor); *out = rval; return 0; } int encode_can_0x68c_BMS_M7_Cell_7_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_7_Thermistor = in; return 0; } int decode_can_0x68c_BMS_M7_Cell_8_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_8_Thermistor); *out = rval; return 0; } int encode_can_0x68c_BMS_M7_Cell_8_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_8_Thermistor = in; return 0; } int print_can_0x68c_BMS_M7_Cell_Thermistor_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_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_1_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_2_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_2_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_3_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_3_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_4_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_4_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_5_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_5_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_6_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_6_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_7_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_7_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_8_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68c_BMS_M7_Cell_Thermistor_Data_1.BMS_M7_Cell_8_Thermistor))); return r; } static int pack_can_0x68d_BMS_M7_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_9_Thermistor)) & 0xff; i |= x; /* BMS_M7_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_10_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M7_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_11_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M7_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_12_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M7_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = ((uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Pressure)) & 0xff; x <<= 32; i |= x; /* BMS_M7_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Atmosphere_Temp)) & 0xff; x <<= 40; i |= x; /* BMS_M7_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Humidity)) & 0xff; x <<= 48; i |= x; /* BMS_M7_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Dew_Point)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2_tx = 1; return 8; } static int unpack_can_0x68d_BMS_M7_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_9_Thermistor = x; /* BMS_M7_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_10_Thermistor = x; /* BMS_M7_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_11_Thermistor = x; /* BMS_M7_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_12_Thermistor = x; /* BMS_M7_Pressure: start-bit 32, length 8, endianess intel, scaling 0.01, offset 0 */ x = (i >> 32) & 0xff; o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Pressure = x; /* BMS_M7_Atmosphere_Temp: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Atmosphere_Temp = x; /* BMS_M7_Humidity: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Humidity = x; /* BMS_M7_Dew_Point: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Dew_Point = x; o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2_rx = 1; o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x68d_BMS_M7_Cell_9_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_9_Thermistor); *out = rval; return 0; } int encode_can_0x68d_BMS_M7_Cell_9_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_9_Thermistor = in; return 0; } int decode_can_0x68d_BMS_M7_Cell_10_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_10_Thermistor); *out = rval; return 0; } int encode_can_0x68d_BMS_M7_Cell_10_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_10_Thermistor = in; return 0; } int decode_can_0x68d_BMS_M7_Cell_11_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_11_Thermistor); *out = rval; return 0; } int encode_can_0x68d_BMS_M7_Cell_11_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_11_Thermistor = in; return 0; } int decode_can_0x68d_BMS_M7_Cell_12_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_12_Thermistor); *out = rval; return 0; } int encode_can_0x68d_BMS_M7_Cell_12_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_12_Thermistor = in; return 0; } int decode_can_0x68d_BMS_M7_Pressure(const can_obj_all_sre_edited_h_t *o, double *out) { assert(o); assert(out); double rval = (double)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Pressure); rval *= 0.01; if (rval <= 2.55) { *out = rval; return 0; } else { *out = (double)0; return -1; } } int encode_can_0x68d_BMS_M7_Pressure(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Pressure = 0; if (in > 2.55) return -1; in *= 100; o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Pressure = in; return 0; } int decode_can_0x68d_BMS_M7_Atmosphere_Temp(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Atmosphere_Temp); *out = rval; return 0; } int encode_can_0x68d_BMS_M7_Atmosphere_Temp(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Atmosphere_Temp = in; return 0; } int decode_can_0x68d_BMS_M7_Humidity(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Humidity); *out = rval; return 0; } int encode_can_0x68d_BMS_M7_Humidity(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Humidity = in; return 0; } int decode_can_0x68d_BMS_M7_Dew_Point(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Dew_Point); *out = rval; return 0; } int encode_can_0x68d_BMS_M7_Dew_Point(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Dew_Point = in; return 0; } int print_can_0x68d_BMS_M7_Cell_Thermistor_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_9_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_9_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_10_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_10_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_11_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_11_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M7_Cell_12_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Cell_12_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M7_Pressure = (wire: %.0f)\n", (double)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Pressure))); r = print_helper(r, fprintf(output, "BMS_M7_Atmosphere_Temp = (wire: %.0f)\n", (double)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Atmosphere_Temp))); r = print_helper(r, fprintf(output, "BMS_M7_Humidity = (wire: %.0f)\n", (double)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Humidity))); r = print_helper(r, fprintf(output, "BMS_M7_Dew_Point = (wire: %.0f)\n", (double)(o->can_0x68d_BMS_M7_Cell_Thermistor_Data_2.BMS_M7_Dew_Point))); return r; } static int pack_can_0x68e_BMS_M8_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_1_Thermistor)) & 0xff; i |= x; /* BMS_M8_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_2_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M8_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_3_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M8_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_4_Thermistor)) & 0xff; x <<= 24; i |= x; /* BMS_M8_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_5_Thermistor)) & 0xff; x <<= 32; i |= x; /* BMS_M8_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_6_Thermistor)) & 0xff; x <<= 40; i |= x; /* BMS_M8_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_7_Thermistor)) & 0xff; x <<= 48; i |= x; /* BMS_M8_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_8_Thermistor)) & 0xff; x <<= 56; i |= x; *data = (i); o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1_tx = 1; return 8; } static int unpack_can_0x68e_BMS_M8_Cell_Thermistor_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_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_1_Thermistor = x; /* BMS_M8_Cell_2_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_2_Thermistor = x; /* BMS_M8_Cell_3_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_3_Thermistor = x; /* BMS_M8_Cell_4_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_4_Thermistor = x; /* BMS_M8_Cell_5_Thermistor: start-bit 32, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 32) & 0xff; o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_5_Thermistor = x; /* BMS_M8_Cell_6_Thermistor: start-bit 40, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 40) & 0xff; o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_6_Thermistor = x; /* BMS_M8_Cell_7_Thermistor: start-bit 48, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 48) & 0xff; o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_7_Thermistor = x; /* BMS_M8_Cell_8_Thermistor: start-bit 56, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 56) & 0xff; o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_8_Thermistor = x; o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1_rx = 1; o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1_time_stamp_rx = time_stamp; return 8; } int decode_can_0x68e_BMS_M8_Cell_1_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_1_Thermistor); *out = rval; return 0; } int encode_can_0x68e_BMS_M8_Cell_1_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_1_Thermistor = in; return 0; } int decode_can_0x68e_BMS_M8_Cell_2_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_2_Thermistor); *out = rval; return 0; } int encode_can_0x68e_BMS_M8_Cell_2_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_2_Thermistor = in; return 0; } int decode_can_0x68e_BMS_M8_Cell_3_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_3_Thermistor); *out = rval; return 0; } int encode_can_0x68e_BMS_M8_Cell_3_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_3_Thermistor = in; return 0; } int decode_can_0x68e_BMS_M8_Cell_4_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_4_Thermistor); *out = rval; return 0; } int encode_can_0x68e_BMS_M8_Cell_4_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_4_Thermistor = in; return 0; } int decode_can_0x68e_BMS_M8_Cell_5_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_5_Thermistor); *out = rval; return 0; } int encode_can_0x68e_BMS_M8_Cell_5_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_5_Thermistor = in; return 0; } int decode_can_0x68e_BMS_M8_Cell_6_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_6_Thermistor); *out = rval; return 0; } int encode_can_0x68e_BMS_M8_Cell_6_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_6_Thermistor = in; return 0; } int decode_can_0x68e_BMS_M8_Cell_7_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_7_Thermistor); *out = rval; return 0; } int encode_can_0x68e_BMS_M8_Cell_7_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_7_Thermistor = in; return 0; } int decode_can_0x68e_BMS_M8_Cell_8_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_8_Thermistor); *out = rval; return 0; } int encode_can_0x68e_BMS_M8_Cell_8_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_8_Thermistor = in; return 0; } int print_can_0x68e_BMS_M8_Cell_Thermistor_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_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_1_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_2_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_2_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_3_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_3_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_4_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_4_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_5_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_5_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_6_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_6_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_7_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_7_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_8_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68e_BMS_M8_Cell_Thermistor_Data_1.BMS_M8_Cell_8_Thermistor))); return r; } static int pack_can_0x68f_BMS_M8_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_9_Thermistor)) & 0xff; i |= x; /* BMS_M8_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_10_Thermistor)) & 0xff; x <<= 8; i |= x; /* BMS_M8_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_11_Thermistor)) & 0xff; x <<= 16; i |= x; /* BMS_M8_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = ((uint8_t)(o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_12_Thermistor)) & 0xff; x <<= 24; i |= x; *data = (i); o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2_tx = 1; return 8; } static int unpack_can_0x68f_BMS_M8_Cell_Thermistor_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_9_Thermistor: start-bit 0, length 8, endianess intel, scaling 1, offset 0 */ x = i & 0xff; o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_9_Thermistor = x; /* BMS_M8_Cell_10_Thermistor: start-bit 8, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 8) & 0xff; o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_10_Thermistor = x; /* BMS_M8_Cell_11_Thermistor: start-bit 16, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 16) & 0xff; o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_11_Thermistor = x; /* BMS_M8_Cell_12_Thermistor: start-bit 24, length 8, endianess intel, scaling 1, offset 0 */ x = (i >> 24) & 0xff; o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_12_Thermistor = x; o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2_rx = 1; o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2_time_stamp_rx = time_stamp; return 8; } int decode_can_0x68f_BMS_M8_Cell_9_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_9_Thermistor); *out = rval; return 0; } int encode_can_0x68f_BMS_M8_Cell_9_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_9_Thermistor = in; return 0; } int decode_can_0x68f_BMS_M8_Cell_10_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_10_Thermistor); *out = rval; return 0; } int encode_can_0x68f_BMS_M8_Cell_10_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_10_Thermistor = in; return 0; } int decode_can_0x68f_BMS_M8_Cell_11_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_11_Thermistor); *out = rval; return 0; } int encode_can_0x68f_BMS_M8_Cell_11_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_11_Thermistor = in; return 0; } int decode_can_0x68f_BMS_M8_Cell_12_Thermistor(const can_obj_all_sre_edited_h_t *o, uint8_t *out) { assert(o); assert(out); uint8_t rval = (uint8_t)(o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_12_Thermistor); *out = rval; return 0; } int encode_can_0x68f_BMS_M8_Cell_12_Thermistor(can_obj_all_sre_edited_h_t *o, uint8_t in) { assert(o); o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_12_Thermistor = in; return 0; } int print_can_0x68f_BMS_M8_Cell_Thermistor_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_9_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_9_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_10_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_10_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_11_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_11_Thermistor))); r = print_helper(r, fprintf(output, "BMS_M8_Cell_12_Thermistor = (wire: %.0f)\n", (double)(o->can_0x68f_BMS_M8_Cell_Thermistor_Data_2.BMS_M8_Cell_12_Thermistor))); 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 0x604: return unpack_can_0x604_BMS_Balance_Enable(o, data, dlc, time_stamp); case 0x621: return unpack_can_0x621_BMS_State_of_Charge(o, data, dlc, time_stamp); case 0x622: return unpack_can_0x622_BMS_Cell_Summary(o, data, dlc, time_stamp); case 0x623: return unpack_can_0x623_BMS_Balance_Status_M1_to_M4(o, data, dlc, time_stamp); case 0x624: return unpack_can_0x624_BMS_Balance_Status_M5_to_M8(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_Thermistor_Data_1(o, data, dlc, time_stamp); case 0x681: return unpack_can_0x681_BMS_M1_Cell_Thermistor_Data_2(o, data, dlc, time_stamp); case 0x682: return unpack_can_0x682_BMS_M2_Cell_Thermistor_Data_1(o, data, dlc, time_stamp); case 0x683: return unpack_can_0x683_BMS_M2_Cell_Thermistor_Data_2(o, data, dlc, time_stamp); case 0x684: return unpack_can_0x684_BMS_M3_Cell_Thermistor_Data_1(o, data, dlc, time_stamp); case 0x685: return unpack_can_0x685_BMS_M3_Cell_Thermistor_Data_2(o, data, dlc, time_stamp); case 0x686: return unpack_can_0x686_BMS_M4_Cell_Thermistor_Data_1(o, data, dlc, time_stamp); case 0x687: return unpack_can_0x687_BMS_M4_Cell_Thermistor_Data_2(o, data, dlc, time_stamp); case 0x688: return unpack_can_0x688_BMS_M5_Cell_Thermistor_Data_1(o, data, dlc, time_stamp); case 0x689: return unpack_can_0x689_BMS_M5_Cell_Thermistor_Data_2(o, data, dlc, time_stamp); case 0x68a: return unpack_can_0x68a_BMS_M6_Cell_Thermistor_Data_1(o, data, dlc, time_stamp); case 0x68b: return unpack_can_0x68b_BMS_M6_Cell_Thermistor_Data_2(o, data, dlc, time_stamp); case 0x68c: return unpack_can_0x68c_BMS_M7_Cell_Thermistor_Data_1(o, data, dlc, time_stamp); case 0x68d: return unpack_can_0x68d_BMS_M7_Cell_Thermistor_Data_2(o, data, dlc, time_stamp); case 0x68e: return unpack_can_0x68e_BMS_M8_Cell_Thermistor_Data_1(o, data, dlc, time_stamp); case 0x68f: return unpack_can_0x68f_BMS_M8_Cell_Thermistor_Data_2(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 0x604: return pack_can_0x604_BMS_Balance_Enable(o, data); case 0x621: return pack_can_0x621_BMS_State_of_Charge(o, data); case 0x622: return pack_can_0x622_BMS_Cell_Summary(o, data); case 0x623: return pack_can_0x623_BMS_Balance_Status_M1_to_M4(o, data); case 0x624: return pack_can_0x624_BMS_Balance_Status_M5_to_M8(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_Thermistor_Data_1(o, data); case 0x681: return pack_can_0x681_BMS_M1_Cell_Thermistor_Data_2(o, data); case 0x682: return pack_can_0x682_BMS_M2_Cell_Thermistor_Data_1(o, data); case 0x683: return pack_can_0x683_BMS_M2_Cell_Thermistor_Data_2(o, data); case 0x684: return pack_can_0x684_BMS_M3_Cell_Thermistor_Data_1(o, data); case 0x685: return pack_can_0x685_BMS_M3_Cell_Thermistor_Data_2(o, data); case 0x686: return pack_can_0x686_BMS_M4_Cell_Thermistor_Data_1(o, data); case 0x687: return pack_can_0x687_BMS_M4_Cell_Thermistor_Data_2(o, data); case 0x688: return pack_can_0x688_BMS_M5_Cell_Thermistor_Data_1(o, data); case 0x689: return pack_can_0x689_BMS_M5_Cell_Thermistor_Data_2(o, data); case 0x68a: return pack_can_0x68a_BMS_M6_Cell_Thermistor_Data_1(o, data); case 0x68b: return pack_can_0x68b_BMS_M6_Cell_Thermistor_Data_2(o, data); case 0x68c: return pack_can_0x68c_BMS_M7_Cell_Thermistor_Data_1(o, data); case 0x68d: return pack_can_0x68d_BMS_M7_Cell_Thermistor_Data_2(o, data); case 0x68e: return pack_can_0x68e_BMS_M8_Cell_Thermistor_Data_1(o, data); case 0x68f: return pack_can_0x68f_BMS_M8_Cell_Thermistor_Data_2(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 0x604: return print_can_0x604_BMS_Balance_Enable(o, output); case 0x621: return print_can_0x621_BMS_State_of_Charge(o, output); case 0x622: return print_can_0x622_BMS_Cell_Summary(o, output); case 0x623: return print_can_0x623_BMS_Balance_Status_M1_to_M4(o, output); case 0x624: return print_can_0x624_BMS_Balance_Status_M5_to_M8(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_Thermistor_Data_1(o, output); case 0x681: return print_can_0x681_BMS_M1_Cell_Thermistor_Data_2(o, output); case 0x682: return print_can_0x682_BMS_M2_Cell_Thermistor_Data_1(o, output); case 0x683: return print_can_0x683_BMS_M2_Cell_Thermistor_Data_2(o, output); case 0x684: return print_can_0x684_BMS_M3_Cell_Thermistor_Data_1(o, output); case 0x685: return print_can_0x685_BMS_M3_Cell_Thermistor_Data_2(o, output); case 0x686: return print_can_0x686_BMS_M4_Cell_Thermistor_Data_1(o, output); case 0x687: return print_can_0x687_BMS_M4_Cell_Thermistor_Data_2(o, output); case 0x688: return print_can_0x688_BMS_M5_Cell_Thermistor_Data_1(o, output); case 0x689: return print_can_0x689_BMS_M5_Cell_Thermistor_Data_2(o, output); case 0x68a: return print_can_0x68a_BMS_M6_Cell_Thermistor_Data_1(o, output); case 0x68b: return print_can_0x68b_BMS_M6_Cell_Thermistor_Data_2(o, output); case 0x68c: return print_can_0x68c_BMS_M7_Cell_Thermistor_Data_1(o, output); case 0x68d: return print_can_0x68d_BMS_M7_Cell_Thermistor_Data_2(o, output); case 0x68e: return print_can_0x68e_BMS_M8_Cell_Thermistor_Data_1(o, output); case 0x68f: return print_can_0x68f_BMS_M8_Cell_Thermistor_Data_2(o, output); default: break; } return -1; }