|
@@ -143,10 +143,16 @@ unsigned int CUpsFSM::s2_on_event(FSMEvent* pEvt)
|
|
|
int CUpsFSM::ShutDown(SpReqAnsContext<UpsService_Shutdown_Req,UpsService_Shutdown_Ans>::Pointer ctx)
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
+
|
|
|
UpsStatusEnum eUpsStatus;
|
|
|
Dbg("shutdown time: %d, uptime: %d", ctx->Req.ShutdownTime, ctx->Req.UpTime);
|
|
|
ErrorCodeEnum err = m_hDevHelper->GetDevStatus(eUpsStatus);
|
|
|
- Dbg("(%d)status:[%d],%d,%d",err,eUpsStatus,ctx->Req.ShutdownTime,ctx->Req.UpTime);
|
|
|
+ Dbg("(%s)status:[%d],%d,%d",SpStrError(err), eUpsStatus, ctx->Req.ShutdownTime, ctx->Req.UpTime);
|
|
|
+ if (ctx->Req.ShutdownTime < 0 || ctx->Req.UpTime < 0) {
|
|
|
+ Dbg("error param");
|
|
|
+ ctx->Answer(Error_Param);
|
|
|
+ return 2; //do not jump
|
|
|
+ }
|
|
|
err = m_hDevHelper->Shutdown(ctx->Req.ShutdownTime,ctx->Req.UpTime);
|
|
|
if (err == Error_Succeed)
|
|
|
{
|