Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r90f6438e80dbe0a32472a076a0d1bc54db65d15a -r3417fd56afc9b21fb4c2d86c75dd33ac31fbd9f1 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 90f6438e80dbe0a32472a076a0d1bc54db65d15a) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 3417fd56afc9b21fb4c2d86c75dd33ac31fbd9f1) @@ -111,7 +111,7 @@ BOOL result; MESSAGE_T msg; U32 msgSize; - U08 data[sizeof(MESSAGE_WRAPPER_T)+1+CAN_MESSAGE_PAYLOAD_SIZE]; // must hold full (wrapped) message + sync + any CAN padding + U08 data[sizeof(MESSAGE_WRAPPER_T) + 1 + CAN_MESSAGE_PAYLOAD_SIZE]; // must hold full (wrapped) message + sync + any CAN padding // create a message record blankMessage( &msg ); @@ -146,6 +146,41 @@ } /************************************************************************* + * @brief broadcastAlarmStatus + * The broadcastAlarmStatus function constructs an alarm status msg to \n + * be broadcast and queues the msg for transmit on the appropriate CAN channel. + * @details + * Inputs : none + * Outputs : alarm status msg constructed and queued. + * @param almStatus : alarm status record + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL broadcastAlarmStatus( COMP_ALARM_STATUS_T almStatus ) +{ + BOOL result; + MESSAGE_T msg; + U32 msgSize; + U08 data[sizeof(MESSAGE_WRAPPER_T) + 1 + CAN_MESSAGE_PAYLOAD_SIZE]; // must hold full (wrapped) message + sync + any CAN padding + U08 *payloadPtr = msg.payload; + + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_ALARM_STATUS; + msg.hdr.payloadLen = sizeof(COMP_ALARM_STATUS_T); + + memcpy( payloadPtr, &almStatus, sizeof(COMP_ALARM_STATUS_T) ); + + // serialize the message (w/ sync, CRC, and appropriate CAN padding) + msgSize = serializeMessage( msg, data ); + + // add serialized message data to appropriate comm buffer + result = addToCommBuffer( COMM_BUFFER_OUT_CAN_HD_ALARM, data, msgSize ); + + return result; + +} + +/************************************************************************* * @brief broadcastAlarmTriggered * The broadcastAlarmTriggered function constructs an alarm triggered msg to \n * be broadcast and queues the msg for transmit on the appropriate CAN channel. @@ -162,7 +197,7 @@ BOOL result; MESSAGE_T msg; U32 msgSize; - U08 data[sizeof(MESSAGE_WRAPPER_T)+1+CAN_MESSAGE_PAYLOAD_SIZE]; // must hold full (wrapped) message + sync + any CAN padding + U08 data[sizeof(MESSAGE_WRAPPER_T) + 1 + CAN_MESSAGE_PAYLOAD_SIZE]; // must hold full (wrapped) message + sync + any CAN padding U08 *payloadPtr = msg.payload; // create a message record @@ -199,7 +234,7 @@ BOOL result; MESSAGE_T msg; U32 msgSize; - U08 data[sizeof(MESSAGE_WRAPPER_T)+1+CAN_MESSAGE_PAYLOAD_SIZE]; // must hold full (wrapped) message + sync + any CAN padding + U08 data[sizeof(MESSAGE_WRAPPER_T) + 1 + CAN_MESSAGE_PAYLOAD_SIZE]; // must hold full (wrapped) message + sync + any CAN padding U08 *payloadPtr = msg.payload; // create a message record @@ -236,7 +271,7 @@ BOOL result; MESSAGE_T msg; U32 msgSize; - U08 data[sizeof(MESSAGE_WRAPPER_T)+1+CAN_MESSAGE_PAYLOAD_SIZE]; // must hold full (wrapped) message + sync + any CAN padding + U08 data[sizeof(MESSAGE_WRAPPER_T) + 1 + CAN_MESSAGE_PAYLOAD_SIZE]; // must hold full (wrapped) message + sync + any CAN padding U08 *payloadPtr = msg.payload; // create a message record @@ -474,6 +509,18 @@ DATA_ARRAY_OVERRIDE_HANDLER_FUNC( U32, handleTestAlarmTimeOverrideRequest, testSetAlarmStartOverride, testResetAlarmStartOverride ) /************************************************************************* + * @brief handleTestAlarmStatusBroadcastIntervalOverrideRequest + * The handleTestAlarmStatusBroadcastIntervalOverrideRequest function handles a request to \n + * override the broadcast interval for alarm status. + * @details + * Inputs : none + * Outputs : message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +DATA_OVERRIDE_HANDLER_FUNC( U32, handleTestAlarmStatusBroadcastIntervalOverrideRequest, testSetAlarmStatusPublishIntervalOverride, testResetAlarmStatusPublishIntervalOverride ) + +/************************************************************************* * @brief handleTestBloodFlowSetPointOverrideRequest * The handleTestBloodFlowSetPointOverrideRequest function handles a request to \n * override the set point for the blood flow rate (mL/min).