Configuration API > BS2_GetCustomCardConfig


[+ 2.9.4] Custom smart card 설정을 가져옵니다.

함수

#include "BS_API.h"
 
int BS2_GetCustomCardConfig(void* context, uint32_t deviceId, BS2CustomCardConfig* config);

파라미터

  • [In] context : Context
  • [In] deviceId : 장치 식별자
  • [In] config : Custom smart card 정보를 취득할 포인터

반환값

성공적으로 수행될 경우 BS_SDK_SUCCESS를 반환하고, 에러가 발생할 경우 상응하는 에러 코드를 반환합니다.

함께 보기

샘플코드(C++)

sample_getcustomcardconfig.cpp
	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)
		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;

샘플코드(C#)

sample_getcustomcardconfig.cs
            BS2DeviceCapabilities capa;
            if (!CommonControl.getDeviceCapabilities(sdkContext, deviceID, out capa))
                return;
 
            if (!Convert.ToBoolean(capa.functionExSupported & (byte)BS2CapabilityFunctionExSupport.FUNCTIONEX_SUPPORT_CUSTOMSMARTCARD))
            {
                Console.WriteLine("Not supported function.");
                return;
            }
 
            BS2CustomCardConfig config;
            Console.WriteLine("Trying to get CustomCardConfig");
            BS2ErrorCode result = (BS2ErrorCode)API.BS2_GetCustomCardConfig(sdkContext, deviceID, out config);
            if (result != BS2ErrorCode.BS_SDK_SUCCESS)
            {
                Console.WriteLine("Got error({0}).", result);
                return;
            }
            else
            {
                print(config);
            }