It's the same like on www.ms4x.net just as Excel

int calculateChecksum(int l_gear_info, int l_alive_counter) { tmp1 = (l_alive_counter ^ l_gear_info); tmp2 = ~(tmp1); tmp3 = (tmp2 & 0x0f); tmp4 = (tmp3 << 4); // here says www.ms4x.net: CHKSM_GEAR_INFO = Or CHKSM_GEAR_INFO , GEAR_INFO // and it is wrong, because we don't have the counter value in Byte3. // the correct value is: tmp5 = (tmp4 | l_alive_counter); return tmp5; }
Comment