|
|
@@ -2192,46 +2192,78 @@ void UIServiceSession::Handle_StartRemoteRecord(SpReqAnsContext<UIService_StartR
|
|
|
DbgToBeidou(ctx->link, __FUNCTION__)();
|
|
|
ErrorCodeEnum rc = Error_DevNotAvailable;
|
|
|
|
|
|
- CSimpleStringA camstate("");
|
|
|
CSimpleStringA soundcardstate("");
|
|
|
- m_pEntity->GetFunction()->GetSysVar(SYSVAR_CAMERASTATE,camstate);
|
|
|
m_pEntity->GetFunction()->GetSysVar(SYSVAR_SOUNDCARDSTATE, soundcardstate);
|
|
|
- if ((camstate[0] == 'N' || camstate[0] == 'O') && ('N' == soundcardstate[0] || 'P' == soundcardstate[0])) {
|
|
|
- rc = m_pEntity->StartRemoteRecord(EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName)));
|
|
|
- if (Error_Succeed == rc) {
|
|
|
- LogEvent(Severity_Middle, LOG_EVT_UI_STARTREMOTERECORD, GetVideoRecordInfo(CSimpleStringW2A(ctx->Req.VideoName)).GetData());
|
|
|
- ctx->Ans.ErrorCode = 0;
|
|
|
- ctx->Ans.ErrorMsg = CSimpleStringA2W("");
|
|
|
- m_pEntity->m_bSalesRecording = true;
|
|
|
- LogWarn(Severity_Low, Error_Debug, LOG_EVT_START_REMOTERECORD_SUCCESS, "start remote record success!");
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040230BZ70101")("start remote record success.");
|
|
|
+ if (1 == m_pEntity->GetRemoteRecordType()) {
|
|
|
+ if (('N' == soundcardstate[0] || 'P' == soundcardstate[0])) {
|
|
|
+ rc = m_pEntity->StartRemoteRecord(EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName)));
|
|
|
+ if (Error_Succeed == rc) {
|
|
|
+ LogEvent(Severity_Middle, LOG_EVT_UI_STARTREMOTERECORD, GetVideoRecordInfo(CSimpleStringW2A(ctx->Req.VideoName)).GetData());
|
|
|
+ ctx->Ans.ErrorCode = 0;
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("");
|
|
|
+ m_pEntity->m_bSalesRecording = true;
|
|
|
+ LogWarn(Severity_Low, Error_Debug, LOG_EVT_START_REMOTERECORD_SUCCESS, "start remote record success!");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040230BZ70101")("start remote record success.");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ rc = Error_InvalidState;
|
|
|
+ ctx->Ans.ErrorCode = Error_InvalidState;
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if ('B' == soundcardstate[0] || 'H' == soundcardstate[0]) {
|
|
|
+ rc = Error_AudioIN;
|
|
|
+ ctx->Ans.ErrorCode = Error_AudioIN;
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("免提设备故障,请联系厂商排查");
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_FAILED, "免提设备故障,请联系厂商排查");
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040230BZ70101").setResultCode("RTA3B40")("免提设备故障,请联系厂商排查");
|
|
|
}
|
|
|
else {
|
|
|
- rc = Error_InvalidState;
|
|
|
- ctx->Ans.ErrorCode = Error_InvalidState;
|
|
|
- ctx->Ans.ErrorMsg = CSimpleStringA2W("");
|
|
|
+ ctx->Ans.ErrorCode = 0x30B81002;
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("录音录像设备出现故障,请稍后重试");
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_FAILED, "录音录像设备出现故障,请稍后重试");
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040230BZ70101").setResultCode("RTA3B37")("录音录像设备出现故障,请稍后重试");
|
|
|
}
|
|
|
}
|
|
|
- else if ((camstate[0] == 'E' || 'B' == camstate[0]) && ('N' == soundcardstate[0] || 'P' == soundcardstate[0])) {
|
|
|
- ctx->Ans.ErrorCode = Error_DevNotAvailable;
|
|
|
- ctx->Ans.ErrorMsg = CSimpleStringA2W("上摄像头故障,启动录像失败");
|
|
|
- LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_FAILED, "上摄像头故障,启动录像失败");
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040230BZ70101").setResultCode("RTA3B36")("上摄像头故障,启动录像失败");
|
|
|
- }
|
|
|
- else if ((camstate[0] == 'N' || 'O' == camstate[0]) && ('B' == soundcardstate[0] || 'H' == soundcardstate[0])) {
|
|
|
- rc = Error_AudioIN;
|
|
|
- ctx->Ans.ErrorCode = Error_AudioIN;
|
|
|
- ctx->Ans.ErrorMsg = CSimpleStringA2W("免提设备故障,请联系厂商排查");
|
|
|
- LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_FAILED, "免提设备故障,请联系厂商排查");
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040230BZ70101").setResultCode("RTA3B40")("免提设备故障,请联系厂商排查");
|
|
|
- }
|
|
|
else {
|
|
|
- ctx->Ans.ErrorCode = 0x30B81002;
|
|
|
- ctx->Ans.ErrorMsg = CSimpleStringA2W("录音录像设备出现故障,请稍后重试");
|
|
|
- LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_FAILED, "录音录像设备出现故障,请稍后重试");
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040230BZ70101").setResultCode("RTA3B37")("录音录像设备出现故障,请稍后重试");
|
|
|
+ CSimpleStringA camstate("");
|
|
|
+ m_pEntity->GetFunction()->GetSysVar(SYSVAR_CAMERASTATE, camstate);
|
|
|
+ if ((camstate[0] == 'N' || camstate[0] == 'O') && ('N' == soundcardstate[0] || 'P' == soundcardstate[0])) {
|
|
|
+ rc = m_pEntity->StartRemoteRecord(EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName)));
|
|
|
+ if (Error_Succeed == rc) {
|
|
|
+ LogEvent(Severity_Middle, LOG_EVT_UI_STARTREMOTERECORD, GetVideoRecordInfo(CSimpleStringW2A(ctx->Req.VideoName)).GetData());
|
|
|
+ ctx->Ans.ErrorCode = 0;
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("");
|
|
|
+ m_pEntity->m_bSalesRecording = true;
|
|
|
+ LogWarn(Severity_Low, Error_Debug, LOG_EVT_START_REMOTERECORD_SUCCESS, "start remote record success!");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040230BZ70101")("start remote record success.");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ rc = Error_InvalidState;
|
|
|
+ ctx->Ans.ErrorCode = Error_InvalidState;
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if ((camstate[0] == 'E' || 'B' == camstate[0]) && ('N' == soundcardstate[0] || 'P' == soundcardstate[0])) {
|
|
|
+ ctx->Ans.ErrorCode = Error_DevNotAvailable;
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("上摄像头故障,启动录像失败");
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_FAILED, "上摄像头故障,启动录像失败");
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040230BZ70101").setResultCode("RTA3B36")("上摄像头故障,启动录像失败");
|
|
|
+ }
|
|
|
+ else if ((camstate[0] == 'N' || 'O' == camstate[0]) && ('B' == soundcardstate[0] || 'H' == soundcardstate[0])) {
|
|
|
+ rc = Error_AudioIN;
|
|
|
+ ctx->Ans.ErrorCode = Error_AudioIN;
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("免提设备故障,请联系厂商排查");
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_FAILED, "免提设备故障,请联系厂商排查");
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040230BZ70101").setResultCode("RTA3B40")("免提设备故障,请联系厂商排查");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ ctx->Ans.ErrorCode = 0x30B81002;
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("录音录像设备出现故障,请稍后重试");
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_FAILED, "录音录像设备出现故障,请稍后重试");
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040230BZ70101").setResultCode("RTA3B37")("录音录像设备出现故障,请稍后重试");
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
ctx->Answer(rc);
|
|
|
}
|
|
|
|