本文整理汇总了C++中LPPROTOCOLIMPL::InterfaceSend方法的典型用法代码示例。如果您正苦于以下问题:C++ LPPROTOCOLIMPL::InterfaceSend方法的具体用法?C++ LPPROTOCOLIMPL::InterfaceSend怎么用?C++ LPPROTOCOLIMPL::InterfaceSend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPPROTOCOLIMPL
的用法示例。
在下文中一共展示了LPPROTOCOLIMPL::InterfaceSend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*
// Expects
// SEQUENCE {
// interface ENUMERATED { 7816-4(1) }
// CHOICE {
// iso7816-4 [1] SEQUENCE {
// CLA OCTET-STRING,
// INS OCTET-STRING,
// P1_P2 OCTET-STRING,
// DATA OCTET-STRING OPTIONAL,
// Le INTEGER }
// }
// }
// Returns
// OCTET-STRING
*/
SKYETEK_STATUS
Iso14443ATag_TransportSend(
LPSKYETEK_READER lpReader,
LPSKYETEK_TAG lpTag,
SKYETEK_TRANSPORT transport,
SKYETEK_BLOCK block,
LPSKYETEK_DATA lpCla,
LPSKYETEK_DATA lpIns,
LPSKYETEK_DATA lpP1p2,
LPSKYETEK_DATA lpData,
unsigned int le,
LPSKYETEK_DATA *lpRecvData
)
{
LPPROTOCOLIMPL lppi;
SKYETEK_STATUS status;
LPSKYETEK_DATA lpDataS;
LPSKYETEK_DATA lpDataR = NULL;
st_asn1_context context;
int64 w;
if( lpReader == NULL || lpReader->lpProtocol == NULL ||
lpReader->lpProtocol->internal == NULL ||
lpReader->lpDevice == NULL || lpTag == NULL ||
lpCla == NULL || lpCla->data == NULL || lpCla->size == 0 ||
lpIns == NULL || lpIns->data == NULL || lpIns->size == 0 ||
lpP1p2 == NULL || lpP1p2->data == NULL || lpP1p2->size == 0 ||
lpRecvData == NULL )
return SKYETEK_INVALID_PARAMETER;
lpDataS = SkyeTek_AllocateData(1024);
if( lpDataS == NULL )
return SKYETEK_OUT_OF_MEMORY;
st_asn1_allocate_context(&context);
st_asn1_init(context, ST_ASN1_ENCODE,lpDataS->data,lpDataS->size);
st_asn1_start_sequence(context);
w = transport;
st_asn1_write_enumerated(context,w);
if( transport == T7816D4 )
{
st_asn1_start_context_specific(context, 1);
st_asn1_start_sequence(context);
st_asn1_write_octet_string(context, lpCla->data, lpCla->size);
st_asn1_write_octet_string(context, lpIns->data, lpIns->size);
st_asn1_write_octet_string(context, lpP1p2->data, lpP1p2->size);
if( lpData != NULL && lpData->data != NULL && lpData->size > 0 )
st_asn1_write_octet_string(context, lpData->data, lpData->size);
w = le;
st_asn1_write_integer(context,w);
st_asn1_finish_sequence(context);
st_asn1_finish_context_specific(context, 1);
}
st_asn1_finish_sequence(context);
lpDataS->size = st_asn1_finalize(context);
st_asn1_free_context(&context);
lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;
status = lppi->InterfaceSend(lpReader,lpTag,lpDataS,&lpDataR,5000);
if( status != SKYETEK_SUCCESS )
{
SkyeTek_FreeData(lpDataS);
return status;
}
if( lpDataR == NULL || lpDataR->data == NULL || lpDataR->size == 0 )
return SKYETEK_SUCCESS;
*lpRecvData = SkyeTek_AllocateData(lpDataR->size);
if( *lpRecvData == NULL )
return SKYETEK_OUT_OF_MEMORY;
st_asn1_allocate_context(&context);
st_asn1_init(context, ST_ASN1_ENCODE,lpDataR->data,lpDataR->size);
st_asn1_read_octet_string(context, (*lpRecvData)->data, &(*lpRecvData)->size);
st_asn1_free_context(&context);
return SKYETEK_SUCCESS;
}