Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rc6f3b01d1b0a5e3fdf480a7ee205ca349e10d6d2 -r07a352d02dc7e062dd5b6742891ac0b57679858c --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision c6f3b01d1b0a5e3fdf480a7ee205ca349e10d6d2) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 07a352d02dc7e062dd5b6742891ac0b57679858c) @@ -2243,17 +2243,21 @@ *************************************************************************/ void handleSetRTCTimestamp( MESSAGE_T *message ) { - BOOL result; - U08 seconds = message->payload[0]; - U08 minutes = message->payload[1]; - U08 hours = message->payload[2]; - U08 days = message->payload[3]; - U08 months = message->payload[4]; - U32 years; + BOOL result = FALSE; - memcpy(&years, &message->payload[5], sizeof(U32)); - result = setRTCTimestamp( seconds, minutes, hours, days, months, years ); + if ( message->hdr.payloadLen == 9 ) // TODO - add payload structure to RTC.h and use a structure to import payload. + { + U08 seconds = message->payload[0]; + U08 minutes = message->payload[1]; + U08 hours = message->payload[2]; + U08 days = message->payload[3]; + U08 months = message->payload[4]; + U32 years; + memcpy(&years, &message->payload[5], sizeof(U32)); + result = setRTCTimestamp( seconds, minutes, hours, days, months, years ); + } + // respond to request sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } @@ -2418,7 +2422,7 @@ *************************************************************************/ void handleSetAccelCalibration( MESSAGE_T *message ) { - BOOL result; + BOOL result = FALSE; if ( message->hdr.payloadLen == sizeof(ACCEL_CAL_PAYLOAD_T) ) { @@ -2444,7 +2448,7 @@ *************************************************************************/ void handleSetBloodFlowCalibration( MESSAGE_T *message ) { - BOOL result; + BOOL result = FALSE; if ( message->hdr.payloadLen == sizeof(LINEAR_F32_CAL_PAYLOAD_T) ) { @@ -2470,7 +2474,7 @@ *************************************************************************/ void handleSetDialysateFlowCalibration( MESSAGE_T *message ) { - BOOL result; + BOOL result = FALSE; if ( message->hdr.payloadLen == sizeof(LINEAR_F32_CAL_PAYLOAD_T) ) { @@ -2483,3 +2487,29 @@ // respond to request sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } + +/************************************************************************* + * @brief + * The handleSetDialysateFlowCalibration function handles a request to set + * dialysate flow calibration factors. + * @details + * Inputs : none + * Outputs : message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestSetTreatmentParameter( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + if ( message->hdr.payloadLen == sizeof(CRITICAL_DATAS_T) + sizeof(CRITICAL_DATAS_T) ) + { + CRITICAL_DATAS_T payload[2]; + + memcpy( &payload[0], message->payload, sizeof(CRITICAL_DATAS_T) * 2 ); + result = testSetTreatmentParameter( (TREATMENT_PARAM_T)payload[0].uInt, payload[1] ); + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +}