Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
en:bs2_getcustomcardconfig [2023/08/31 21:32]
kkshin [Sample Code(C#)]
en:bs2_getcustomcardconfig [2023/08/31 21:36] (current)
kkshin [Sample Code(C++)]
Line 27: Line 27:
  
 <file cpp sample_getcustomcardconfig.cpp>​ <file cpp sample_getcustomcardconfig.cpp>​
- int sdkResult = BS2_GetCustomCardConfig(context_, ​id, &config);+ ConfigControl cc(context);​ 
 + DeviceControl dc(context);​ 
 + BS2DeviceCapabilities capabilies = { 0, }; 
 + BS2CustomCardConfig config = { 0, }; 
 + 
 + BS2_DEVICE_ID id = Utility::​getSelectedDeviceID(device);​ 
 + 
 + int sdkResult = dc.getDeviceCapabilities(id, capabilies);
  if (BS_SDK_SUCCESS != sdkResult)  if (BS_SDK_SUCCESS != sdkResult)
- printf("BS2_GetCustomCardConfig call failed%d", sdkResult);+ return sdkResult;​ 
 + 
 + if (!capabilies.customSmartCardSupported) 
 +
 + TRACE("Not supported function."​);​ 
 + return BS_SDK_ERROR_NOT_SUPPORTED;​ 
 +
 + 
 + sdkResult = cc.getCustomCardConfig(id,​ config); 
 + if (BS_SDK_SUCCESS == sdkResult) 
 + ConfigControl::​print(config);​ 
 + else 
 + return sdkResult;​ 
 + 
 + if (Utility::​isYes("Do you want to scan card test?"​)) 
 +
 + UserControl uc(context);​ 
 + BS2Card cardID; 
 + 
 + sdkResult = uc.scanCard(id&​cardID);​ 
 + if (BS_SDK_SUCCESS == sdkResult
 + UserControl::​print(cardID); 
 +
  return sdkResult;  return sdkResult;
 </​file>​ </​file>​