当前位置: 首页>>代码示例>>C++>>正文


C++ LPPROTOCOLIMPL类代码示例

本文整理汇总了C++中LPPROTOCOLIMPL的典型用法代码示例。如果您正苦于以下问题:C++ LPPROTOCOLIMPL类的具体用法?C++ LPPROTOCOLIMPL怎么用?C++ LPPROTOCOLIMPL使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LPPROTOCOLIMPL类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SkyeTekReader_SelectTags

SKYETEK_STATUS 
SkyeTekReader_SelectTags(
    LPSKYETEK_READER            lpReader, 
    SKYETEK_TAGTYPE             tagType, 
    SKYETEK_TAG_SELECT_CALLBACK callback, 
    unsigned char               inv, 
    unsigned char               loop, 
    void                        *user
    )
{
  LPPROTOCOLIMPL lppi;
  PROTOCOL_FLAGS flags;
  ST_CALLBACK_DATA cd;

  if( lpReader == NULL || lpReader->lpProtocol == NULL || lpReader->lpDevice == NULL )
    return SKYETEK_INVALID_PARAMETER;
  
  flags.isInventory = inv;
  flags.isLoop = loop;
  cd.callback = callback;
  cd.user = user;

  lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;
  return lppi->SelectTags(lpReader,tagType,SkyeTekReader_SelectTagsCallback,flags,(void *)&cd,2000);
}
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:25,代码来源:SkyeTekReader.c

示例2: SkyeTekReader_EnterPaymentScanMode

SKYETEK_STATUS 
SkyeTekReader_EnterPaymentScanMode(
    LPSKYETEK_READER     lpReader
    )
{
  LPPROTOCOLIMPL lppi;
  if( lpReader == NULL || lpReader->lpProtocol == NULL || lpReader->lpDevice == NULL )
    return SKYETEK_INVALID_PARAMETER;
  lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;
  return lppi->EnterPaymentScanMode(lpReader, SKYETEK_TIMEOUT);
}
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:11,代码来源:SkyeTekReader.c

示例3: SkyeTekReader_Bootload

SKYETEK_STATUS 
SkyeTekReader_Bootload(
    LPSKYETEK_READER     lpReader
    )
{
  LPPROTOCOLIMPL lppi;
  if( lpReader == NULL || lpReader->lpProtocol == NULL || lpReader->lpDevice == NULL )
    return SKYETEK_INVALID_PARAMETER;
  lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;
  return lppi->Bootload(lpReader,100);
}
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:11,代码来源:SkyeTekReader.c

示例4: Iso14443ATag_SetupSecureMemoryTag

/*
// Expects
// SEQUENCE {
//   macKeyName         [1] OCTET STRING OPTIONAL,
//   macKey                 OCTET STRING,
//   cipherKeyName      [2] OCTET STRING OPTIONAL,
//   cipherKey              OCTET STRING OPTIONAL
// }
*/
SKYETEK_STATUS 
Iso14443ATag_SetupSecureMemoryTag(
    LPSKYETEK_READER          lpReader,
    LPSKYETEK_TAG             lpTag,
    LPSKYETEK_KEY             lpKeyHMAC,
    LPSKYETEK_KEY             lpKeyCipher,
		int                       useKeyDerivationFunction
    )
{
  LPPROTOCOLIMPL lppi;
  SKYETEK_STATUS status;
  LPSKYETEK_DATA lpDataS;
  st_asn1_context context;

  if( lpReader == NULL || lpReader->lpProtocol == NULL || 
      lpReader->lpProtocol->internal == NULL ||
      lpReader->lpDevice == NULL || lpTag == NULL || 
      lpKeyHMAC == NULL || lpKeyHMAC->lpData == NULL || lpKeyHMAC->lpData->data == NULL || lpKeyHMAC->lpData->size < 1 )
    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);
  if( lpKeyHMAC->name != NULL && _tcslen(lpKeyHMAC->name) > 0) {
    st_asn1_start_context_specific(context, 1);
    st_asn1_write_octet_string(context, (unsigned char *)lpKeyHMAC->name, _tcslen(lpKeyHMAC->name)*sizeof(TCHAR));
    st_asn1_finish_context_specific(context, 1);
  }
  st_asn1_write_octet_string(context, lpKeyHMAC->lpData->data, lpKeyHMAC->lpData->size);
  if( lpKeyCipher != NULL && lpKeyCipher->lpData != NULL && lpKeyCipher->lpData->data != NULL && lpKeyCipher->lpData->size > 0 ) {
    if( lpKeyCipher->name != NULL && _tcslen(lpKeyCipher->name) > 0) {
      st_asn1_start_context_specific(context, 2);
      st_asn1_write_octet_string(context, (unsigned char *)lpKeyCipher->name, _tcslen(lpKeyCipher->name)*sizeof(TCHAR));
      st_asn1_finish_context_specific(context, 2);
    }
    st_asn1_write_octet_string(context, lpKeyCipher->lpData->data, lpKeyCipher->lpData->size);
  }

	if (useKeyDerivationFunction)
		st_asn1_write_boolean(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->SetupSecureMemoryTag(lpReader,lpTag,lpDataS,10000);
  SkyeTek_FreeData(lpDataS);
  return status;
}
开发者ID:simbits,项目名称:Ad-Hoc-Dark-Roast-Network-Travel-Mug-,代码行数:63,代码来源:Iso14443ATag.c

