Index: firmware/App/Services/TxParams.c =================================================================== diff -u -re9e339870c5ed01230963f00d400331ab879c91f -r71790af85fc9277dc6471d58caacb5b8cd2db4ab --- firmware/App/Services/TxParams.c (.../TxParams.c) (revision e9e339870c5ed01230963f00d400331ab879c91f) +++ firmware/App/Services/TxParams.c (.../TxParams.c) (revision 71790af85fc9277dc6471d58caacb5b8cd2db4ab) @@ -190,8 +190,8 @@ static BOOL checkTreatmentParamsInRange( U32 *reasons ); static BOOL checkTreatmentParamsDependencies( U32 *reasons ); static BOOL checkUFDependencies( U32 *reasons ); -static void extractTreatmentParamsFromPayload( TREATMENT_PARAMS_DATA_PAYLOAD_T payload ); -//static void checkPressureParamsRange( TREATMENT_PARAMS_DATA_PAYLOAD_T* txParams ); +static void extractTreatmentParamsFromPayload( TREATMENT_PARAMS_DATA_RESPONSE_PAYLOAD_T payload ); +//static void checkPressureParamsRange( TREATMENT_PARAMS_DATA_RESPONSE_PAYLOAD_T* txParams ); static void sendTreatmentParamsResponse( BOOL rejected, U32 *reasons ); //static void getInstitutionalRecordEdgeValue( TREATMENT_PARAM_T param, CRITICAL_DATAS_T* value, BOOL isMin ); @@ -438,7 +438,7 @@ BOOL paramsAreInRange, paramsAreConsistent, isUFValid; BOOL result = FALSE; BOOL paramsConfirmed = FALSE; - TREATMENT_PARAMS_DATA_PAYLOAD_T params; + TREATMENT_PARAMS_DATA_RESPONSE_PAYLOAD_T params; U32 rejReasons[ NUM_OF_TREATMENT_PARAMS ]; // Initialize reject reasons to zeroes @@ -448,7 +448,7 @@ if ( sizeof( TREATMENT_PARAMS_DATA_PAYLOAD_T ) == message->hdr.payloadLen ) { // copy only the treatment parameters excluding the confirmation payload field - memcpy( ¶ms, message->payload + sizeof(BOOL), sizeof( TREATMENT_PARAMS_DATA_PAYLOAD_T ) - sizeof(BOOL) ); + memcpy( ¶ms, message->payload + sizeof(BOOL), sizeof( TREATMENT_PARAMS_DATA_RESPONSE_PAYLOAD_T ) ); // Flag indicating if the user have sent the tx params validation from pre-treatment create rx state, // so that if all params are valid, TD software will transition state to patient connection @@ -488,7 +488,7 @@ setCriticalData( &treatmentParameters[ param ], stagedParams[ param ] ); } // Send latest and final treatment parameters to UI - sendMessage( MSG_ID_TD_VALIDATED_TREATMENT_PARAMS, COMM_BUFFER_OUT_CAN_TD_2_UI, (U08*)(&stagedParams), sizeof( TREATMENT_PARAMS_DATA_PAYLOAD_T ) ); + sendMessage( MSG_ID_TD_VALIDATED_TREATMENT_PARAMS, COMM_BUFFER_OUT_CAN_TD_2_UI, (U08*)(&stagedParams), sizeof( TREATMENT_PARAMS_DATA_RESPONSE_PAYLOAD_T ) ); } // Respond to set treatment parameters request message @@ -871,10 +871,10 @@ * @param payload message payload record containing received treatment parameters * @return none *************************************************************************/ -static void extractTreatmentParamsFromPayload( TREATMENT_PARAMS_DATA_PAYLOAD_T payload ) +static void extractTreatmentParamsFromPayload( TREATMENT_PARAMS_DATA_RESPONSE_PAYLOAD_T payload ) { // Pull treatment parameters into data array so we can more easily work with them - memcpy( &stagedParams[0], &payload, sizeof(TREATMENT_PARAMS_DATA_PAYLOAD_T) ); + memcpy( &stagedParams[0], &payload, sizeof(TREATMENT_PARAMS_DATA_RESPONSE_PAYLOAD_T) ); } /*********************************************************************//** @@ -894,7 +894,7 @@ TREATMENT_PARAMS_VAL_RESP_DATA_PAYLOAD_T payload; payload.accepted = ( TRUE == rejected ? FALSE : TRUE ); - memcpy( &payload.reason[0], &reasons[0], sizeof( TREATMENT_PARAMS_DATA_PAYLOAD_T ) ); + memcpy( &payload.reason[0], &reasons[0], sizeof( TREATMENT_PARAMS_DATA_RESPONSE_PAYLOAD_T ) ); sendMessage( MSG_ID_TD_RESP_TREATMENT_PARAMS_TO_VALIDATE, COMM_BUFFER_OUT_CAN_TD_2_UI, (U08*)(&payload), sizeof( TREATMENT_PARAMS_VAL_RESP_DATA_PAYLOAD_T ) ); } @@ -1466,16 +1466,16 @@ // Verify payload length if ( 0 == message->hdr.payloadLen ) { - TREATMENT_PARAMS_DATA_PAYLOAD_T payload; + TREATMENT_PARAMS_DATA_RESPONSE_PAYLOAD_T payload; TREATMENT_PARAM_T param; // Build and publish current treatment parameters record for ( param = (TREATMENT_PARAM_T)0; param < NUM_OF_TREATMENT_PARAMS; param++ ) { stagedParams[ param ] = treatmentParameters[ param ].data; } - memcpy( (U08*)&payload, (U08*)&stagedParams[0], sizeof( TREATMENT_PARAMS_DATA_PAYLOAD_T ) ); - sendMessage( MSG_ID_TD_RSP_CURRENT_TREATMENT_PARAMETERS, COMM_BUFFER_OUT_CAN_PC, (U08*)&payload, sizeof( TREATMENT_PARAMS_DATA_PAYLOAD_T ) ); + memcpy( (U08*)&payload, (U08*)&stagedParams[0], sizeof( TREATMENT_PARAMS_DATA_RESPONSE_PAYLOAD_T ) ); + sendMessage( MSG_ID_TD_RSP_CURRENT_TREATMENT_PARAMETERS, COMM_BUFFER_OUT_CAN_PC, (U08*)&payload, sizeof( TREATMENT_PARAMS_DATA_RESPONSE_PAYLOAD_T ) ); result = TRUE; } Index: firmware/App/Services/TxParams.h =================================================================== diff -u -re9e339870c5ed01230963f00d400331ab879c91f -r71790af85fc9277dc6471d58caacb5b8cd2db4ab --- firmware/App/Services/TxParams.h (.../TxParams.h) (revision e9e339870c5ed01230963f00d400331ab879c91f) +++ firmware/App/Services/TxParams.h (.../TxParams.h) (revision 71790af85fc9277dc6471d58caacb5b8cd2db4ab) @@ -68,6 +68,35 @@ F32 ufVolume; ///< User set ultrafiltration volume (in L) } TREATMENT_PARAMS_DATA_PAYLOAD_T; +/// Record structure for a treatment parameters payload to UI. +typedef struct +{ + U32 treatmentModality; ///< User set treatment modality option + U32 hdfDilution; ///< User set HDF dilution option + U32 bloodFlowRate_mL_min; ///< User set blood flow rate (in mL/min) + U32 dialysateFlowRate_mL_min; ///< User set dialysate flow rate (in mL/min) + U32 treatmentDuration_min; ///< User set treatment duration (in min) + U32 hepDeliveryDuration_min; ///< User set Heparin delivery duration (in min) + U32 hepType; ///< User set Heparin type option + U32 dryBicarbCartSize; ///< User set dry bicarb cart size option + U32 sodium_mEq_L; ///< User set sodium (in mEq/L) + U32 bicarbonate_mEq_L; ///< User set bicarbonate (in mEq/L) + U32 dialyzerType; ///< User set dialyzer type option + U32 fluidBolusVolume_mL; ///< User set fluid bolus volume (in mL) + U32 bpInterval_min; ///< User set blood pressure measurement interval (in min) + U32 rinsebackVolume_mL; ///< User set rinseback volume (in mL) + U32 hepatitisBStatus; ///< User set Hepatitis B status option + U32 acidConcentrate; ///< User set acid concentrate option + F32 substitutionFluidVolume_L; ///< User set substitution fluid volume (in L) + F32 hepBolusVolume_mL; ///< User set Heparin bolus volume (in mL) + F32 hepDeliveryRate_mL_hr; ///< User set Heparin delivery rate (in mL/hr) + F32 dialysateTemperature_degC; ///< User set dialysate temperature (in deg C) + F32 acidKConcentrateConvFactor; ///< User set acid concentrate conversion factor + F32 ufPreWeight; ///< User set patient pre weight prior to treatment (in Kilogram) + F32 ufEstimatedTargetWeight; ///< User set patient estimated target weight after the treatment (in Kilogram) + F32 ufVolume; ///< User set ultrafiltration volume (in L) +} TREATMENT_PARAMS_DATA_RESPONSE_PAYLOAD_T; + /// Record structure for reporting all current treatment parameters to Dialin typedef struct {