Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rd9fb74cda4b2c4c8f6e36ba3af978fde8e19b3e6 -r89d0436dc87933ee978e91d9ce4722adbccdf9d1 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision d9fb74cda4b2c4c8f6e36ba3af978fde8e19b3e6) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 89d0436dc87933ee978e91d9ce4722adbccdf9d1) @@ -3354,23 +3354,28 @@ blankMessage( &msg ); msg.hdr.msgID = MSG_ID_HD_SERIAL_NUMBER_RESPONSE; - // Add 1 byte for null terminator - msg.hdr.payloadLen = MAX_TOP_LEVEL_SN_CHARS + 1; - - for ( i = 0; i < MAX_TOP_LEVEL_SN_CHARS; i++ ) + // Check if the first element of the serial number is not 0 meaning that we are not sending empty serial number + // to the UI + if ( system.topLevelSN[0] != 0 ) { - // NOTE: A local variable was created to avoid system.topLevelSN in the messages list - // NOTE: For loop was used instead of memory copy to ensure it is not parsed in the messages list script - localTopLevelSN.topLevelSN[ i ] = system.topLevelSN[ i ]; - } + // Add 1 byte for null terminator + msg.hdr.payloadLen = MAX_TOP_LEVEL_SN_CHARS + 1; - // Fill message payload - memcpy( payloadPtr, &localTopLevelSN, sizeof( LOCAL_TOP_SN_T ) ); - payloadPtr += MAX_TOP_LEVEL_SN_CHARS; - *payloadPtr = 0; + for ( i = 0; i < MAX_TOP_LEVEL_SN_CHARS; i++ ) + { + // NOTE: A local variable was created to avoid system.topLevelSN in the messages list + // NOTE: For loop was used instead of memory copy to ensure it is not parsed in the messages list script + localTopLevelSN.topLevelSN[ i ] = system.topLevelSN[ i ]; + } - // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer - serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED ); + // Fill message payload + memcpy( payloadPtr, &localTopLevelSN, sizeof( LOCAL_TOP_SN_T ) ); + payloadPtr += MAX_TOP_LEVEL_SN_CHARS; + *payloadPtr = 0; + + // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED ); + } } /*********************************************************************//**