Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r1d4d52365189e2cc83b97d28761bc2d4f0128859 -rc9eae083ca9c06f843ce7ebd7ef93ff47a986011 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 1d4d52365189e2cc83b97d28761bc2d4f0128859) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision c9eae083ca9c06f843ce7ebd7ef93ff47a986011) @@ -1444,14 +1444,14 @@ { BOOL result; MESSAGE_T msg; - U08 *payloadPtr = msg.payload; + DG_VALVE_SETTING_CMD_REQUEST_T valveCmd; // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_DG_CHANGE_VALVE_SETTING_CMD_REQUEST; - msg.hdr.payloadLen = sizeof( U32 ); + msg.hdr.payloadLen = sizeof( DG_VALVE_SETTING_CMD_REQUEST_T ); - memcpy( payloadPtr, &valveSettingCmd, sizeof( U32 ) ); + memcpy( &msg.payload, &valveCmd, sizeof( DG_VALVE_SETTING_CMD_REQUEST_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_DG, ACK_REQUIRED ); @@ -1474,19 +1474,18 @@ { BOOL result; MESSAGE_T msg; - U08 *payloadPtr = msg.payload; + DG_FILL_CMD_T fillPayload; + fillPayload.fillToVolMl = fillToVolumeMl; + fillPayload.cmd = cmd; + fillPayload.targetFlowRateLPM = targetFlowRateLPM; + // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_DG_FILL_CMD_REQUEST; - msg.hdr.payloadLen = sizeof( U32 ) + sizeof( U32 ) + sizeof( F32 ); + msg.hdr.payloadLen = sizeof( DG_FILL_CMD_T ); + memcpy( &msg.payload, &fillPayload, sizeof( DG_FILL_CMD_T ) ); - memcpy( payloadPtr, &fillToVolumeMl, sizeof( U32 ) ); - payloadPtr += sizeof( U32 ); - memcpy( payloadPtr, &cmd, sizeof( U32 ) ); - payloadPtr += sizeof( F32 ); - memcpy( payloadPtr, &targetFlowRateLPM, sizeof( F32 ) ); - // 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_DG, ACK_REQUIRED ); @@ -1534,14 +1533,16 @@ { BOOL result; MESSAGE_T msg; - U08 *payloadPtr = msg.payload; + DG_START_STOP_TX_CMD_REQUEST_T cmd; + cmd.start = start; + // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_STARTING_STOPPING_TREATMENT_CMD_REQUEST; - msg.hdr.payloadLen = sizeof( BOOL ); + msg.hdr.payloadLen = sizeof( DG_START_STOP_TX_CMD_REQUEST_T ); - memcpy( payloadPtr, &start, sizeof( BOOL ) ); + memcpy( &msg.payload, &cmd, sizeof( DG_START_STOP_TX_CMD_REQUEST_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_DG, ACK_REQUIRED ); @@ -1563,14 +1564,16 @@ { BOOL result; MESSAGE_T msg; - U08 *payloadPtr = msg.payload; + DG_START_STOP_TRIMMER_HEATER_CMD_T cmd; + cmd.start = start; + // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_HD_START_STOP_TRIMMER_HEATER_CMD_REQUEST; - msg.hdr.payloadLen = sizeof( BOOL ); + msg.hdr.payloadLen = sizeof( DG_START_STOP_TRIMMER_HEATER_CMD_T ); - memcpy( payloadPtr, &start, sizeof( BOOL ) ); + memcpy( &msg.payload, &cmd, sizeof( DG_START_STOP_TRIMMER_HEATER_CMD_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_DG, ACK_REQUIRED ); @@ -1595,9 +1598,9 @@ // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_DG_SAMPLE_WATER_CMD_REQUEST; - msg.hdr.payloadLen = sizeof( U32 ); + msg.hdr.payloadLen = sizeof( SAMPLE_WATER_CMD_T ); - memcpy( msg.payload, &cmd, sizeof( U32 ) ); + memcpy( &msg.payload, &cmd, sizeof( SAMPLE_WATER_CMD_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_DG, ACK_REQUIRED ); @@ -1712,13 +1715,16 @@ { BOOL result; MESSAGE_T msg; + DG_FLUSH_MODE_CMD_T cmd; + cmd.start = start; + // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_DG_START_STOP_FLUSH_CMD_REQUEST; - msg.hdr.payloadLen = sizeof( BOOL ); + msg.hdr.payloadLen = sizeof( DG_FLUSH_MODE_CMD_T ); - memcpy( msg.payload, &start, sizeof( BOOL ) ); + memcpy( &msg.payload, &cmd, sizeof( DG_FLUSH_MODE_CMD_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_DG, ACK_REQUIRED ); @@ -1741,13 +1747,16 @@ { BOOL result; MESSAGE_T msg; + DG_HEAT_DISINFECTION_MODE_CMD_T cmd; + cmd.start = start; + // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_DG_START_STOP_HEAT_DISINFECT_CMD_REQUEST; - msg.hdr.payloadLen = sizeof( BOOL ); + msg.hdr.payloadLen = sizeof( DG_HEAT_DISINFECTION_MODE_CMD_T ); - memcpy( msg.payload, &start, sizeof( BOOL ) ); + memcpy( &msg.payload, &start, sizeof( DG_HEAT_DISINFECTION_MODE_CMD_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_DG, ACK_REQUIRED ); @@ -1774,9 +1783,9 @@ // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_DG_START_STOP_CHEM_DISINFECT; - msg.hdr.payloadLen = sizeof( BOOL ); + msg.hdr.payloadLen = sizeof( DG_CHEM_DISINFECTION_MODE_CMD_T ); - memcpy( msg.payload, &start, sizeof( BOOL ) ); + memcpy( &msg.payload, &start, sizeof( DG_CHEM_DISINFECTION_MODE_CMD_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_DG, ACK_REQUIRED ); Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -rea731c287a4e43901956aaa9a0009a5ee8f4671f -rc9eae083ca9c06f843ce7ebd7ef93ff47a986011 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision ea731c287a4e43901956aaa9a0009a5ee8f4671f) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision c9eae083ca9c06f843ce7ebd7ef93ff47a986011) @@ -64,32 +64,23 @@ #define ACK_REQUIRED TRUE ///< Macro for functions that want to know if an outgoing message requires acknowledgement from receiver. #define ACK_NOT_REQUIRED FALSE ///< Macro for functions that want to know if an outgoing message requires acknowledgement from receiver. - - +#pragma pack(push, 1) typedef struct { U08 acknowledgement; ///< Acknowledgement Byte } ACK_RESPONSE_PAYLOAD_T; typedef struct { - BOOL accepted; ///< Accepted/Rejected - U32 rejectionReason; ///< Rejection reason if not accepted. -} UI_RESPONSE_PAYLOAD_T; - -typedef struct -{ U08 userRequest; ///< request to confirm, cancel, or reject off button request } UI_OFF_BUTTON_RESPONSE_PAYLOAD_T; +#pragma pack(pop) typedef struct { - U32 event; ///< Event ID - U32 dataType1; ///< Data type for data field 1 - EVENT_DATAS_T data1; ///< data field 1 - U32 dataType2; ///< Data type for data field 2 - EVENT_DATAS_T data2; ///< Data field 2 -} EVENT_PAYLOAD_T; + BOOL accepted; ///< Accepted/Rejected + U32 rejectionReason; ///< Rejection reason if not accepted. +} UI_RESPONSE_PAYLOAD_T; typedef struct { @@ -130,6 +121,15 @@ typedef struct { + U32 event; ///< Event ID + U32 dataType1; ///< Data type for data field 1 + EVENT_DATAS_T data1; ///< data field 1 + U32 dataType2; ///< Data type for data field 2 + EVENT_DATAS_T data2; ///< Data field 2 +} EVENT_PAYLOAD_T; + +typedef struct +{ U32 minTreatmentTime; ///< Minimum treatment duration (in minutes) U32 maxTreatmentTime; ///< Maximum treatment duration (in minutes) F32 minUFVolume; ///< Minimum ultrafiltration volume (in mL)