|
@@ -196,7 +196,7 @@ unsigned int CCardSwiperFSM::s2_on_event(FSMEvent* pEvt)
|
|
|
}
|
|
|
case USER_EVT_DEV_DISCONNECTED:
|
|
|
if (IsValidFWBName(m_csDevNo.GetData(), m_csDevNo.GetLength()))
|
|
|
- GetEntityBase()->GetFunction()->SetSysVar("FWBReConn", "D");//通知其他模块处理
|
|
|
+ GetEntityBase()->GetFunction()->SetSysVar("FWBReConn", "D");//閫氱煡鍏朵粬妯″潡澶勭悊
|
|
|
pEvt->SetHandled();
|
|
|
return 0;
|
|
|
case USER_EVT_QUERY_FWB_LIST:
|
|
@@ -268,17 +268,17 @@ unsigned int CCardSwiperFSM::s3_on_event(FSMEvent* pEvt)
|
|
|
{
|
|
|
pCRFE->ctx->Answer(Error_Succeed);
|
|
|
}
|
|
|
- else if (err == 7) {//返回的磁道数据长度有误,不再重试
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040220201").setResultCode("RTA2204")("读取磁道数据长度有误");
|
|
|
+ else if (err == 7) {//杩斿洖鐨勭�閬撴暟鎹�暱搴︽湁璇�紝涓嶅啀閲嶈瘯
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040220201").setResultCode("RTA2204")("璇诲彇纾侀亾鏁版嵁闀垮害鏈夎�");
|
|
|
LogError(Severity_High, Error_Param, CardSwiper_UserErrorCode_Invalid_Track_Size, "ReadCard error: TrackData is invalid.");
|
|
|
pCRFE->ctx->Answer(Error_Param, CardSwiper_UserErrorCode_Invalid_Track_Size);
|
|
|
}
|
|
|
else if (err == 8 || err == 9) {
|
|
|
- pCRFE->ctx->Answer(Error_Interact);//刷磁失败/ActiveContactlessICCard上电失败或交互失败,重试
|
|
|
+ pCRFE->ctx->Answer(Error_Interact);//鍒风�澶辫触/ActiveContactlessICCard涓婄數澶辫触鎴栦氦浜掑け璐ワ紝閲嶈瘯
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //QueryCardStatus返回失败
|
|
|
+ //QueryCardStatus杩斿洖澶辫触
|
|
|
DbgInfo(CSimpleStringA::Format("ReadCard::QueryCardStatus err(%d)", err));
|
|
|
pCRFE->ctx->Answer(Error_Interact);
|
|
|
}
|
|
@@ -367,7 +367,7 @@ unsigned int CCardSwiperFSM::s5_on_event(FSMEvent* pEvt)
|
|
|
{
|
|
|
case USER_EVT_DEV_DISCONNECTED:
|
|
|
if (IsValidFWBName(m_csDevNo.GetData(), m_csDevNo.GetLength()))
|
|
|
- GetEntityBase()->GetFunction()->SetSysVar("FWBReConn", "D");//通知其他模块处理
|
|
|
+ GetEntityBase()->GetFunction()->SetSysVar("FWBReConn", "D");//閫氱煡鍏朵粬妯″潡澶勭悊
|
|
|
pEvt->SetHandled();
|
|
|
break;
|
|
|
case USER_EVT_QUIT:
|
|
@@ -407,14 +407,14 @@ unsigned int CCardSwiperFSM::s6_on_event(FSMEvent* pEvt)
|
|
|
evt.status = 0;
|
|
|
SpSendBroadcast(m_pEntity->GetFunction(), SP_MSG_OF(FetchCard), SP_MSG_SIG_OF(FetchCard), evt);
|
|
|
LogEvent(Severity_Middle, LOG_EVT_CARDISSUER_OP, "CardIssuer op.");
|
|
|
- DbgInfo("客户取走卡片msg发送");
|
|
|
+ DbgInfo("瀹㈡埛鍙栬蛋鍗$墖msg鍙戦€�");
|
|
|
return 0;
|
|
|
}
|
|
|
else if (pEvt->param1 == 2) {
|
|
|
FetchCard evt;
|
|
|
evt.status = 2;
|
|
|
SpSendBroadcast(m_pEntity->GetFunction(), SP_MSG_OF(FetchCard), SP_MSG_SIG_OF(FetchCard), evt);
|
|
|
- DbgInfo("客户未取卡超时msg发送");
|
|
|
+ DbgInfo("瀹㈡埛鏈�彇鍗¤秴鏃秏sg鍙戦€�");
|
|
|
LogWarn(Severity_Middle, Error_NotInit, CardSwiper_UserErrorCode_Customer_Forget_Fectch_Card, "Customer forget fetch card.");
|
|
|
return 2;
|
|
|
}
|
|
@@ -460,7 +460,7 @@ void CCardSwiperFSM::s7_on_entry()
|
|
|
//oilyang@20220406 MachineType is NOT RVC.PAD or RVC.PAD with FWB binded,we need to show this message.
|
|
|
if (_strnicmp(m_rvcsysInfo.strMachineType.GetData(), "RVC.PAD", strlen("RVC.PAD")) != 0
|
|
|
|| (_strnicmp(m_rvcsysInfo.strMachineType.GetData(), "RVC.PAD", strlen("RVC.PAD")) == 0 && IsValidFWBName((const char*)m_csDevNo, m_csDevNo.GetLength())))
|
|
|
- ShowFatalrForConnect("多合一设备已断开连接!");
|
|
|
+ ShowFatalrForConnect("澶氬悎涓€璁惧�宸叉柇寮€杩炴帴锛�");
|
|
|
|
|
|
m_eDevState = DEVICE_STATUS_NOT_READY;
|
|
|
if (_strnicmp(m_rvcsysInfo.strMachineType.GetData(), "RVC.PAD", strlen("RVC.PAD")) != 0)
|
|
@@ -689,7 +689,7 @@ ErrorCodeEnum CCardSwiperFSM::Load(CSimpleStringA csDevSN)
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
auto pEntity = GET_DEV_ENTITY_BASE_POINTER();
|
|
|
- //oilyang@20220420 对于"FWBDevSN"的设置不再持久化,如果之前有持久化的,需要提前删除
|
|
|
+ //oilyang@20220420 瀵逛簬"FWBDevSN"鐨勮�缃�笉鍐嶆寔涔呭寲锛屽�鏋滀箣鍓嶆湁鎸佷箙鍖栫殑锛岄渶瑕佹彁鍓嶅垹闄�
|
|
|
CSimpleStringA xTmpDevNo("");
|
|
|
GetEntityBase()->GetFunction()->GetSysVar("FWBDevSN", xTmpDevNo);
|
|
|
if (!xTmpDevNo.IsNullOrEmpty())
|
|
@@ -728,7 +728,7 @@ ErrorCodeEnum CCardSwiperFSM::Load(CSimpleStringA csDevSN)
|
|
|
|
|
|
HARDWARE_ENTITY_SET_VENDOR_NAME(m_entCode, m_csVendor);
|
|
|
spConfigRun->ReadConfigValue("fwb", "version", csTmp);
|
|
|
- if (csTmp.GetLength() > 1)//如果忘记配置,则直接使用默认值8.1
|
|
|
+ if (csTmp.GetLength() > 1)//濡傛灉蹇樿�閰嶇疆锛屽垯鐩存帴浣跨敤榛樿�鍊�8.1
|
|
|
csVersion = csTmp;
|
|
|
DbgInfo(CSimpleStringA::Format("<Load>, vendor:%s,devSN:%s", csVendor.GetData(), m_csDevNo.GetData()));
|
|
|
}
|
|
@@ -756,7 +756,7 @@ ErrorCodeEnum CCardSwiperFSM::Load(CSimpleStringA csDevSN)
|
|
|
//m_adapterInfo.strPort.Clear();
|
|
|
//m_adapterInfo.strBaudrate.Clear();
|
|
|
}
|
|
|
- ///*TODO(80374374@4/3/2023): 现在应该没有有线多合一了 */
|
|
|
+ ///*TODO(80374374@4/3/2023): 鐜板湪搴旇�娌℃湁鏈夌嚎澶氬悎涓€浜� */
|
|
|
else//normal AllInOne device
|
|
|
{
|
|
|
//oilyang@20220406 AllInOne have been offline in All of Branch.
|
|
@@ -887,14 +887,14 @@ ErrorCodeEnum CCardSwiperFSM::Load(CSimpleStringA csDevSN)
|
|
|
{
|
|
|
m_bOpened = false;
|
|
|
LogWarn(Severity_Middle, Error_Unexpect, CardSwiper_UserErrorCode_Open_Failed
|
|
|
- , CSimpleStringA::Format("读卡器打开失败:%s", m_csDevNo.GetData()));
|
|
|
+ , CSimpleStringA::Format("璇诲崱鍣ㄦ墦寮€澶辫触:%s", m_csDevNo.GetData()));
|
|
|
return Error_DevCommFailed;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
m_bOpened = true;
|
|
|
LogWarn(Severity_Low, Error_Unexpect, CardSwiper_UserErrorCode_Open_Success
|
|
|
- , CSimpleStringA::Format("读卡器打开成功:%s", m_csDevNo.GetData()));
|
|
|
+ , CSimpleStringA::Format("璇诲崱鍣ㄦ墦寮€鎴愬姛:%s", m_csDevNo.GetData()));
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
}
|
|
@@ -904,7 +904,7 @@ void vSJLTransToGM(PBYTE pENCData, BYTE bENCDataLength)
|
|
|
{
|
|
|
BYTE bResponseData[512];
|
|
|
BYTE dwDataInLen = 0;
|
|
|
- //把C1C2C3调整为C1C3C2
|
|
|
+ //鎶奀1C2C3璋冩暣涓篊1C3C2
|
|
|
dwDataInLen = bENCDataLength - 0x60;
|
|
|
memcpy(bResponseData, pENCData, bENCDataLength);
|
|
|
memcpy(pENCData, bResponseData, 64);
|
|
@@ -976,7 +976,7 @@ int CCardSwiperFSM::Initial(CSimpleStringA csDevSN, bool bInitChannel)
|
|
|
else
|
|
|
{
|
|
|
DbgInfo(CSimpleStringA::Format("The device is disconnected rc(%d), online(%d).", eErr, online));
|
|
|
- //设备断开 --Josephus at 9:51:12 2016126
|
|
|
+ //璁惧�鏂�紑 --Josephus at 9:51:12 2016126
|
|
|
m_eDevState = DEVICE_STATUS_NOT_READY;
|
|
|
m_connStatus = 0;
|
|
|
nRes = 1;
|
|
@@ -1004,11 +1004,11 @@ static CSimpleStringA GetStrData(TrackInfo trackInfo)
|
|
|
strRet = (char*)trackInfo.data;
|
|
|
break;
|
|
|
case CI_DATA_INVALID:
|
|
|
- strRet = "无效数据";
|
|
|
+ strRet = "鏃犳晥鏁版嵁";
|
|
|
break;
|
|
|
//case CI_DATA_MISSING:
|
|
|
default:
|
|
|
- strRet = "数据丢失";
|
|
|
+ strRet = "鏁版嵁涓㈠け";
|
|
|
}
|
|
|
return strRet;
|
|
|
}
|
|
@@ -1101,7 +1101,7 @@ int CCardSwiperFSM::ReadCard(SpReqAnsContext<CardSwiperService_Read_Req, CardSwi
|
|
|
}
|
|
|
|
|
|
FetchCard evt;
|
|
|
- evt.status = 3;//oilyang@20190507 用于通知ContactlessCard取消等待读卡
|
|
|
+ evt.status = 3;//oilyang@20190507 鐢ㄤ簬閫氱煡ContactlessCard鍙栨秷绛夊緟璇诲崱
|
|
|
SpSendBroadcast(m_pEntity->GetFunction(), SP_MSG_OF(FetchCard), SP_MSG_SIG_OF(FetchCard), evt);
|
|
|
ctx->Ans.t2Account = ctx->Ans.ICData = "";
|
|
|
|
|
@@ -1131,11 +1131,11 @@ int CCardSwiperFSM::ReadCard(SpReqAnsContext<CardSwiperService_Read_Req, CardSwi
|
|
|
{
|
|
|
if (magTracks.track[1].data[i] < 0x30
|
|
|
|| (magTracks.track[1].data[i] > 0x39 &&
|
|
|
- (magTracks.track[1].data[i] != 0x3d && magTracks.track[1].data[i] != 0x3e && magTracks.track[1].data[i] != 0x44)))//fixpoint 运通卡分隔符还要考虑为D的情况
|
|
|
+ (magTracks.track[1].data[i] != 0x3d && magTracks.track[1].data[i] != 0x3e && magTracks.track[1].data[i] != 0x44)))//fixpoint 杩愰€氬崱鍒嗛殧绗﹁繕瑕佽€冭檻涓篋鐨勬儏鍐�
|
|
|
{
|
|
|
//oilyang 20160523
|
|
|
//not '0'-'9' or '=' or '>'
|
|
|
- //非法字符告警
|
|
|
+ //闈炴硶瀛楃�鍛婅�
|
|
|
CSimpleStringA invalidChar = CSimpleStringA::Format("invalid char(%c) in track2", magTracks.track[1].data[i]);
|
|
|
LogWarn(Severity_Middle, Error_Unexpect, CardSwiper_UserErrorCode_Has_Invalid_Char_In_Track2, invalidChar.GetData());
|
|
|
return 8;
|
|
@@ -1456,19 +1456,19 @@ int CCardSwiperFSM::PreOnline(SpReqAnsContext<CardSwiperService_PreOnline_Req, C
|
|
|
}
|
|
|
if (retDetectAndRead < 0)
|
|
|
{
|
|
|
- // -1和-2是上电或APDU交互失败,功能集循环调用
|
|
|
+ // -1鍜�-2鏄�笂鐢垫垨APDU浜や簰澶辫触锛屽姛鑳介泦寰�幆璋冪敤
|
|
|
if (retDetectAndRead == -1) {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040220202").setResultCode("RTA2201")("IC卡上电失败");
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040220202").setResultCode("RTA2201")("IC鍗′笂鐢靛け璐�");
|
|
|
SetErrPackage("PreOnline::DetectAndReadICData(-1)", m_csDevNo, Error_Unexpect, MEC_DEVAPI_CARDSWIPER_ActiveICCard);
|
|
|
ctx->Answer(Error_Interact, AlarmDEC());
|
|
|
}
|
|
|
else if (retDetectAndRead == -2) {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040220202").setResultCode("RTA2202")("IC卡交互失败");
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040220202").setResultCode("RTA2202")("IC鍗′氦浜掑け璐�");
|
|
|
SetErrPackage("PreOnline::DetectAndReadICData(-2)", m_csDevNo, Error_Unexpect, MEC_DEVAPI_CARDSWIPER_ICCommand);
|
|
|
ctx->Answer(Error_Interact, AlarmDEC());
|
|
|
}
|
|
|
else if (retDetectAndRead == -3) {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040220202").setResultCode("RTA2202")("IC卡交互失败");
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040220202").setResultCode("RTA2202")("IC鍗′氦浜掑け璐�");
|
|
|
SetErrPackage("PreOnline::DetectAndReadICData(-3)", m_csDevNo, Error_Unexpect, MEC_DEVAPI_CARDSWIPER_ICCommand);
|
|
|
ctx->Answer(Error_Interact, AlarmDEC());
|
|
|
}
|
|
@@ -1592,25 +1592,25 @@ int CCardSwiperFSM::PreOnline(SpReqAnsContext<CardSwiperService_PreOnline_Req, C
|
|
|
actionType = "ARQC";
|
|
|
else
|
|
|
actionType = "";
|
|
|
- //【55域】
|
|
|
- // 基本域:
|
|
|
- // 9F26 8b 应用密文AC
|
|
|
- // 9F27 1b 密文信息数据
|
|
|
- // 9F10 max.32b 发卡行应用数据IAD
|
|
|
- // 9F37 4b 不可预知数
|
|
|
- // 9F36 2b 应用交易计数器ATC
|
|
|
- // 95 5b 终端验证结果TVR
|
|
|
- // 9A 3cn 交易日期(6位有效数字,YYMMDD)
|
|
|
- // 9C 1cn 交易类型(2位有效数字)
|
|
|
- // 9F02 6cn 授权金额(12位有效数字)
|
|
|
- // 5F2A 2cn 交易货币代码(3位有效数字)
|
|
|
- // 82 2b 应用交互特征AIP
|
|
|
- // 9F1A 2cn 终端国家代码(3位有效数字)
|
|
|
- // 9F03 6cn 其他金额(12位有效数字)
|
|
|
- // 9F33 3b 终端性能 "E0C900"
|
|
|
-
|
|
|
- // 可选域:
|
|
|
- //添加9F26,9F27,9F10,9F33的数据
|
|
|
+ //銆�55鍩熴€�
|
|
|
+ // 鍩烘湰鍩燂細
|
|
|
+ // 9F26 8b 搴旂敤瀵嗘枃AC
|
|
|
+ // 9F27 1b 瀵嗘枃淇℃伅鏁版嵁
|
|
|
+ // 9F10 max.32b 鍙戝崱琛屽簲鐢ㄦ暟鎹甀AD
|
|
|
+ // 9F37 4b 涓嶅彲棰勭煡鏁�
|
|
|
+ // 9F36 2b 搴旂敤浜ゆ槗璁℃暟鍣ˋTC
|
|
|
+ // 95 5b 缁堢�楠岃瘉缁撴灉TVR
|
|
|
+ // 9A 3cn 浜ゆ槗鏃ユ湡锛�6浣嶆湁鏁堟暟瀛楋紝YYMMDD锛�
|
|
|
+ // 9C 1cn 浜ゆ槗绫诲瀷锛�2浣嶆湁鏁堟暟瀛楋級
|
|
|
+ // 9F02 6cn 鎺堟潈閲戦�锛�12浣嶆湁鏁堟暟瀛楋級
|
|
|
+ // 5F2A 2cn 浜ゆ槗璐у竵浠g爜锛�3浣嶆湁鏁堟暟瀛楋級
|
|
|
+ // 82 2b 搴旂敤浜や簰鐗瑰緛AIP
|
|
|
+ // 9F1A 2cn 缁堢�鍥藉�浠g爜锛�3浣嶆湁鏁堟暟瀛楋級
|
|
|
+ // 9F03 6cn 鍏朵粬閲戦�锛�12浣嶆湁鏁堟暟瀛楋級
|
|
|
+ // 9F33 3b 缁堢�鎬ц兘 "E0C900"
|
|
|
+
|
|
|
+ // 鍙�€夊煙锛�
|
|
|
+ //娣诲姞9F26,9F27,9F10,9F33鐨勬暟鎹�
|
|
|
char* pCID = new char[4];
|
|
|
ZeroMemory(pCID, 4);
|
|
|
HexBuf2StrBuf(&bt9f27, &pCID, 1);
|
|
@@ -1850,7 +1850,7 @@ int CCardSwiperFSM::QueryConnInfo(int nFlag /* = 0*/)
|
|
|
EnterCriticalSection(&g_csCntStatus);
|
|
|
//Dbg("to call IfDevOnline");
|
|
|
eErr = m_hDevHelper->IfDevOnline(online);
|
|
|
- //oilyang@20200922 之前给厂商加日志,投产时需要加条件去掉没有变化时的日志输出
|
|
|
+ //oilyang@20200922 涔嬪墠缁欏巶鍟嗗姞鏃ュ織锛屾姇浜ф椂闇€瑕佸姞鏉′欢鍘绘帀娌℃湁鍙樺寲鏃剁殑鏃ュ織杈撳嚭
|
|
|
if (eErr != eEverErr || online != everOnline)
|
|
|
{
|
|
|
eEverErr = eErr;
|
|
@@ -1885,7 +1885,7 @@ int CCardSwiperFSM::QueryConnInfo(int nFlag /* = 0*/)
|
|
|
{
|
|
|
preConnStatus = 1;
|
|
|
SendDevStatusMsg(1);
|
|
|
- DbgInfo("设备连接正常");
|
|
|
+ DbgInfo("璁惧�杩炴帴姝e父");
|
|
|
if (!m_bDoingBindFWB)//oilyang@20200407 being in BindFWB,no need to post event
|
|
|
PostEventFIFO(new FSMEvent(USER_EVT_DEV_CONNECTED));
|
|
|
}
|
|
@@ -1897,7 +1897,7 @@ int CCardSwiperFSM::QueryConnInfo(int nFlag /* = 0*/)
|
|
|
{
|
|
|
preConnStatus = 0;
|
|
|
SendDevStatusMsg(0);
|
|
|
- DbgWarn("设备连接断开");
|
|
|
+ DbgWarn("璁惧�杩炴帴鏂�紑");
|
|
|
PostEventFIFO(new FSMEvent(USER_EVT_DEV_DISCONNECTED));
|
|
|
}
|
|
|
m_connStatus = 0;
|
|
@@ -1916,15 +1916,15 @@ int CCardSwiperFSM::QueryConnInfo(int nFlag /* = 0*/)
|
|
|
int newFlag = GetAAState();
|
|
|
if (newFlag == 0)
|
|
|
{
|
|
|
- if (count > 60)//60*2 = 120s,两分钟
|
|
|
+ if (count > 60)//60*2 = 120s,涓ゅ垎閽�
|
|
|
{
|
|
|
- DbgInfo("两分钟内通道未建立,再次尝试建立");
|
|
|
+ DbgInfo("涓ゅ垎閽熷唴閫氶亾鏈�缓绔嬶紝鍐嶆�灏濊瘯寤虹珛");
|
|
|
OldFlag = ProcessEnChannel();
|
|
|
count = 0;
|
|
|
}
|
|
|
else if (count != 0 && OldFlag != 0)
|
|
|
{
|
|
|
- DbgInfo("准入状态成功,再次尝试建立");
|
|
|
+ DbgInfo("鍑嗗叆鐘舵€佹垚鍔燂紝鍐嶆�灏濊瘯寤虹珛");
|
|
|
OldFlag = ProcessEnChannel();
|
|
|
count = 0;
|
|
|
}
|
|
@@ -1999,12 +1999,12 @@ int CCardSwiperFSM::TransInitEx(bool bPassvie/* = false*/)
|
|
|
char random_key[128];
|
|
|
unsigned char tbuf[4096];
|
|
|
int iloop;
|
|
|
- //取随机因子
|
|
|
+ //鍙栭殢鏈哄洜瀛�
|
|
|
srand((int)time(NULL));
|
|
|
for (iloop = 0; iloop < 32; iloop++)
|
|
|
tbuf[iloop] = rand() % 256;
|
|
|
SP::Module::Util::ConvAscii(tbuf, random_key, 32);
|
|
|
- //随机数2
|
|
|
+ //闅忔満鏁�2
|
|
|
|
|
|
BYTE r2[16];
|
|
|
ZeroMemory(r2, 16);
|
|
@@ -2070,7 +2070,7 @@ int CCardSwiperFSM::TransInitEx(bool bPassvie/* = false*/)
|
|
|
return 3;
|
|
|
}
|
|
|
DbgInfo("Set R2 ok.");
|
|
|
- //oilyang@20220915 因为国密改造,推迟启动其他实体到加密通道建立成功
|
|
|
+ //oilyang@20220915 鍥犱负鍥藉瘑鏀归€狅紝鎺ㄨ繜鍚�姩鍏朵粬瀹炰綋鍒板姞瀵嗛€氶亾寤虹珛鎴愬姛
|
|
|
if (IsValidFWBName((const char*)m_csDevNo, m_csDevNo.GetLength()))
|
|
|
{
|
|
|
LogEvent(Severity_High, LOG_EVT_CARDREADER_OPEN_SUC_FWB, CSimpleStringA::Format("FWB %s (CardSwiper)open suc.", m_csDevNo.GetData()));
|
|
@@ -2125,7 +2125,7 @@ int CCardSwiperFSM::TransInitEx(bool bPassvie/* = false*/)
|
|
|
return 4;
|
|
|
}
|
|
|
m_bNeedInitCh = false;
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402202Z101")("加密通道建立成功");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402202Z101")("鍔犲瘑閫氶亾寤虹珛鎴愬姛");
|
|
|
return 0;
|
|
|
}
|
|
|
int CCardSwiperFSM::SplitDevModelInfo()
|
|
@@ -2180,13 +2180,13 @@ int CCardSwiperFSM::ProcessEnChannel(bool bIgnore/* = false*/)
|
|
|
DbgInfo(CSimpleStringA::Format("m_csCM len:%d, m_csCM:%s, %d", m_csCM.GetLength(), m_csCM.GetData(), strlen("V2.0")));
|
|
|
if (m_csCM.GetLength() > 3 && _strnicmp(m_csCM, "V2.0", strlen("V2.0")) == 0)
|
|
|
{
|
|
|
- DbgInfo("传输加密方案V2");
|
|
|
+ DbgInfo("浼犺緭鍔犲瘑鏂规�V2");
|
|
|
if (!bIgnore)
|
|
|
{
|
|
|
int nStatus = GetAAState();
|
|
|
if (nStatus != 0)
|
|
|
{
|
|
|
- DbgWarn(CSimpleStringA::Format("准入状态无效:%d", nStatus));
|
|
|
+ DbgWarn(CSimpleStringA::Format("鍑嗗叆鐘舵€佹棤鏁堬細%d", nStatus));
|
|
|
LeaveCriticalSection(&g_csChannelStatus);
|
|
|
return nStatus;
|
|
|
}
|
|
@@ -2303,10 +2303,10 @@ void CCardSwiperFSM::InsertWaitMore()
|
|
|
}
|
|
|
int CCardSwiperFSM::IsValidFWBName(const char* pName, int len)
|
|
|
{
|
|
|
- //设备唯一标识:约定序列号以厂商简称的大写形式开头(两个字母,避免重复,需报备行方)
|
|
|
- //+“FWB” + “A” + 6 位顺序序号,如:SZ-FWB-A000001,其中“SZ”是厂家简称,“A”为迭代版
|
|
|
- // 本,分隔符为“ - ”(短横杠),共 14 个字符
|
|
|
- //厂商 xxx
|
|
|
+ //璁惧�鍞�竴鏍囪瘑锛氱害瀹氬簭鍒楀彿浠ュ巶鍟嗙畝绉扮殑澶у啓褰㈠紡寮€澶达紙涓や釜瀛楁瘝锛岄伩鍏嶉噸澶嶏紝闇€鎶ュ�琛屾柟锛�
|
|
|
+ //+鈥淔WB鈥� + 鈥淎鈥� + 6 浣嶉『搴忓簭鍙凤紝濡傦細SZ-FWB-A000001锛屽叾涓�€淪Z鈥濇槸鍘傚�绠€绉帮紝鈥淎鈥濅负杩�唬鐗�
|
|
|
+ // 鏈�紝鍒嗛殧绗︿负鈥� - 鈥濓紙鐭�í鏉狅級锛屽叡 14 涓�瓧绗�
|
|
|
+ //鍘傚晢 xxx
|
|
|
if (len != 14)
|
|
|
return 0;
|
|
|
if (_strnicmp(pName + 3, "FWB", 3) == 0)
|
|
@@ -2387,18 +2387,18 @@ int CCardSwiperFSM::nameToBthAddr(bool isSearchNearBy)
|
|
|
bdsp.fReturnUnknown = TRUE;
|
|
|
bdsp.fReturnConnected = FALSE;
|
|
|
bdsp.fIssueInquiry = TRUE;
|
|
|
- bdsp.cTimeoutMultiplier = 4;// 4 * 1.28 s 用于搜索蓝牙的时间,经验值
|
|
|
+ bdsp.cTimeoutMultiplier = 4;// 4 * 1.28 s 鐢ㄤ簬鎼滅储钃濈墮鐨勬椂闂达紝缁忛獙鍊�
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
bdsp.dwSize = sizeof(BLUETOOTH_DEVICE_SEARCH_PARAMS);
|
|
|
- bdsp.hRadio = hRadio;//设置执行搜索设备所在的句柄,应设为执行BluetoothFindFirstRadio函数所得到的句柄
|
|
|
- bdsp.fReturnAuthenticated = true;//是否搜索已配对的设备
|
|
|
- bdsp.fReturnRemembered = false;//是否搜索已记忆的设备
|
|
|
- bdsp.fReturnUnknown = false;//是否搜索未知设备
|
|
|
- bdsp.fReturnConnected = false;//是否搜索已连接的设备
|
|
|
- bdsp.fIssueInquiry = false;//是否重新搜索,True的时候会执行新的搜索,时间较长,FALSE的时候会直接返回上次的搜索结果。
|
|
|
- bdsp.cTimeoutMultiplier = 2;//指示查询超时的值,以1.28秒为增量。 例如,12.8秒的查询的cTimeoutMultiplier值为10.此成员的最大值为48.当使用大于48的值时,调用函数立即失败并返回
|
|
|
+ bdsp.hRadio = hRadio;//璁剧疆鎵ц�鎼滅储璁惧�鎵€鍦ㄧ殑鍙ユ焺锛屽簲璁句负鎵ц�BluetoothFindFirstRadio鍑芥暟鎵€寰楀埌鐨勫彞鏌�
|
|
|
+ bdsp.fReturnAuthenticated = true;//鏄�惁鎼滅储宸查厤瀵圭殑璁惧�
|
|
|
+ bdsp.fReturnRemembered = false;//鏄�惁鎼滅储宸茶�蹇嗙殑璁惧�
|
|
|
+ bdsp.fReturnUnknown = false;//鏄�惁鎼滅储鏈�煡璁惧�
|
|
|
+ bdsp.fReturnConnected = false;//鏄�惁鎼滅储宸茶繛鎺ョ殑璁惧�
|
|
|
+ bdsp.fIssueInquiry = false;//鏄�惁閲嶆柊鎼滅储锛孴rue鐨勬椂鍊欎細鎵ц�鏂扮殑鎼滅储锛屾椂闂磋緝闀匡紝FALSE鐨勬椂鍊欎細鐩存帴杩斿洖涓婃�鐨勬悳绱㈢粨鏋溿€�
|
|
|
+ bdsp.cTimeoutMultiplier = 2;//鎸囩ず鏌ヨ�瓒呮椂鐨勫€硷紝浠�1.28绉掍负澧為噺銆� 渚嬪�锛�12.8绉掔殑鏌ヨ�鐨刢TimeoutMultiplier鍊间负10.姝ゆ垚鍛樼殑鏈€澶у€间负48.褰撲娇鐢ㄥぇ浜�48鐨勫€兼椂锛岃皟鐢ㄥ嚱鏁扮珛鍗冲け璐ュ苟杩斿洖
|
|
|
}
|
|
|
DbgInfo("start to BluetoothFindFirstDevice");
|
|
|
hbf = BluetoothFindFirstDevice(&bdsp, &bdi);
|
|
@@ -2502,7 +2502,7 @@ int CCardSwiperFSM::ScanNearbyBTDevice()
|
|
|
result = WSALookupServiceBegin(&querySet, flags, &hLookup);
|
|
|
}
|
|
|
|
|
|
- bool bFirst = false;//oilyang@20170802 暂时不用
|
|
|
+ bool bFirst = false;//oilyang@20170802 鏆傛椂涓嶇敤
|
|
|
if (result == 0)
|
|
|
{
|
|
|
i = 0;
|
|
@@ -2602,7 +2602,7 @@ int CCardSwiperFSM::QueryFWBList(SpReqAnsContext<CardSwiperService_QueryFWBList_
|
|
|
ctx->Ans.fwbNo.Append(&(it->name), 0, 1);
|
|
|
}
|
|
|
LeaveCriticalSection(&g_csFwbRecord);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040220210")("查询蓝牙多合一列表成功");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040220210")("鏌ヨ�钃濈墮澶氬悎涓€鍒楄〃鎴愬姛");
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
return fsmState;
|
|
|
}
|
|
@@ -2617,8 +2617,8 @@ int CCardSwiperFSM::BindFWB(SpReqAnsContext<CardSwiperService_BindFWB_Req, CardS
|
|
|
ErrorCodeEnum eErr = Error_Unexpect;
|
|
|
int ret = fsmState;;
|
|
|
switch (ctx->Req.type)
|
|
|
- {//绑定类型:0:查询绑定,如果绑定则返回绑定设备序列号;1:绑定; 2:解绑
|
|
|
- case 0://查询绑定,如果绑定则返回绑定设备序列号
|
|
|
+ {//缁戝畾绫诲瀷锛�0锛氭煡璇㈢粦瀹氾紝濡傛灉缁戝畾鍒欒繑鍥炵粦瀹氳�澶囧簭鍒楀彿锛�1锛氱粦瀹氾紱 2锛氳В缁�
|
|
|
+ case 0://鏌ヨ�缁戝畾锛屽�鏋滅粦瀹氬垯杩斿洖缁戝畾璁惧�搴忓垪鍙�
|
|
|
ctx->Ans.fwbNo = "";
|
|
|
if (IsValidFWBName(m_csDevNo.GetData(), m_csDevNo.GetLength()))
|
|
|
{
|
|
@@ -2626,7 +2626,7 @@ int CCardSwiperFSM::BindFWB(SpReqAnsContext<CardSwiperService_BindFWB_Req, CardS
|
|
|
}
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
break;
|
|
|
- case 1://绑定
|
|
|
+ case 1://缁戝畾
|
|
|
if (IsValidFWBName(m_csDevNo.GetData(), m_csDevNo.GetLength()))
|
|
|
{
|
|
|
DbgWarn(CSimpleStringA::Format("have already bind to %s", m_csDevNo.GetData()));
|
|
@@ -2645,7 +2645,7 @@ int CCardSwiperFSM::BindFWB(SpReqAnsContext<CardSwiperService_BindFWB_Req, CardS
|
|
|
int retInit = Initial(ctx->Req.fwbNo, false);
|
|
|
if (retInit == 0)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040220211")("绑定%s成功", ctx->Req.fwbNo.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040220211")("缁戝畾%s鎴愬姛", ctx->Req.fwbNo.GetData());
|
|
|
AfterBindUpdateFWBNameToRunCfg(ctx->Req.fwbNo.GetData(), true);
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
Sleep(3000);
|
|
@@ -2655,7 +2655,7 @@ int CCardSwiperFSM::BindFWB(SpReqAnsContext<CardSwiperService_BindFWB_Req, CardS
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040220211").setResultCode("RTA2203")("绑定后初始化蓝牙多合一失败");
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040220211").setResultCode("RTA2203")("缁戝畾鍚庡垵濮嬪寲钃濈墮澶氬悎涓€澶辫触");
|
|
|
//ClearHandleOjbects();
|
|
|
m_csDevNo = "";
|
|
|
m_adapterInfo.strVendor = "";
|
|
@@ -2666,7 +2666,7 @@ int CCardSwiperFSM::BindFWB(SpReqAnsContext<CardSwiperService_BindFWB_Req, CardS
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case 2://解绑
|
|
|
+ case 2://瑙g粦
|
|
|
if (m_csDevNo.GetLength() < 1)
|
|
|
{
|
|
|
DbgInfo("no bind relation in local.");
|
|
@@ -2724,10 +2724,10 @@ ErrorCodeEnum CCardSwiperFSM::AfterBindUpdateFWBNameToRunCfg(const char* name, b
|
|
|
}
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
-//定期扫描,功能:
|
|
|
-//1.搜索附近符合FWB规范的蓝牙,在业务取列表式,直接返回;对性能的影响?
|
|
|
-//2.如果绑定过蓝牙多合一,而没有连接上,在搜索结果中发现对应序列号设备,定期尝试连接;
|
|
|
-//3.如果蓝牙多合一已经连接上或者旧版多合一打开成功,不做任何事情
|
|
|
+//瀹氭湡鎵�弿锛屽姛鑳斤細
|
|
|
+//1.鎼滅储闄勮繎绗﹀悎FWB瑙勮寖鐨勮摑鐗欙紝鍦ㄤ笟鍔″彇鍒楄〃寮忥紝鐩存帴杩斿洖;瀵规€ц兘鐨勫奖鍝嶏紵
|
|
|
+//2.濡傛灉缁戝畾杩囪摑鐗欏�鍚堜竴锛岃€屾病鏈夎繛鎺ヤ笂锛屽湪鎼滅储缁撴灉涓�彂鐜板�搴斿簭鍒楀彿璁惧�锛屽畾鏈熷皾璇曡繛鎺ワ紱
|
|
|
+//3.濡傛灉钃濈墮澶氬悎涓€宸茬粡杩炴帴涓婃垨鑰呮棫鐗堝�鍚堜竴鎵撳紑鎴愬姛锛屼笉鍋氫换浣曚簨鎯�
|
|
|
int CCardSwiperFSM::FWBBluetoothScanTask()
|
|
|
{
|
|
|
while (1)
|