BS2_GetAuthGroup
주어진 인증 그룹을 가져옵니다.
함수
#include "BS_API.h"
int BS2_GetAuthGroup(void* context, uint32_t deviceId, uint32_t* authGroupIds, uint32_t authGroupIdCount, BS2AuthGroup** authGroupObj, uint32_t* numAuthGroup);
파라미터
-
[In]
context: Context -
[In]
deviceId: 장치 식별자 -
[In]
authGroupIds: 가져오고자 하는 auth group id 리스트 -
[In]
authGroupIdCount: auth group id 리스트의 크기 -
[Out]
authGroupObj: auth group 리스트를 저장할 포인터 -
[Out]
numAuthGroup: auth group 리스트의 개수
알아두기
authGroupObj 변수는 사용한 뒤 BS2_ReleaseObject 함수를 이용해 시스템에 메모리를 반환해야 합니다.
반환 값
성공적으로 수행될 경우 BS_SDK_SUCCESS를 반환하고, 에러가 발생할 경우 상응하는 에러 코드를 반환합니다.
샘플 코드
C++
int UserControl::getUserBlobFaceAuthGroupID(BS2User& user)
{
stringstream msg;
msg << "Please enter a authentication group ID.\n";
msg << "This is used for face authentication. [0: Not using]";
uint32_t authGroupID = Utility::getInput<uint32_t>(msg.str());
user.authGroupID = authGroupID;
return BS_SDK_SUCCESS;
}
BS2_ReleaseObject(uidObj);
C#
IntPtr authGroupIDObj = Marshal.AllocHGlobal(4 * authGroupIDList.Count);
IntPtr curAuthGroupIDObj = authGroupIDObj;
foreach (UInt32 item in authGroupIDList)
{
Marshal.WriteInt32(curAuthGroupIDObj, (Int32)item);
curAuthGroupIDObj = (IntPtr)((long)curAuthGroupIDObj + 4);
}
Console.WriteLine("Trying to get auth gruops from device.");
result = (BS2ErrorCode)API.BS2_GetAuthGroup(sdkContext, deviceID, authGroupIDObj, (UInt32)authGroupIDList.Count, out authGroupObj, out numAuthGroup);
Marshal.FreeHGlobal(authGroupIDObj);
BS2_ReleaseObject(uidObj);