这篇教程C++ GetSerialNumber函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetSerialNumber函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSerialNumber函数的具体用法?C++ GetSerialNumber怎么用?C++ GetSerialNumber使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetSerialNumber函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetSerialNumber// HINT: This information remains static throughout the object's lifetimeinline VmbErrorType Interface::GetSerialNumber( std::string &rStrSerial ) const{ VmbErrorType res; VmbUint32_t nLength; res = GetSerialNumber( NULL, nLength ); if ( VmbErrorSuccess == res ) { if( 0 != nLength) { try { std::vector<std::string::value_type> tmpSerial( nLength + 1, '/0'); res = GetSerialNumber( &tmpSerial[0], nLength ); if( VmbErrorSuccess == res ) { rStrSerial = &*tmpSerial.begin(); } } catch(...) { return VmbErrorResources; } } else { rStrSerial.clear(); } } return res;}
开发者ID:gaobo9109,项目名称:sick-lidar,代码行数:33,
示例2: throw/************************************************************************//** * /brief Writes a USB transfer frame down to the Manta * /param frame Pointer to the frame to be transmitted * /param forceQueued Forces this message to be queued instead of merged * * WriteFrame() is meant to be called by the Manta subclass, which defines * methods for the individual messages (setLED, etc). libmanta maintains a * message queue that gets popped from in the HandleEvents() handler. * * The default behavior is that if a message is already queued up for a given * Manta, subsequent message will be merged into the waiting message instead of * being further queued (the queued frame will be the end result of all queued * messages). forceQueued can be set to true to force the message to be queued * as a separate message instead of being merged * * Note: Because WriteFrame() accesses the same message queue that * HandleEvents() does, they should be protected from each other by a mutex on * the application level if they're being called from parallel threads. ****************************************************************************/void MantaUSB::WriteFrame(uint8_t *frame, bool forceQueued){ if(NULL == DeviceHandle) { throw(MantaNotConnectedException(this)); } MantaTxQueueEntry *queuedMessage = GetQueuedTxMessage(); if(queuedMessage && !forceQueued) { /* replace the queued packet payload with the new one */ for(int i = 0; i < OutPacketLen; ++i) { /* the first byte of the report is the report ID (0x00) */ queuedMessage->OutFrame[i+1] = frame[i]; } DebugPrint("%s-%d: (WriteFrame) Queued Transfer overwritten on Manta %d", __FILE__, __LINE__, GetSerialNumber()); } else { /* no transfer in progress, queue up a new one */ MantaTxQueueEntry *newMessage = new MantaTxQueueEntry; newMessage->OutFrame[0] = 0; newMessage->TargetManta = this; /* the first byte of the report is the report ID (0x00) */ memcpy(newMessage->OutFrame + 1, frame, OutPacketLen); txQueue.push_back(newMessage); DebugPrint("%s-%d: (WriteFrame) Transfer Queued on Manta %d", __FILE__, __LINE__, GetSerialNumber()); }}
开发者ID:LFSaw,项目名称:libmanta,代码行数:50,
示例3: HandleNewCardFoundCK_RV HandleNewCardFound(HWND hTextEdit, CK_FUNCTION_LIST_PTR functions, CK_ULONG ulCounter, CK_SLOT_ID_PTR pSlotList, PCCERT_CONTEXT* ppCertContext, CK_ULONG certContextLen){ CK_RV retVal = CKR_OK; CK_SESSION_HANDLE session_handle; retVal = (functions->C_OpenSession)(pSlotList[ulCounter], CKF_SERIAL_SESSION, NULL_PTR, NULL_PTR, &session_handle); if (retVal == CKR_OK) { CK_ULONG ulserialNumberLen = 20; CK_BYTE_PTR serialNumber = (CK_BYTE_PTR)malloc (ulserialNumberLen*sizeof(CK_BYTE)); if(serialNumber != NULL) { //get serial number of the card retVal = GetSerialNumber(hTextEdit, functions, &session_handle, serialNumber,&ulserialNumberLen); if (retVal == CKR_OK) { //register certificates of the card retVal = GetAndRegisterCertificates(hTextEdit, functions, &session_handle, serialNumber, ulserialNumberLen, ppCertContext, certContextLen); } } retVal = (functions->C_CloseSession) (session_handle); } return retVal;}
开发者ID:Andhr3y,项目名称:dcfd-mw-applet,代码行数:27,
示例4: test1int test1() { word retval; dword serialno; if (1!=OpenDLL(dtHandyscope3)) { printf("failed loading dlls/n"); return 1; } retval=InitInstrument(0); if (retval!=NO_ERROR) { printf("failed to initialize the instrument, code=%d/n", retval); CloseDLL(); return 1; } retval=GetSerialNumber(&serialno); if (retval!=NO_ERROR) { printf("could not read serial number, code=%d/n", retval); ExitInstrument(); CloseDLL(); return 1; } printf("serial no %d/n", serialno); ExitInstrument(); CloseDLL(); return 0;}
开发者ID:BackupTheBerlios,项目名称:damaris-svn,代码行数:29,
示例5: ProcessaCMD_HELLOvoid ProcessaCMD_HELLO( BYTE * buffer ){ BYTE bufOut[8]; BYTE bLog; DWORD dwSerNum; char i; if ( ModemGSM_IsReady() == FALSE ){ //enviaNACK( buffer[ EO_FIELD ], DONT_CONNECTED ); return; } bLog = EVT_SW_HELLO; Log( EVT_SW, &bLog, sizeof( BYTE )); dwSerNum = GetSerialNumber(); // altera o estado do SMS Box para conectado com o Host SetStatus( ST_COM_PC_OK ); #ifdef USE_SONDA // timer para controle de conex C++ GetServerDE函数代码示例 C++ GetSequence函数代码示例
|