示例5: SkyeTekReader_GetDebugMessages

SKYETEK_STATUS 
SkyeTekReader_GetDebugMessages(
  LPSKYETEK_READER     lpReader,
  LPSKYETEK_DATA      *lpData
  )
{
  LPPROTOCOLIMPL lppi;
  if( lpReader == NULL || lpReader->lpProtocol == NULL || lpReader->lpProtocol->internal == NULL )
    return SKYETEK_INVALID_PARAMETER;
  lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;
  return lppi->GetDebugMessages(lpReader, lpData,10000);
}
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:12,代码来源:SkyeTekReader.c

示例6: SkyeTekReader_AuthenticateReader

SKYETEK_STATUS 
SkyeTekReader_AuthenticateReader(
    LPSKYETEK_READER     lpReader, 
    LPSKYETEK_KEY        lpKey
    )
{
  LPPROTOCOLIMPL lppi;
  if( lpReader == NULL || lpReader->lpProtocol == NULL || 
      lpReader->lpDevice == NULL || lpKey == NULL || lpKey->lpData == NULL )
    return SKYETEK_INVALID_PARAMETER;
  lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;
  return lppi->AuthenticateReader(lpReader,lpKey->lpData,SKYETEK_TIMEOUT);
}
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:13,代码来源:SkyeTekReader.c

示例7: SkyeTekReader_ScanPayments

SKYETEK_API SKYETEK_STATUS 
SkyeTekReader_ScanPayments(
    LPSKYETEK_READER              lpReader,
    SKYETEK_PAYMENT_SCAN_CALLBACK callback,
    void                          *user
    )
{
  LPPROTOCOLIMPL lppi;
  if( lpReader == NULL || lpReader->lpProtocol == NULL || 
      lpReader->lpDevice == NULL || callback == NULL )
    return SKYETEK_INVALID_PARAMETER;
  lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;
  return lppi->ScanPayments(lpReader, callback, user, SKYETEK_TIMEOUT);
}
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:14,代码来源:SkyeTekReader.c

示例8: SkyeTekReader_UploadFirmware

SKYETEK_STATUS 
SkyeTekReader_UploadFirmware(
    LPSKYETEK_READER                      lpReader, 
    TCHAR                                  *file, 
    unsigned char                         defaultsOnly,
    SKYETEK_FIRMWARE_UPLOAD_CALLBACK      callback, 
    void                                  *user
    )
{
  LPPROTOCOLIMPL lppi;
  if( lpReader == NULL || lpReader->lpProtocol == NULL || lpReader->lpDevice == NULL )
    return SKYETEK_INVALID_PARAMETER;
  lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;
  return lppi->UploadFirmware(lpReader,file,defaultsOnly,callback,user);
}
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:15,代码来源:SkyeTekReader.c

示例9: Iso14443BTag_SendTagPassword

