Index: firmware/App/Services/StateServices/TubeSetInstall.c =================================================================== diff -u -r9c833ef5623ce842267e284d958820ac0dc3a7fc -rc9184701abd8c6a13e48fe8393eb0ae64621f7f6 --- firmware/App/Services/StateServices/TubeSetInstall.c (.../TubeSetInstall.c) (revision 9c833ef5623ce842267e284d958820ac0dc3a7fc) +++ firmware/App/Services/StateServices/TubeSetInstall.c (.../TubeSetInstall.c) (revision c9184701abd8c6a13e48fe8393eb0ae64621f7f6) @@ -49,13 +49,15 @@ static TUBE_SET_INSTALL_STATE_T previousInstallState; ///< Previous tube set install sub-state static TUBE_SET_INSTALL_STATE_T currentInstallState; ///< Current tubing set install sub-state +static TUBE_SET_TYPE_T currentTubeSetType; ///< Current installed tube set type + // ********** private function prototypes ********** -static TUBE_SET_INSTALL_STATE_T handleAwaitTubesetConfirmationState( void ); ///< Handle Await Tubset Install Confirmation sub-state -static TUBE_SET_INSTALL_STATE_T handleAwaitBPDoorCloseState( void ); ///< Handle Await Blood Pump Door Close sub-state. -static TUBE_SET_INSTALL_STATE_T handleAutoLoadState( void ); ///< Handle Auto-Load sub-state -static TUBE_SET_INSTALL_STATE_T handleAutoLoadBackOffState( void ); ///< Handle Auto-Load Back-off sub-state -static TUBE_SET_INSTALL_STATE_T handleInstallCompleteState( void ); ///< Handle Install complete state +static TUBE_SET_INSTALL_STATE_T handleAwaitTubesetConfirmationState( void ); // Handle Await Tubset Install Confirmation sub-state +static TUBE_SET_INSTALL_STATE_T handleAwaitBPDoorCloseState( void ); // Handle Await Blood Pump Door Close sub-state. +static TUBE_SET_INSTALL_STATE_T handleAutoLoadState( void ); // Handle Auto-Load sub-state +static TUBE_SET_INSTALL_STATE_T handleAutoLoadBackOffState( void ); // Handle Auto-Load Back-off sub-state +static TUBE_SET_INSTALL_STATE_T handleInstallCompleteState( void ); // Handle Install complete state /*********************************************************************//** * @brief @@ -73,6 +75,7 @@ bloodPumpTimerCounter = 0; bpLastHome = TRUE; bpLeftHomeTimerCounter = 0; + currentTubeSetType = TUBE_SET_TYPE_UNKNOWN; } /*********************************************************************//** @@ -115,8 +118,8 @@ if ( previousInstallState != currentInstallState ) { - previousInstallState = currentInstallState; SEND_EVENT_WITH_2_U32_DATA( TD_EVENT_SUB_STATE_CHANGE, previousInstallState, currentInstallState ); + previousInstallState = currentInstallState; } } @@ -332,4 +335,36 @@ return result; } +/*********************************************************************//** + * @brief + * The setTubeSetType function sets the current installed tube set type. + * @details \b Inputs: none + * @details \b Outputs: currentTubeSetType + * @param type Tube set type determined from barcode scan. + * @return none + *************************************************************************/ +void setTubeSetType( TUBE_SET_TYPE_T type ) +{ + if ( type < NUM_OF_TUBE_SET_TYPES ) + { + currentTubeSetType = type; + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_TUBE_SET_TYPE, (U32)type ); + } +} + +/*********************************************************************//** + * @brief + * The getTubeSetType function returns the current installed tube set type. + * @details \b Inputs: currentTubeSetType + * @details \b Outputs: none + * @return Current installed tube set type. + *************************************************************************/ +TUBE_SET_TYPE_T getTubeSetType( void ) +{ + return currentTubeSetType; +} + /**@}*/