diff --git a/middleware/McuManager/src/McuDevice.cpp b/middleware/McuManager/src/McuDevice.cpp index 266d147..a003cb7 100644 --- a/middleware/McuManager/src/McuDevice.cpp +++ b/middleware/McuManager/src/McuDevice.cpp @@ -92,7 +92,7 @@ ssize_t McuDevice::WriteData(const void *buff, const size_t buffLength, std::sha */ mMutex.lock(); length = IUartSend(mUartDevice, buff, buffLength); - PrintHexadecimalData(buff, buffLength, "Mcu urat write:"); + // PrintHexadecimalData(buff, buffLength, "Mcu urat write:"); mMutex.unlock(); return length; } @@ -106,7 +106,7 @@ ssize_t McuDevice::WriteData(const void *buff, const size_t buffLength, std::sha mMutex.lock(); AddMcuAsk(ask); length = IUartSend(mUartDevice, buff, buffLength); - PrintHexadecimalData(buff, buffLength, "AddMcuAsk, Mcu urat write:"); + // PrintHexadecimalData(buff, buffLength, "AddMcuAsk, Mcu urat write:"); mMutex.unlock(); if (WRITE_ERROR == length) { LogError("Uart send failed, something wrong happened.\n"); diff --git a/utils/ConfigBase/src/ConfigBaseImpl.cpp b/utils/ConfigBase/src/ConfigBaseImpl.cpp index aad8760..af322a0 100644 --- a/utils/ConfigBase/src/ConfigBaseImpl.cpp +++ b/utils/ConfigBase/src/ConfigBaseImpl.cpp @@ -43,7 +43,7 @@ void ConfigBaseImpl::OpenConfigFile(void) } } else { - LogInfo("Config file doesn't exist.\n"); + LogInfo("Config file doesn't exist.mFileName = %s\n", mFileName.c_str()); /* Write out the new configuration. */ if (!config_write_file(&cfg, mFileName.c_str())) { fprintf(stderr, "Error while writing file.\n"); diff --git a/utils/McuProtocol/src/ProtocolHandle.cpp b/utils/McuProtocol/src/ProtocolHandle.cpp index 4f0ca12..ea453b4 100644 --- a/utils/McuProtocol/src/ProtocolHandle.cpp +++ b/utils/McuProtocol/src/ProtocolHandle.cpp @@ -152,8 +152,10 @@ void ProtocolHandle::MakeNoUserDataPacket(const std::shared_ptr packet.mCheckCode = BigEndianConversion(packet.mCheckCode); memcpy(mProtocolData + KEY_HEAD_LENGTH, &packet.mCheckCode, CHECK_CODE_LENGTH); mProtocolDataLength = packetLength; - ProtocolHandle::PrintHexadecimalData( - mProtocolData, mProtocolDataLength - CHECK_CODE_LENGTH, "MakeNoUserDataPacket:"); + if (param->mCommand != ASK_FEED_WATCH_DOG) { + ProtocolHandle::PrintHexadecimalData( + mProtocolData, mProtocolDataLength - CHECK_CODE_LENGTH, "MakeNoUserDataPacket:"); + } } void ProtocolHandle::MakeAskIpcMissionPacket(const std::shared_ptr ¶m) { @@ -351,7 +353,6 @@ StatusCode ProtocolHandle::GetDataLength(const void *keyHead, const size_t &head LogError("key head buf error.\n"); return CreateStatusCode(STATUS_CODE_NOT_OK); } - ProtocolHandle::PrintHexadecimalData(keyHead, headLength); unsigned short headNum = PROTOCOL_HEAD; char byteOrder = ProtocolHandle::GetByteOrder(); if (ORDER_LITTLE_ENDIAN == byteOrder) { diff --git a/utils/ModBusCRC16/src/ModBusCRC16.cpp b/utils/ModBusCRC16/src/ModBusCRC16.cpp index b560aff..688660d 100644 --- a/utils/ModBusCRC16/src/ModBusCRC16.cpp +++ b/utils/ModBusCRC16/src/ModBusCRC16.cpp @@ -64,6 +64,6 @@ unsigned short calculate_check_sum(const unsigned char *pData, unsigned short le CRCHi = CRCLo ^ chCRCHi[uIndex]; CRCLo = chCRCLo[uIndex]; } - printf("CRCHi = 0x%x, CRCLo = 0x%x\n", CRCHi, CRCLo); + // printf("CRCHi = 0x%x, CRCLo = 0x%x\n", CRCHi, CRCLo); return (CRCHi << 8 | CRCLo); } \ No newline at end of file diff --git a/utils/UartDevice/src/UartDeviceImpl.cpp b/utils/UartDevice/src/UartDeviceImpl.cpp index 94f4f17..419ccbd 100644 --- a/utils/UartDevice/src/UartDeviceImpl.cpp +++ b/utils/UartDevice/src/UartDeviceImpl.cpp @@ -223,6 +223,7 @@ const StatusCode UartDeviceImpl::SetConfig(void) options.c_oflag &= ~OPOST; options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); // options.c_lflag &= ~(ISIG | ICANON); + options.c_iflag &= ~ICRNL; // set wait time options.c_cc[VTIME] = 1; options.c_cc[VMIN] = 1;