Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rc0b5416c7c5471942efd66f4b811dd464d7d6b24 -r9d21272d8c5c0b5f1d72bd5f0e9ef4e4ee41e764 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision c0b5416c7c5471942efd66f4b811dd464d7d6b24) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 9d21272d8c5c0b5f1d72bd5f0e9ef4e4ee41e764) @@ -8,7 +8,7 @@ * @file SystemCommMessages.c * * @author (last) Dara Navaei -* @date (last) 29-Jan-2025 +* @date (last) 28-Mar-2025 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -3758,7 +3758,36 @@ return result; } +/*********************************************************************//** + * @brief + * The handleDGRequestMaxRORejectionRatio function handles the DG request + * to receive the max RO rejection ratio from HD institutional record. + * @details Inputs: none + * @details Outputs: none + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleDGRequestMaxRORejectionRatio( MESSAGE_T* message ) +{ + if ( 0 == message->hdr.payloadLen ) + { + MESSAGE_T msg; + F32 maxRORejectionRatioInInstitRecord = getMaxRORejectionRatioInInstitRecord(); + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_HD_MAX_RO_REJ_RATIO_FROM_HD_INSTIT_RECORD_RESPONSE; + msg.hdr.payloadLen = sizeof( F32 ); + + memcpy( msg.payload, &maxRORejectionRatioInInstitRecord, sizeof( F32 ) ); + + // 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_DG, ACK_REQUIRED ); + } +} + + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/