本文整理汇总了C++中LPPROTOCOLIMPL::GetTagsWithMask方法的典型用法代码示例。如果您正苦于以下问题:C++ LPPROTOCOLIMPL::GetTagsWithMask方法的具体用法?C++ LPPROTOCOLIMPL::GetTagsWithMask怎么用?C++ LPPROTOCOLIMPL::GetTagsWithMask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPPROTOCOLIMPL
的用法示例。
在下文中一共展示了LPPROTOCOLIMPL::GetTagsWithMask方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateTagImpl
SKYETEK_STATUS
SkyeTekReader_GetTagsWithMask(
LPSKYETEK_READER lpReader,
SKYETEK_TAGTYPE tagType,
LPSKYETEK_ID lpTagIdMask,
LPSKYETEK_TAG **lpTags,
unsigned short *count
)
{
LPPROTOCOLIMPL lppi;
unsigned int num;
unsigned int ix = 0, iy = 0;
LPTAGTYPE_ARRAY *tagTypes = NULL;
LPSKYETEK_DATA *lpData = NULL;
SKYETEK_STATUS status;
if( lpReader == NULL || lpReader->lpProtocol == NULL || lpReader->lpDevice == NULL )
return SKYETEK_INVALID_PARAMETER;
lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;
status = lppi->GetTagsWithMask(lpReader,tagType,lpTagIdMask,&tagTypes,&lpData,&num,5000);
if( status != SKYETEK_SUCCESS )
return status;
if( num > 0 )
{
*lpTags = (LPSKYETEK_TAG *)malloc(num * sizeof(LPSKYETEK_TAG));
if( *lpTags == NULL )
{
status = SKYETEK_OUT_OF_MEMORY;
goto failure;
}
for( ix = 0; ix < num; ix++ )
{
status = CreateTagImpl(tagTypes[ix]->type, (LPSKYETEK_ID)lpData[ix], &((*lpTags)[ix]));
if( status != SKYETEK_SUCCESS )
goto failure;
}
}
*count = num;
status = SKYETEK_SUCCESS;
goto cleanup;
failure:
/* Clean up partially created tags */
for( iy = 0; iy < ix; iy ++ )
FreeTagImpl((*lpTags)[iy]);
cleanup:
/* Clean up memory from protocol */
if( lpData != NULL )
{
for( ix = 0; ix < num; ix++ )
{
SkyeTek_FreeData(lpData[ix]);
}
free(lpData);
}
if( tagTypes != NULL )
free(tagTypes);
return status;
}