Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r1f1b53030a930c542646d9d88c7db0c3a945f150 -r059eb49a6f8fd2e2277b98b4aee986eb4519820a --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 1f1b53030a930c542646d9d88c7db0c3a945f150) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 059eb49a6f8fd2e2277b98b4aee986eb4519820a) @@ -23,6 +23,7 @@ #include "Compatible.h" #include "ConcentratePumps.h" #include "ConductivitySensors.h" +#include "CPLD.h" #include "Fans.h" #include "FlowSensors.h" #include "FPGA.h" @@ -453,6 +454,7 @@ if ( message->hdr.payloadLen == sizeof( DG_CMD_DIALYSATE_HEATING_PARAMS_T ) ) { DG_CMD_DIALYSATE_HEATING_PARAMS_T payload; + result = TRUE; memcpy( &payload, message->payload, sizeof( DG_CMD_DIALYSATE_HEATING_PARAMS_T ) ); setDialysateHeatingParameters( payload ); @@ -880,8 +882,6 @@ // has been already checked in POST getNVRecord2Driver( GET_SRR_RECORD, (U08*)&scheduledService, sizeof( DG_SCHEDULED_RUN_RECORD_T ), 0, ALARM_ID_NO_ALARM ); - U08 *payloadPtr = msg.payload; - // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_DG_SCHEDULED_RUNS_DATA; @@ -3787,6 +3787,8 @@ /*********************************************************************//** * @brief + * The handleResendAllAlarmsCommand function handles a request to re-send + * all active DG alarms. * The sendUIServiceModeResponse function sends out the DG response to a * UI request to go to service mode. * @details Inputs: none @@ -3810,4 +3812,32 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } +/*********************************************************************//** + * @brief + * The handleCpldStatusRequest function handles a CPLD Status request message. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleCpldStatusRequest( MESSAGE_T *message ) +{ + MESSAGE_T msg; + CPLD_STATUS_T payload; + U08 *payloadPtr = msg.payload; + + // populate payload + getCPLDStatus( &payload ); + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_DG_CPLD_STATUS; + msg.hdr.payloadLen = sizeof( CPLD_STATUS_T ); + + // fill message payload + memcpy( payloadPtr, &payload, sizeof( CPLD_STATUS_T ) ); + + // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); +} + /**@}*/