DataId DiagSH_GetTargetReadDID( void ) { uint16_t off_set = 0; DataId ret_did = 0; uint32_t tmpoff_set = 0; tmpoff_set = ( DiagSH_GetReuestReadDIDIdx() * 2 ); if(tmpoff_set < DIAG_CANMSG_DATA_SIZE_MAX){ off_set = (uint16_t)tmpoff_set; } else{ off_set = (uint16_t)(DIAG_CANMSG_DATA_SIZE_MAX - 1); } #ifndef DIAGSH_BIG_ENDIAN ret_did = (DataId)DiagSH_RequestBuffer.msg_info.body[off_set] << 8; ret_did |= (DataId)DiagSH_RequestBuffer.msg_info.body[(uint32_t)(off_set+1)]; #else /* DIAGSH_BIG_ENDIAN */ ret_did = (DataId)DiagSH_RequestBuffer.msg_info.body[off_set+1] << 8; ret_did |= (DataId)DiagSH_RequestBuffer.msg_info.body[off_set]; #endif /* DIAGSH_BIG_ENDIAN */ return ret_did; } tmpoff_set等于几才大于等于DIAG_CANMSG_DATA_SIZE_MAX
时间: 2023-10-23 22:10:54 浏览: 140
opencv_face_detector_uint8.pb
当tmpoff_set的值大于等于DIAG_CANMSG_DATA_SIZE_MAX时,off_set的值将被设置为DIAG_CANMSG_DATA_SIZE_MAX - 1。具体来说,当tmpoff_set的值大于等于DIAG_CANMSG_DATA_SIZE_MAX时,off_set的值将被设置为DIAG_CANMSG_DATA_SIZE_MAX - 1。
阅读全文