차이

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

차이 보기로 링크

ko:bs2_getlogsmallblobex [2020/08/21 14:30]
kkshin 만듦
ko:bs2_getlogsmallblobex [2021/12/30 13:07] (현재)
mark [반환값]
줄 33: 줄 33:
 ==== 반환값 ==== ==== 반환값 ====
 성공적으로 수행될 경우 ''​BS_SDK_SUCCESS''​를 반환하고,​ 에러가 발생할 경우 상응하는 에러 코드를 반환합니다. 성공적으로 수행될 경우 ''​BS_SDK_SUCCESS''​를 반환하고,​ 에러가 발생할 경우 상응하는 에러 코드를 반환합니다.
 +==== 샘플코드 ====
 +C++
 +<code cpp>
 +int LogControl::​getLogSmallBlobEx(BS2_DEVICE_ID id)
 +{
 + uint16_t mask = BS2_EVENT_MASK_USER_ID | BS2_EVENT_MASK_TEMPERATURE;​
 + const uint32_t FROM_FIRST = 0;
 + BS2_EVENT_ID eID = FROM_FIRST;
 + uint32_t amount(0), numLog(0);
 + BS2EventSmallBlobEx* blobObj = NULL;
  
 + int sdkResult = BS2_GetLogSmallBlobEx(context_,​ id, mask, eID, amount, &​blobObj,​ &​numLog);​
 + if (BS_SDK_SUCCESS != sdkResult)
 + TRACE("​BS2_GetLogSmallBlobEx call failed: %d", sdkResult);
 +
 + print(blobObj,​ numLog);
 +
 + if (blobObj)
 + {
 + if (blobObj->​imageObj)
 + BS2_ReleaseObject(blobObj->​imageObj);​
 +
 + BS2_ReleaseObject(blobObj);​
 + }
 + return sdkResult;
 +}
 +</​code>​
 +
 +
 +C#
 +<code cpp>
 +outEventLogObjs = IntPtr.Zero;​
 +BS2ErrorCode result = (BS2ErrorCode)API.BS2_GetLogSmallBlobEx(sdkContext,​ deviceID, (ushort)BS2EventMaskEnum.ALL,​ lastEventId,​ amount, out outEventLogObjs,​ out outNumEventLogs);​
 +if (result != BS2ErrorCode.BS_SDK_SUCCESS)
 +{
 +    Console.WriteLine("​Got error({0}).",​ result);
 +    break;
 +}
 +</​code>​