SKYETEK_STATUS 
Iso14443BTag_SendTagPassword(
    LPSKYETEK_READER     lpReader,
    LPSKYETEK_TAG        lpTag,
    LPSKYETEK_DATA       lpData
    )
{
  LPPROTOCOLIMPL lppi;
  if( lpReader == NULL || lpReader->lpProtocol == NULL || 
      lpReader->lpProtocol->internal == NULL ||
      lpReader->lpDevice == NULL || lpTag == NULL || 
      lpData == NULL || lpData->data == NULL || lpData->size == 0 )
    return SKYETEK_INVALID_PARAMETER;
  lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;
  return lppi->SendTagPassword(lpReader,lpTag,lpData,ISO14443B_TIMEOUT);
}
开发者ID:MikeStankavich,项目名称:skyetek-mqtt,代码行数:16,代码来源:Iso14443BTag.c

示例10: SkyeTekReader_SetDefaultSystemParameter

SKYETEK_STATUS 
SkyeTekReader_SetDefaultSystemParameter(
    LPSKYETEK_READER             lpReader, 
    SKYETEK_SYSTEM_PARAMETER     parameter, 
    LPSKYETEK_DATA               lpData
    )
{
  LPPROTOCOLIMPL lppi;
  SKYETEK_ADDRESS addr;
  SKYETEK_STATUS st;
  if( lpReader == NULL || lpReader->lpProtocol == NULL || 
      lpReader->lpDevice == NULL || lpData == NULL )
    return SKYETEK_INVALID_PARAMETER;
  lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;
  if( (st = STR_GetSystemAddrForParm(parameter,&addr,lpReader->lpProtocol->version)) != SKYETEK_SUCCESS )
    return st;
  return lppi->SetDefaultSystemParameter(lpReader,&addr,lpData,SKYETEK_TIMEOUT);
}
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:18,代码来源:SkyeTekReader.c

示例11: SkyeTekReader_LoadKey

SKYETEK_STATUS 
SkyeTekReader_LoadKey(
    LPSKYETEK_READER     lpReader, 
    LPSKYETEK_KEY        lpKey
    )
{
  LPPROTOCOLIMPL lppi;
  SKYETEK_ADDRESS addr;

  if( lpReader == NULL || lpReader->lpProtocol == NULL || 
    lpReader->lpDevice == NULL || lpKey == NULL )
    return SKYETEK_INVALID_PARAMETER;
  lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;

  addr.start = lpKey->number;
  addr.blocks = 1;

  return lppi->LoadKey(lpReader,&addr,500);
}
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:19,代码来源:SkyeTekReader.c

示例12: SkyeTekReader_StoreKey

SKYETEK_STATUS 
SkyeTekReader_StoreKey(
    LPSKYETEK_READER     lpReader,
    SKYETEK_TAGTYPE      type,
    LPSKYETEK_KEY        lpKey
    )
{
  LPPROTOCOLIMPL lppi;
  SKYETEK_ADDRESS addr;

  if( lpReader == NULL || lpReader->lpProtocol == NULL || 
    lpReader->lpDevice == NULL || lpKey == NULL || lpKey->lpData == NULL )
    return SKYETEK_INVALID_PARAMETER;
  lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;

  addr.start = lpKey->number;
  addr.blocks = 1;

  return lppi->StoreKey(lpReader,type,&addr,lpKey->lpData,SKYETEK_TIMEOUT);
}
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:20,代码来源:SkyeTekReader.c

示例13: SkyeTekReader_GetSystemParameter

SKYETEK_STATUS 
SkyeTekReader_GetSystemParameter(
    LPSKYETEK_READER             lpReader, 
    SKYETEK_SYSTEM_PARAMETER     parameter,
    LPSKYETEK_DATA               *lpData
    )
{
  LPPROTOCOLIMPL lppi;
  SKYETEK_ADDRESS addr;
  SKYETEK_STATUS st;
  if( lpReader == NULL || lpReader->lpProtocol == NULL || 
      lpReader->lpDevice == NULL || lpData == NULL )
    return SKYETEK_INVALID_PARAMETER;
  
  lppi = (LPPROTOCOLIMPL)lpReader->lpProtocol->internal;
  if( (st = STR_GetSystemAddrForParm(parameter,&addr,lpReader->lpProtocol->version)) != SKYETEK_SUCCESS )
    return st;
  if( parameter == SYS_OPTIMAL_POWER_C1G1 || parameter == SYS_OPTIMAL_POWER_C1G2 || 
    parameter == SYS_OPTIMAL_POWER_180006B || parameter == SYS_RSSI_VALUES )
    return lppi->GetSystemParameter(lpReader,&addr,lpData,10000);
  else
    return lppi->GetSystemParameter(lpReader,&addr,lpData,SKYETEK_TIMEOUT);
}
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:23,代码来源:SkyeTekReader.c

