Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -raa8b9687b9396b4878cf0d5327d72a5d67477761 -r57fe78d545ac91ba3f8d38ff76079a0d7ec8c0db --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision aa8b9687b9396b4878cf0d5327d72a5d67477761) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 57fe78d545ac91ba3f8d38ff76079a0d7ec8c0db) @@ -227,13 +227,19 @@ { BOOL result; MESSAGE_T msg; + ACK_RESPONSE_PAYLOAD_T cmd; + // Populate data structure + cmd.acknowledgement = ack; + // Create a message record blankMessage( &msg ); msg.hdr.msgID = msgID; - msg.hdr.payloadLen = sizeof( U08 ); - msg.payload[ 0 ] = (U08)ack; + msg.hdr.payloadLen = sizeof( ACK_RESPONSE_PAYLOAD_T ); + //Populate message + memcpy( msg->payload, &cmd, sizeof( ACK_RESPONSE_PAYLOAD_T ) ); + // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer result = serializeMessage( msg, buffer, ACK_NOT_REQUIRED ); @@ -255,17 +261,21 @@ { BOOL result; MESSAGE_T msg; - U08 *payloadPtr = msg.payload; + UI_RESPONSE_PAYLOAD_T cmd; + // Populate data structure + cmd.accepted = accepted + cmd.rejection_reason = reason; + // Create a message record blankMessage( &msg ); msg.hdr.msgID = msgID; - msg.hdr.payloadLen = sizeof( BOOL ) + sizeof( U32 ); + msg.hdr.payloadLen = sizeof( UI_RESPONSE_PAYLOAD_T ); - memcpy( payloadPtr, &accepted, sizeof( BOOL ) ); - payloadPtr += sizeof( BOOL ); - memcpy( payloadPtr, &reason, sizeof( U32 ) ); + // Populate message + memcpy( msg->payload, &cmd, sizeof( UI_RESPONSE_PAYLOAD_T ) ); + // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED );