本文整理汇总了C++中LPPROTOCOLIMPL::GetSystemParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ LPPROTOCOLIMPL::GetSystemParameter方法的具体用法?C++ LPPROTOCOLIMPL::GetSystemParameter怎么用?C++ LPPROTOCOLIMPL::GetSystemParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPPROTOCOLIMPL
的用法示例。
在下文中一共展示了LPPROTOCOLIMPL::GetSystemParameter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
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);
}
示例2: memset
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"));
//.........这里部分代码省略.........