Index: firmware/App/Controllers/AirPump.c =================================================================== diff -u -raa6d45143096dfab776ce2ed7c775cfe2dd6db18 -recd6cd89ced8a30e1865eb120c0b8d080cc3cab9 --- firmware/App/Controllers/AirPump.c (.../AirPump.c) (revision aa6d45143096dfab776ce2ed7c775cfe2dd6db18) +++ firmware/App/Controllers/AirPump.c (.../AirPump.c) (revision ecd6cd89ced8a30e1865eb120c0b8d080cc3cab9) @@ -242,5 +242,42 @@ return result; } +/*********************************************************************//** + * @brief + * The testSetAirPump function sets the air pump to a given state (on/off). + * @details \b Inputs: none + * @details \b Outputs: currentAirPumpMotorPowerLevel + * @param message set message from Dialin which includes the state to set + * the air pump to. + * @return TRUE if set request is successful, FALSE if not + *************************************************************************/ +BOOL testSetAirPump( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // Verify tester has logged in with TD and override type is valid + if ( TRUE == isTestingActivated() ) + { + // Verify payload length is valid + if ( sizeof( U32 ) + sizeof( U32 ) == message->hdr.payloadLen ) + { + U08 *msgPayload = &message->payload[0]; + U32 power; + U32 state; + + memcpy( &state, msgPayload, sizeof(U32) ); + msgPayload += sizeof( U32 ); + memcpy( &power, msgPayload, sizeof( U32 ) ); + + if ( power <= AIR_PUMP_MOTOR_MAX_PWM ) + { + setAirPumpState((AIR_PUMP_STATE_T)state, (U08)power ); + result = TRUE; + } + } + } + + return result; +} /**@}*/