示例14: GetReader

LPSKYETEK_READER 
GetReader(
  LPSKYETEK_DEVICE    lpDevice, 
  LPPROTOCOLIMPL      lpPI,
  unsigned int        ver
  )
{
  LPSKYETEK_READER lpReader = NULL;
  SKYETEK_READER tmpReader;
  SKYETEK_STATUS status;
  SKYETEK_ADDRESS addr;
  LPSKYETEK_DATA lpData = NULL;
  TCHAR *str = NULL;
  int i = 0;
  unsigned int ix = 0;

  if( lpDevice == NULL )
    return NULL;

  /* Fill temp reader for system calls */
  if( ver == 2 )
  {
    tmpReader.id = SkyeTek_AllocateID(1);
    if( tmpReader.id != NULL )
      tmpReader.id->id[0] = 0xFF;
  }
  else
  {
    tmpReader.id = SkyeTek_AllocateID(4);
    if( tmpReader.id != NULL )
      for( i = 0; i < 4; i++ )
        tmpReader.id->id[i] = 0xFF;
  }
  tmpReader.sendRID = 1;
  tmpReader.lpDevice = lpDevice;
  tmpReader.internal = &SkyetekReaderImpl;

  status = STR_GetSystemAddrForParm(SYS_FIRMWARE,&addr,ver);
  if( status != SKYETEK_SUCCESS )
    goto failure;
  status = lpPI->GetSystemParameter(&tmpReader, &addr, &lpData,100);
  if( status != SKYETEK_SUCCESS || lpData == NULL )
    goto failure;

  lpReader = (LPSKYETEK_READER)malloc(sizeof(SKYETEK_READER));
  if( lpReader == NULL )
  {
    SkyeTek_FreeData(lpData);
    goto failure;
  }
  memset(lpReader, 0, sizeof(SKYETEK_READER));

  str = SkyeTek_GetStringFromData(lpData);
  if( str != NULL )
  {
    _tcscpy(lpReader->firmware,str);
    SkyeTek_FreeString(str);
  }

  if( ver == 2 && lpData != NULL && lpData->data != NULL && lpData->size > 0 )
  {
    switch(lpData->data[0])
    {
      case 0x00:
      case 0x01:
      case 0x50:
      case 0x60:
      case 0xA0:
      case 0xC0:
      case 0xD0:
        _tcscpy(lpReader->model, _T("M1")); 
        break;
      case 0xE0:
        _tcscpy(lpReader->model, _T("M8")); 
        break;
		  case 0x20:
        _tcscpy(lpReader->model, _T("M2")); 
        break;
		  default:
        _tcscpy(lpReader->model, _T("??")); 
    }
  }
  SkyeTek_FreeData(lpData);

  if( ver == 3 )
  {
    SKYETEK_Sleep(100);
    status = STR_GetSystemAddrForParm(SYS_PRODUCT,&addr,ver);
    if( status != SKYETEK_SUCCESS )
      goto failure;
    status = lpPI->GetSystemParameter(&tmpReader, &addr, &lpData,100);
    if( status == SKYETEK_SUCCESS && lpData->data != NULL && lpData->size >= 2 )
    {
      switch(lpData->data[1])
      {
      case 0x02:
        _tcscpy(lpReader->model, _T("M2"));
        break;
      case 0x04:
        _tcscpy(lpReader->model, _T("M4"));
//.........这里部分代码省略.........
开发者ID:MikeStankavich,项目名称:skyetek-mqtt,代码行数:101,代码来源:SkyeTekReaderFactory.c

示例15: SkyeTekReader_GetTags

SKYETEK_STATUS 
SkyeTekReader_GetTags(
    LPSKYETEK_READER   lpReader, 
    SKYETEK_TAGTYPE    tagType, 
    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->GetTags(lpReader,tagType,&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;
}
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:63,代码来源:SkyeTekReader.c


注:本文中的LPPROTOCOLIMPL类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。