diff options
Diffstat (limited to 'all_SRE_edited.c')
-rw-r--r-- | all_SRE_edited.c | 192 |
1 files changed, 128 insertions, 64 deletions
diff --git a/all_SRE_edited.c b/all_SRE_edited.c index 4660f87..9eb5dc0 100644 --- a/all_SRE_edited.c +++ b/all_SRE_edited.c @@ -15147,7 +15147,7 @@ int decode_can_0x680_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x680_BMS_M1_Cell_Temp_Data.BMS_Section_4_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15159,7 +15159,9 @@ int decode_can_0x680_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x680_BMS_Section_4_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x680_BMS_M1_Cell_Temp_Data.BMS_Section_4_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x680_BMS_M1_Cell_Temp_Data.BMS_Section_4_Temp = in; @@ -15171,7 +15173,7 @@ int decode_can_0x680_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x680_BMS_M1_Cell_Temp_Data.BMS_Section_3_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15183,7 +15185,9 @@ int decode_can_0x680_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x680_BMS_Section_3_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x680_BMS_M1_Cell_Temp_Data.BMS_Section_3_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x680_BMS_M1_Cell_Temp_Data.BMS_Section_3_Temp = in; @@ -15195,7 +15199,7 @@ int decode_can_0x680_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x680_BMS_M1_Cell_Temp_Data.BMS_Section_2_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15207,7 +15211,9 @@ int decode_can_0x680_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x680_BMS_Section_2_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x680_BMS_M1_Cell_Temp_Data.BMS_Section_2_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x680_BMS_M1_Cell_Temp_Data.BMS_Section_2_Temp = in; @@ -15219,7 +15225,7 @@ int decode_can_0x680_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x680_BMS_M1_Cell_Temp_Data.BMS_Section_1_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15231,7 +15237,9 @@ int decode_can_0x680_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x680_BMS_Section_1_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x680_BMS_M1_Cell_Temp_Data.BMS_Section_1_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x680_BMS_M1_Cell_Temp_Data.BMS_Section_1_Temp = in; @@ -15303,7 +15311,7 @@ int decode_can_0x683_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x683_BMS_M2_Cell_Temp_Data.BMS_Section_4_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15315,7 +15323,9 @@ int decode_can_0x683_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x683_BMS_Section_4_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x683_BMS_M2_Cell_Temp_Data.BMS_Section_4_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x683_BMS_M2_Cell_Temp_Data.BMS_Section_4_Temp = in; @@ -15327,7 +15337,7 @@ int decode_can_0x683_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x683_BMS_M2_Cell_Temp_Data.BMS_Section_3_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15339,7 +15349,9 @@ int decode_can_0x683_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x683_BMS_Section_3_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x683_BMS_M2_Cell_Temp_Data.BMS_Section_3_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x683_BMS_M2_Cell_Temp_Data.BMS_Section_3_Temp = in; @@ -15351,7 +15363,7 @@ int decode_can_0x683_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x683_BMS_M2_Cell_Temp_Data.BMS_Section_2_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15363,7 +15375,9 @@ int decode_can_0x683_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x683_BMS_Section_2_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x683_BMS_M2_Cell_Temp_Data.BMS_Section_2_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x683_BMS_M2_Cell_Temp_Data.BMS_Section_2_Temp = in; @@ -15375,7 +15389,7 @@ int decode_can_0x683_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x683_BMS_M2_Cell_Temp_Data.BMS_Section_1_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15387,7 +15401,9 @@ int decode_can_0x683_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x683_BMS_Section_1_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x683_BMS_M2_Cell_Temp_Data.BMS_Section_1_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x683_BMS_M2_Cell_Temp_Data.BMS_Section_1_Temp = in; @@ -15459,7 +15475,7 @@ int decode_can_0x686_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x686_BMS_M3_Cell_Temp_Data.BMS_Section_4_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15471,7 +15487,9 @@ int decode_can_0x686_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x686_BMS_Section_4_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x686_BMS_M3_Cell_Temp_Data.BMS_Section_4_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x686_BMS_M3_Cell_Temp_Data.BMS_Section_4_Temp = in; @@ -15483,7 +15501,7 @@ int decode_can_0x686_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x686_BMS_M3_Cell_Temp_Data.BMS_Section_3_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15495,7 +15513,9 @@ int decode_can_0x686_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x686_BMS_Section_3_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x686_BMS_M3_Cell_Temp_Data.BMS_Section_3_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x686_BMS_M3_Cell_Temp_Data.BMS_Section_3_Temp = in; @@ -15507,7 +15527,7 @@ int decode_can_0x686_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x686_BMS_M3_Cell_Temp_Data.BMS_Section_2_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15519,7 +15539,9 @@ int decode_can_0x686_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x686_BMS_Section_2_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x686_BMS_M3_Cell_Temp_Data.BMS_Section_2_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x686_BMS_M3_Cell_Temp_Data.BMS_Section_2_Temp = in; @@ -15531,7 +15553,7 @@ int decode_can_0x686_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x686_BMS_M3_Cell_Temp_Data.BMS_Section_1_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15543,7 +15565,9 @@ int decode_can_0x686_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x686_BMS_Section_1_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x686_BMS_M3_Cell_Temp_Data.BMS_Section_1_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x686_BMS_M3_Cell_Temp_Data.BMS_Section_1_Temp = in; @@ -15615,7 +15639,7 @@ int decode_can_0x689_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x689_BMS_M4_Cell_Temp_Data.BMS_Section_4_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15627,7 +15651,9 @@ int decode_can_0x689_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x689_BMS_Section_4_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x689_BMS_M4_Cell_Temp_Data.BMS_Section_4_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x689_BMS_M4_Cell_Temp_Data.BMS_Section_4_Temp = in; @@ -15639,7 +15665,7 @@ int decode_can_0x689_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x689_BMS_M4_Cell_Temp_Data.BMS_Section_3_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15651,7 +15677,9 @@ int decode_can_0x689_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x689_BMS_Section_3_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x689_BMS_M4_Cell_Temp_Data.BMS_Section_3_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x689_BMS_M4_Cell_Temp_Data.BMS_Section_3_Temp = in; @@ -15663,7 +15691,7 @@ int decode_can_0x689_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x689_BMS_M4_Cell_Temp_Data.BMS_Section_2_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15675,7 +15703,9 @@ int decode_can_0x689_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x689_BMS_Section_2_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x689_BMS_M4_Cell_Temp_Data.BMS_Section_2_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x689_BMS_M4_Cell_Temp_Data.BMS_Section_2_Temp = in; @@ -15687,7 +15717,7 @@ int decode_can_0x689_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x689_BMS_M4_Cell_Temp_Data.BMS_Section_1_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15699,7 +15729,9 @@ int decode_can_0x689_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x689_BMS_Section_1_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x689_BMS_M4_Cell_Temp_Data.BMS_Section_1_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x689_BMS_M4_Cell_Temp_Data.BMS_Section_1_Temp = in; @@ -15771,7 +15803,7 @@ int decode_can_0x68c_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x68c_BMS_M5_Cell_Temp_Data.BMS_Section_4_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15783,7 +15815,9 @@ int decode_can_0x68c_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x68c_BMS_Section_4_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x68c_BMS_M5_Cell_Temp_Data.BMS_Section_4_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x68c_BMS_M5_Cell_Temp_Data.BMS_Section_4_Temp = in; @@ -15795,7 +15829,7 @@ int decode_can_0x68c_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x68c_BMS_M5_Cell_Temp_Data.BMS_Section_3_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15807,7 +15841,9 @@ int decode_can_0x68c_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x68c_BMS_Section_3_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x68c_BMS_M5_Cell_Temp_Data.BMS_Section_3_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x68c_BMS_M5_Cell_Temp_Data.BMS_Section_3_Temp = in; @@ -15819,7 +15855,7 @@ int decode_can_0x68c_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x68c_BMS_M5_Cell_Temp_Data.BMS_Section_2_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15831,7 +15867,9 @@ int decode_can_0x68c_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x68c_BMS_Section_2_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x68c_BMS_M5_Cell_Temp_Data.BMS_Section_2_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x68c_BMS_M5_Cell_Temp_Data.BMS_Section_2_Temp = in; @@ -15843,7 +15881,7 @@ int decode_can_0x68c_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x68c_BMS_M5_Cell_Temp_Data.BMS_Section_1_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15855,7 +15893,9 @@ int decode_can_0x68c_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x68c_BMS_Section_1_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x68c_BMS_M5_Cell_Temp_Data.BMS_Section_1_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x68c_BMS_M5_Cell_Temp_Data.BMS_Section_1_Temp = in; @@ -15927,7 +15967,7 @@ int decode_can_0x68f_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x68f_BMS_M6_Cell_Temp_Data.BMS_Section_4_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15939,7 +15979,9 @@ int decode_can_0x68f_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x68f_BMS_Section_4_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x68f_BMS_M6_Cell_Temp_Data.BMS_Section_4_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x68f_BMS_M6_Cell_Temp_Data.BMS_Section_4_Temp = in; @@ -15951,7 +15993,7 @@ int decode_can_0x68f_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x68f_BMS_M6_Cell_Temp_Data.BMS_Section_3_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15963,7 +16005,9 @@ int decode_can_0x68f_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x68f_BMS_Section_3_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x68f_BMS_M6_Cell_Temp_Data.BMS_Section_3_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x68f_BMS_M6_Cell_Temp_Data.BMS_Section_3_Temp = in; @@ -15975,7 +16019,7 @@ int decode_can_0x68f_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x68f_BMS_M6_Cell_Temp_Data.BMS_Section_2_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -15987,7 +16031,9 @@ int decode_can_0x68f_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x68f_BMS_Section_2_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x68f_BMS_M6_Cell_Temp_Data.BMS_Section_2_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x68f_BMS_M6_Cell_Temp_Data.BMS_Section_2_Temp = in; @@ -15999,7 +16045,7 @@ int decode_can_0x68f_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x68f_BMS_M6_Cell_Temp_Data.BMS_Section_1_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -16011,7 +16057,9 @@ int decode_can_0x68f_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x68f_BMS_Section_1_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x68f_BMS_M6_Cell_Temp_Data.BMS_Section_1_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x68f_BMS_M6_Cell_Temp_Data.BMS_Section_1_Temp = in; @@ -16083,7 +16131,7 @@ int decode_can_0x692_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x692_BMS_M7_Cell_Temp_Data.BMS_Section_4_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -16095,7 +16143,9 @@ int decode_can_0x692_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x692_BMS_Section_4_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x692_BMS_M7_Cell_Temp_Data.BMS_Section_4_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x692_BMS_M7_Cell_Temp_Data.BMS_Section_4_Temp = in; @@ -16107,7 +16157,7 @@ int decode_can_0x692_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x692_BMS_M7_Cell_Temp_Data.BMS_Section_3_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -16119,7 +16169,9 @@ int decode_can_0x692_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x692_BMS_Section_3_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x692_BMS_M7_Cell_Temp_Data.BMS_Section_3_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x692_BMS_M7_Cell_Temp_Data.BMS_Section_3_Temp = in; @@ -16131,7 +16183,7 @@ int decode_can_0x692_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x692_BMS_M7_Cell_Temp_Data.BMS_Section_2_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -16143,7 +16195,9 @@ int decode_can_0x692_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x692_BMS_Section_2_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x692_BMS_M7_Cell_Temp_Data.BMS_Section_2_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x692_BMS_M7_Cell_Temp_Data.BMS_Section_2_Temp = in; @@ -16155,7 +16209,7 @@ int decode_can_0x692_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x692_BMS_M7_Cell_Temp_Data.BMS_Section_1_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -16167,7 +16221,9 @@ int decode_can_0x692_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x692_BMS_Section_1_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x692_BMS_M7_Cell_Temp_Data.BMS_Section_1_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x692_BMS_M7_Cell_Temp_Data.BMS_Section_1_Temp = in; @@ -16239,7 +16295,7 @@ int decode_can_0x695_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x695_BMS_M8_Cell_Temp_Data.BMS_Section_4_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -16251,7 +16307,9 @@ int decode_can_0x695_BMS_Section_4_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x695_BMS_Section_4_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x695_BMS_M8_Cell_Temp_Data.BMS_Section_4_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x695_BMS_M8_Cell_Temp_Data.BMS_Section_4_Temp = in; @@ -16263,7 +16321,7 @@ int decode_can_0x695_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x695_BMS_M8_Cell_Temp_Data.BMS_Section_3_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -16275,7 +16333,9 @@ int decode_can_0x695_BMS_Section_3_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x695_BMS_Section_3_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x695_BMS_M8_Cell_Temp_Data.BMS_Section_3_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x695_BMS_M8_Cell_Temp_Data.BMS_Section_3_Temp = in; @@ -16287,7 +16347,7 @@ int decode_can_0x695_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x695_BMS_M8_Cell_Temp_Data.BMS_Section_2_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -16299,7 +16359,9 @@ int decode_can_0x695_BMS_Section_2_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x695_BMS_Section_2_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x695_BMS_M8_Cell_Temp_Data.BMS_Section_2_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x695_BMS_M8_Cell_Temp_Data.BMS_Section_2_Temp = in; @@ -16311,7 +16373,7 @@ int decode_can_0x695_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou assert(out); double rval = (double)(o->can_0x695_BMS_M8_Cell_Temp_Data.BMS_Section_1_Temp); rval *= 0.1; - if (rval <= 100) { + if ((rval >= -50) && (rval <= 150)) { *out = rval; return 0; } else { @@ -16323,7 +16385,9 @@ int decode_can_0x695_BMS_Section_1_Temp(const can_obj_all_sre_edited_h_t *o, dou int encode_can_0x695_BMS_Section_1_Temp(can_obj_all_sre_edited_h_t *o, double in) { assert(o); o->can_0x695_BMS_M8_Cell_Temp_Data.BMS_Section_1_Temp = 0; - if (in > 100) + if (in < -50) + return -1; + if (in > 150) return -1; in *= 10; o->can_0x695_BMS_M8_Cell_Temp_Data.BMS_Section_1_Temp = in; |