767 int reallen = fullMessageLength; |
767 int reallen = fullMessageLength; |
768 if (reallen > 80) reallen = 80; |
768 if (reallen > 80) reallen = 80; |
769 char msg[6]; |
769 char msg[6]; |
770 msg[0] = '\0'; |
770 msg[0] = '\0'; |
771 |
771 |
772 sTcpLogMsg[0] = '\0'; |
772 sLogMsg[0] = '\0'; |
773 if (reallen > 0) |
773 if (reallen > 0) |
774 { |
774 { |
775 sTcpLogMsg[0] = '\0'; |
775 sLogMsg[0] = '\0'; |
776 for (int i = 0; i < reallen; i++) |
776 for (int i = 0; i < reallen; i++) |
777 { |
777 { |
778 if (isalnum(ptr[i])) |
778 if (isalnum(ptr[i])) |
779 { |
779 { |
780 sprintf(msg, "%c", ptr[i]); |
780 sprintf(msg, "%c", ptr[i]); |
781 } |
781 } |
782 else |
782 else |
783 { |
783 { |
784 sprintf(msg, "%02.2x ", ptr[i]); |
784 sprintf(msg, "%02.2x ", ptr[i]); |
785 } |
785 } |
786 strcat(sTcpLogMsg, msg); |
786 strcat(sLogMsg, msg); |
787 } |
787 } |
788 } |
788 } |
789 #endif |
789 #endif |
790 PROCLOGOPEN(); |
790 PROCLOGOPEN(); |
791 PROCLOGA5("CTcpComm::ProcessBuffer - RouteMesssage pRegistry = %x id=%x len=%d len=%d msg=%s\n", pRegistry, msgId, fullMessageLength, rawLength, sTcpLogMsg); |
791 PROCLOGA5("CRealSerialComm::ProcessBuffer - RouteMesssage pRegistry = %x id=%x len=%d len=%d msg=%s\n", pRegistry, msgId, fullMessageLength, rawLength, sLogMsg); |
792 PROCLOGCLOSE(); |
792 PROCLOGCLOSE(); |
793 |
793 |
794 err = pRegistry->RouteMessage(msgId, fullMessage, fullMessageLength, rawMessage, rawLength); |
794 err = pRegistry->RouteMessage(msgId, fullMessage, fullMessageLength, rawMessage, rawLength); |
795 if (err != TCAPI_ERR_NONE) routingErr = err; // saved for future |
795 if (err != TCAPI_ERR_NONE) routingErr = err; // saved for future |
796 |
796 |