차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

다음 판
이전 판
ko:bs2_getusersmallinfosex [2019/05/14 13:55]
kkshin 만듦
ko:bs2_getusersmallinfosex [2021/12/30 10:49] (현재)
mark [샘플코드]
줄 1: 줄 1:
 +~~NOTOC~~
 +[[user_management_api]] > [[BS2_GetUserSmallInfosEx]]
 +
 +----
 +
 ===== BS2_GetUserSmallInfosEx ===== ===== BS2_GetUserSmallInfosEx =====
-[+ 2.6.3] 사용자 식별자에 해당하는 사용자 정보를 가져옵니다.+[+ 2.6.3] 사용자 식별자에 해당하는 사용자 정보를 가져옵니다.\\
 [[user management api#​BS2UserBlobEx]]을 이용하는 [[BS2_GetUserInfosEx]]와의 차이는 \\ [[user management api#​BS2UserBlobEx]]을 이용하는 [[BS2_GetUserInfosEx]]와의 차이는 \\
 메모리 효율을 위해 3번째 인자 BS2UserSmallBlobEx 멤버 BS2UserPhoto가 포인터 처리된 것을 제외하고 모두 동일합니다. 메모리 효율을 위해 3번째 인자 BS2UserSmallBlobEx 멤버 BS2UserPhoto가 포인터 처리된 것을 제외하고 모두 동일합니다.
줄 23: 줄 28:
 성공적으로 수행될 경우 ''​BS_SDK_SUCCESS''​를 반환하고,​ 에러가 발생할 경우 상응하는 에러 코드를 반환합니다. 성공적으로 수행될 경우 ''​BS_SDK_SUCCESS''​를 반환하고,​ 에러가 발생할 경우 상응하는 에러 코드를 반환합니다.
 \\  \\ 
 +==== 샘플코드 ====
 +C#
 +<code cpp>
 +if (result == BS2ErrorCode.BS_SDK_SUCCESS)
 +{
 +    if (numUserIds > 0)
 +    {
 +        IntPtr curUidObjs = outUidObjs;
 +        BS2UserSmallBlobEx[] userBlobs = new BS2UserSmallBlobEx[USER_PAGE_SIZE];​
 +
 +        Console.WriteLine("​Number of users : ({0}).",​ numUserIds);​
 +        for (UInt32 idx = 0; idx < numUserIds; )
 +        {
 +            UInt32 available = numUserIds - idx;
 +            if (available > USER_PAGE_SIZE)
 +            {
 +                available = USER_PAGE_SIZE;​
 +            }
 +
 +            result = (BS2ErrorCode)API.BS2_GetUserSmallInfosEx(sdkContext,​ deviceID, curUidObjs, available, userBlobs);
 +            if (result == BS2ErrorCode.BS_SDK_SUCCESS)
 +            {
 +                for (UInt32 loop = 0; loop < available; ++loop)
 +                {
 +                    print(userBlobs[loop].user);​
 +                    // don't need to release cardObj, FingerObj, FaceObj because we get only BS2User
 +                    if (userBlobs[loop].cardObjs != IntPtr.Zero)
 +                        API.BS2_ReleaseObject(userBlobs[loop].cardObjs);​
 +                    if (userBlobs[loop].fingerObjs != IntPtr.Zero)
 +                        API.BS2_ReleaseObject(userBlobs[loop].fingerObjs);​
 +                    if (userBlobs[loop].faceObjs != IntPtr.Zero)
 +                        API.BS2_ReleaseObject(userBlobs[loop].faceObjs);​
 +                    if (userBlobs[loop].user_photo_obj != IntPtr.Zero)
 +                        API.BS2_ReleaseObject(userBlobs[loop].user_photo_obj);​
 +                }
 +
 +                idx += available;
 +                curUidObjs += (int)available * BS2Environment.BS2_USER_ID_SIZE;​
 +            }
 +            else
 +            {
 +                Console.WriteLine("​Got error({0}).",​ result);
 +                break;
 +            }
 +        }
 +
 +        API.BS2_ReleaseObject(outUidObjs);​
 +    }
 +}
 +</​code>​
 +
 +
 ==== 함께 보기 ==== ==== 함께 보기 ====
 [[BS2_EnrollUserSmall]]\\ [[BS2_EnrollUserSmall]]\\
 [[BS2_EnrollUserSmallEx]]\\ [[BS2_EnrollUserSmallEx]]\\
 +[[BS2_GetUserSmallInfos]]\\
 [[BS2_GetUserSmallInfosEx]]\\ [[BS2_GetUserSmallInfosEx]]\\
 +[[BS2_GetUserSmallDatas]]\\
 [[BS2_GetUserSmallDatasEx]] [[BS2_GetUserSmallDatasEx]]