• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ HexDump函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: LogExcess

int USBRelayOutput::RawSendData(unsigned char *channelData)
{
	LogExcess(VB_CHANNELOUT, "USBRelayOutput::RawSendData(%p)\n", channelData);

	char out       = 0x00;
	int  shiftBits = 0;

	for (int i = 0; i < m_relayCount; i++)
	{
		if ((i > 0) && ((i % 8) == 0))
		{
			// Write out previous byte
HexDump("out", &out, 1);
			write(m_fd, &out, 1);

			out = 0x00;
			shiftBits = 0;
		}

		out |= (channelData[i] ? 1 : 0) << shiftBits;
		shiftBits++;
	}

	// Write out any unwritten bits
	if (m_relayCount)
{
		write(m_fd, &out, 1);
HexDump("out", &out, 1);
}

	return m_relayCount;
}
开发者ID:bagumondigi,项目名称:fpp,代码行数:32,代码来源:USBRelay.cpp


示例2: FalconQueryHardware

void FalconQueryHardware(int sock, struct sockaddr_in *srcAddr,
	struct in_addr recvAddr, unsigned char *inBuf)
{
	LogDebug(VB_SETTING, "FalconQueryHardware(%p)\n", inBuf);
	// Return config information, Falcon hardware info, network IP info, etc.

	char buf[60];
	bzero(buf, sizeof(buf));

	char query[FALCON_CFG_BUF_SIZE];

	int responseSize = FalconDetectHardware(0, query);

	if (responseSize == FALCON_CFG_BUF_SIZE)
	{
		// Stuff response into our response packet. We could use memcpy, but
		// this helps document what the returned bytes are.
		buf[52] = query[0]; // Hardware ID
		buf[53] = query[1]; // Firmware Major Version
		buf[54] = query[2]; // Firmware Minor Version
		buf[55] = query[3]; // Chip Temperature
		buf[56] = query[4]; // Temperature #1
		buf[57] = query[5]; // Temperature #2
		buf[58] = query[6]; // Voltage #1
		buf[59] = query[7]; // Voltage #2

		if ((logLevel & LOG_DEBUG) && (logMask & VB_SETTING))
			HexDump("Falcon Hardware Query Info Response", query, 8);
	}
	else
	{
		LogErr(VB_SETTING, "Error retrieving hardware data via SPI\n");
	}

	buf[0] = 0x55;
	buf[1] = 0x55;
	buf[2] = 0x55;
	buf[3] = 0x55;
	buf[4] = 0x55;
	buf[5] = inBuf[5];
	buf[6] = 0x00; // Query Info command response

	PopulatePiConfig(inet_ntoa(recvAddr), buf);

	if ((logLevel & LOG_DEBUG) && (logMask & VB_SETTING))
		HexDump("Falcon Query Hardware result", buf, sizeof(buf));

	if(sendto(sock, buf, sizeof(buf), 0, (struct sockaddr*)srcAddr, sizeof(*srcAddr)) < 0)
	{
		LogDebug(VB_SETTING, "ERROR: sentto failed\n");
	}
}
开发者ID:FalconChristmas,项目名称:fpp,代码行数:52,代码来源:falcon.c


示例3: FalconConfigurePi

void FalconConfigurePi(int sock, struct sockaddr_in *srcAddr,
	struct in_addr recvAddr, unsigned char *inBuf)
{
	LogDebug(VB_SETTING, "FalconConfigurePi(%p)\n", inBuf);
	// Parse Network/IP info from received data and configure Pi

	char buf[53];
	bzero(buf, sizeof(buf));

	buf[0] = 0x55;
	buf[1] = 0x55;
	buf[2] = 0x55;
	buf[3] = 0x55;
	buf[4] = 0x55;
	buf[5] = inBuf[5];
	buf[6] = 0x03; // Configure Pi command response

	PopulatePiConfig(inet_ntoa(recvAddr), buf);

	if ((logLevel & LOG_DEBUG) && (logMask & VB_SETTING))
		HexDump("Falcon Configure Pi result", buf, sizeof(buf));

	if(sendto(sock, buf, sizeof(buf), 0, (struct sockaddr*)srcAddr, sizeof(*srcAddr)) < 0)
	{
		LogDebug(VB_SETTING, "ERROR: sentto failed\n");
	}
}
开发者ID:FalconChristmas,项目名称:fpp,代码行数:27,代码来源:falcon.c


示例4: FalconGetData

void FalconGetData(int sock, struct sockaddr_in *srcAddr, unsigned char *inBuf)
{
	LogDebug(VB_SETTING, "FalconGetData(%p)\n", inBuf);

	char buf[FALCON_CFG_FILE_MAX_SIZE];
	char filename[16];

	switch ((unsigned char)inBuf[5])
	{
		case 0xCC:  strcpy(filename, "Falcon.FPD");
					break;
		case 0xCD:  strcpy(filename, "Falcon.F16V2-alpha");
					break;
	}

	int bytes = FalconReadConfig(filename, buf);

	buf[6] = 0x02; // GetData command response

	if ((logLevel & LOG_DEBUG) && (logMask & VB_SETTING))
		HexDump("Falcon Get Data result", buf, 8);

	if(sendto(sock, buf, bytes, 0, (struct sockaddr*)srcAddr, sizeof(*srcAddr)) < 0)
	{
		LogDebug(VB_SETTING, "ERROR: sentto failed\n");
	}
}
开发者ID:FalconChristmas,项目名称:fpp,代码行数:27,代码来源:falcon.c


示例5: SendFPDConfig

void SendFPDConfig()
{
	int i,index;
	unsigned char bufferPixelnetDMX[PIXELNET_DMX_BUF_SIZE];

	memset(bufferPixelnetDMX,0,PIXELNET_DMX_BUF_SIZE);
	memcpy(bufferPixelnetDMX,PixelnetDMXcontrolHeader,PIXELNET_HEADER_SIZE);
	index = PIXELNET_HEADER_SIZE;
	for(i=0;i<pixelnetDMXcount;i++)
	{
		bufferPixelnetDMX[index++] = pixelnetDMX[i].type;
		bufferPixelnetDMX[index++] = (char)(pixelnetDMX[i].startChannel%256);
		bufferPixelnetDMX[index++] = (char)(pixelnetDMX[i].startChannel/256);
	}

	if (LogMaskIsSet(VB_CHANNELOUT) && LogLevelIsSet(LOG_DEBUG))
		HexDump("FPD Config Header & Data", bufferPixelnetDMX,
			PIXELNET_HEADER_SIZE + (pixelnetDMXcount*3));

	i = wiringPiSPIDataRW (0, (unsigned char *)bufferPixelnetDMX, PIXELNET_DMX_BUF_SIZE);
	if (i != PIXELNET_DMX_BUF_SIZE)
		LogErr(VB_CHANNELOUT, "Error: wiringPiSPIDataRW returned %d, expecting %d\n", i, PIXELNET_DMX_BUF_SIZE);

	delayMicroseconds (10000) ;
//	i = wiringPiSPIDataRW (0, bufferPixelnetDMX, PIXELNET_DMX_BUF_SIZE);
//	if (i != PIXELNET_DMX_BUF_SIZE)
//		LogErr(VB_CHANNELOUT, "Error: wiringPiSPIDataRW returned %d, expecting %d\n", i, PIXELNET_DMX_BUF_SIZE);
}
开发者ID:bagumondigi,项目名称:fpp,代码行数:28,代码来源:FPD.c


示例6: DVDreadBCA

s32 DVDreadBCA()
{
	s32 s32result;
	int i;

	i = 0;
	errno = 0;

#ifdef VERBOSE_FUNCTION
	PrintLog("CDVD driver: DVDreadBCA()");
#endif /* VERBOSE_FUNCTION */

	memset(&dvdbca, 0, sizeof(dvd_struct));
	dvdbca.type = DVD_STRUCT_BCA;
	s32result = ioctl(devicehandle, DVD_READ_STRUCT, &dvdbca);
	if ((s32result == -1) || (errno != 0))
	{
		dvdbca.type = 0xFF;
#ifdef VERBOSE_WARNINGS
		PrintLog("CDVD driver:   Error getting BCA: (%i) %i:%s", s32result, errno, strerror(errno));
#endif /* VERBOSE_WARNINGS */
		return(-1);
	} // ENDIF- Problem with read of physical data?

#ifdef VERBOSE_DISC_INFO
	PrintLog("CDVD driver: BCA   Length %i   Value:",
	         dvdbca.bca.len);
	for (i = 0; i < 188 - 15; i += 16)
	{
		HexDump(dvdbca.bca.value + i, 16);
	} // NEXT i- dumping whole key data
#endif /* VERBOSE_DISC_INFO */

	return(0); // Success. BCA data stored for perusal.
} // END DVDreadBCA()
开发者ID:madnessw,项目名称:thesnow,代码行数:35,代码来源:DVD.c


示例7: ReadResp

int ReadResp(int fd)
{
  int len = 0;
  struct timeval timeout;
  int nfds = fd + 1;
  fd_set readfds;
  int select_ret;

  FD_ZERO(&readfds);
  FD_SET(fd, &readfds);

  // Wait a second
  timeout.tv_sec = 1;
  timeout.tv_usec = 500000;

  fprintf(stderr,"s");
  while (select_ret = select(nfds, &readfds, NULL, NULL, &timeout) > 0)
  {
    fprintf(stderr,"1");
    DEBUGLOG(fprintf(stderr,"select_ret = %d\n",select_ret));
    len += read(fd, readbuf + len, BUFSIZE - len);
    FD_ZERO(&readfds);
    FD_SET(fd, &readfds);
    timeout.tv_sec = 0;
    timeout.tv_usec = 500000;
  }
  if (len > 0) {
    fprintf(stderr,"2");
    DEBUGLOG(fprintf(LOG, "Read:\n"));
    DEBUGLOG(HexDump(readbuf, len));
  }
  return len;
}
开发者ID:hw-1,项目名称:iphone-sms,代码行数:33,代码来源:at.c


示例8: FalconSetData

void FalconSetData(int sock, struct sockaddr_in *srcAddr, unsigned char *inBuf)
{
	LogDebug(VB_SETTING, "FalconSetData(%p)\n", inBuf);

	char filename[16];
	int  len = 0;
	int  configureHardware = 1;
	char buf[8];

	buf[0] = 0x55;
	buf[1] = 0x55;
	buf[2] = 0x55;
	buf[3] = 0x55;
	buf[4] = 0x55;
	buf[5] = inBuf[5];
	buf[6] = 0x01; // Set Data command response
	buf[7] = 0x00; // 0x00 = success, 0xFF = player busy, 0xFE SPI write failed

	strcpy(filename, "unknown");

	switch ((unsigned char)inBuf[5])
	{
		case 0xCC:  strcpy(filename, "Falcon.FPD");
					len = 1024;
					break;
		case 0xCD:  strcpy(filename, "Falcon.F16V2-alpha");
					len = 1024;
					break;
	}

	FalconWriteConfig(filename, (char *)inBuf, len);

	if (sequence->IsSequenceRunning())
	{
		if (inBuf[7] == 0x01)
		{
			playlist->StopNow();
		}
		else
		{
			configureHardware = 0;
			buf[7] = 0xFF;
		}
	}

	if (configureHardware)
	{
		int configResult = FalconConfigureHardware(filename, 0);
		if (configResult != 0)
			buf[7] = 0xFE;
	}

	if ((logLevel & LOG_DEBUG) && (logMask & VB_SETTING))
		HexDump("Falcon Set Data result", buf, sizeof(buf));

	if(sendto(sock, buf, sizeof(buf), 0, (struct sockaddr*)srcAddr, sizeof(*srcAddr)) < 0)
	{
		LogDebug(VB_SETTING, "ERROR: sentto failed\n");
	}
}
开发者ID:FalconChristmas,项目名称:fpp,代码行数:60,代码来源:falcon.c


示例9: TEST

TEST(HexDumpTest, TestFalse) {
  std::shared_ptr<Builder> b = Parser::fromJson("false");
  std::ostringstream out;
  out << HexDump(b->slice());

  ASSERT_EQ("0x19", out.str());
}
开发者ID:ObiWahn,项目名称:velocypack,代码行数:7,代码来源:testsHexDump.cpp


示例10: SendOutputBuffer

int SendOutputBuffer(FPDPrivData *privData)
{
	LogDebug(VB_CHANNELDATA, "SendOutputBuffer()\n");

	int i;
	unsigned char *c = privData->outBuf + PIXELNET_HEADER_SIZE;

	memcpy(privData->outBuf, PixelnetDMXdataHeader, PIXELNET_HEADER_SIZE);

	pthread_mutex_lock(&privData->bufLock);
	memcpy(c, privData->inBuf, PIXELNET_DMX_DATA_SIZE);
	privData->dataWaiting = 0;
	pthread_mutex_unlock(&privData->bufLock);

	for(i = 0; i < PIXELNET_DMX_DATA_SIZE; i++, c++)
	{
		if (*c == 170)
		{
			*c = 171;
		}
	}

	if (LogMaskIsSet(VB_CHANNELDATA) && LogLevelIsSet(LOG_EXCESSIVE))
		HexDump("FPD Channel Header & Data", privData->outBuf, 256);

	i = wiringPiSPIDataRW (0, privData->outBuf, PIXELNET_DMX_BUF_SIZE);
	if (i != PIXELNET_DMX_BUF_SIZE)
	{
		LogErr(VB_CHANNELOUT, "Error: wiringPiSPIDataRW returned %d, expecting %d\n", i, PIXELNET_DMX_BUF_SIZE);
		return 0;
	}

	return 1;
}
开发者ID:bagumondigi,项目名称:fpp,代码行数:34,代码来源:FPD.c


示例11: thdB

void thdB(void *pcn) {
    char        *recv_buf;
    int          recv_nbytes;
    int          cn;
    int          wc;
    int          pb;

    cn=(int)pcn;
    Log("%03d thdB              thread begin...\n",cn);
    while (1) {
        Sleep(10);
        recv_buf=(char *)Cbuf;
        recv_nbytes=CSIZE;
        wc=0;
        while (1) {
            pb=GetFromRBuf(cn,&cs_BBB,&BBB,recv_buf,recv_nbytes);
            if (pb) {
                Log("%03d recv %d bytes\n",cn,pb);
                HexDump(cn,recv_buf,pb);
                Sleep(1);
            } else {
                Sleep(1000);
            }
            if (No_Loop) break;//
            wc++;
            if (wc>3600) Log("%03d %d==wc>3600!\n",cn,wc);
        }
        if (No_Loop) break;//
    }
}
开发者ID:zhangzewen,项目名称:Algorithms,代码行数:30,代码来源:buffer_6.c


示例12: DumpRawSectionData

//
// Do a hexadecimal dump of the raw data for all the sections.  You
// could just dump one section by adjusting the PIMAGE_SECTION_HEADER
// and cSections parameters
//
void DumpRawSectionData(PIMAGE_SECTION_HEADER section,
                        PVOID base,
                        unsigned cSections)
{
    unsigned i;
    char name[IMAGE_SIZEOF_SHORT_NAME + 1];

    printf("Section Hex Dumps\n");
    
    for ( i=1; i <= cSections; i++, section++ )
    {
        // Make a copy of the section name so that we can ensure that
        // it's null-terminated
        memcpy(name, section->Name, IMAGE_SIZEOF_SHORT_NAME);
        name[IMAGE_SIZEOF_SHORT_NAME] = 0;

        // Don't dump sections that don't exist in the file!
        if ( section->PointerToRawData == 0 )
            continue;
        
        printf( "section %02X (%s)  size: %08X  file offs: %08X\n",
                i, name, section->SizeOfRawData, section->PointerToRawData);

        HexDump( MakePtr(PBYTE, base, section->PointerToRawData),
                 section->SizeOfRawData );
        printf("\n");
    }
}
开发者ID:martell,项目名称:pedump,代码行数:33,代码来源:common.cpp


示例13: _tmain

int _tmain(int argc, _TCHAR* argv[])
{
    int retVal(0);
    int arg = FindNextArg(argc, argv, 0);
    if (arg <= 0)
    {
        Help();
        retVal = 1;
    }
    else
    {
        for (int i = 1; i < argc; ++i)
            _tprintf(_T("%s\n"), argv[i]);
        BinaryFind bf;
        {
            BinaryData findBuffer;
            findBuffer.BuildFromString(FindArgValue(argc, argv, _T("-f=")), FindArgValue(argc, argv, _T("-fs")) != NULL);
            if (findBuffer.DataSize() > 0)
                bf.SetFindPattern(findBuffer);
        }
        const TCHAR *fileOrString(argv[arg]);
        if (Path(fileOrString).Exists()) {
            Path filePath(fileOrString);
            HDFDCB_Data cbData = { argc, argv, bf };
            if (filePath.IsDir()) {
                Finder f((FindCallBack)HEXDump_FindCallBack, &cbData,
                    FindArgValue(argc, argv, _T("-mp=")),
                    FindArgValue(argc, argv, _T("-ep=")));
                f.StartFind(fileOrString);
            }
            else {
                FindData fd(NULL, filePath, true);
                HEXDump_FindCallBack(fd, &cbData);
            }
            if (cbData.nFiles > 1)
                _tprintf(_T("Total files: %d\n"), cbData.nFiles);
            if (cbData.nFound > 1) {
                _tprintf(_T("Total files matching: %d\n"), cbData.nFound);
                if (cbData.nMaxMatchPerFile > 1)
                    _tprintf(_T("max matching in a file : %d\n"), cbData.nMaxMatchPerFile);
            }
        }
        else
        {
            if (bf.HasFindPattern()) {
                bf.SetFindBuffer((const void *)fileOrString, _tcslen(fileOrString)*sizeof(fileOrString[0]));
                while (true)
                {
                    long long findPos = bf.FindNext();
                    if (findPos >= 0)
                        _tprintf(_T("%08llX\n"), findPos);
                    else break;
                }
            }
            else
                HexDump((const void *)fileOrString, _tcslen(fileOrString)*sizeof(fileOrString[0]));
        }
    }
    return retVal;
}
开发者ID:afrozm,项目名称:projects,代码行数:60,代码来源:HexDump.cpp


示例14: DVDreadManufact

s32 DVDreadManufact()
{
	s32 s32result;
	u8 i;
	int successflag;
	int j;

#ifdef VERBOSE_FUNCTION
	PrintLog("CDVD driver: DVDreadManufact()");
#endif /* VERBOSE_FUNCTION */

	j = 0;
	successflag = 0;

	for (i = 0; i <= dvdphysical.physical.layer_num; i++)
	{
		memset(&dvdmanufact[i], 0, sizeof(dvd_struct));
		dvdmanufact[i].type = DVD_STRUCT_MANUFACT;
		dvdmanufact[i].manufact.layer_num = i;
		errno = 0;
		s32result = ioctl(devicehandle, DVD_READ_STRUCT, &dvdmanufact[i]);
		if ((s32result != 0) || (errno != 0))
		{
			dvdmanufact[i].type = 0xFF;
		}
		else
		{
			successflag = 1;
		} // ENDIF- Did we fail to read in some manufacturer data?
	} // NEXT i- Collecting manufacturer data from all layers

	if (successflag == 0)
	{
#ifdef VERBOSE_WARNINGS
		PrintLog("CDVD driver:   Error getting Manufact: (%i) %i:%s", s32result, errno, strerror(errno));
#endif /* VERBOSE_WARNINGS */
		return(-1);
	} // ENDIF- Problem with read of physical data?

#ifdef VERBOSE_DISC_INFO
	PrintLog("CDVD driver: Manufact Data");
	for (i = 0; i <= dvdphysical.physical.layer_num; i++)
	{
		if (dvdmanufact[i].type != 0xFF)
		{
			PrintLog("CDVD driver:   Layer %i   Length %i   Value:",
			         dvdmanufact[i].manufact.layer_num,
			         dvdmanufact[i].manufact.len);
			for (j = 0; j < 128 - 15; j += 16)
			{
				HexDump(dvdmanufact[i].manufact.value + j, 16);
			} // NEXT j- dumping whole key data
		} // ENDIF- Do we have data at this layer?
	} // NEXT i- Running through all the layers
#endif /* VERBOSE_DISC_INFO */

	errno = 0;
	return(0); // Success. Manufacturer's data stored for perusal.
} // END DVDreadManufact()
开发者ID:madnessw,项目名称:thesnow,代码行数:59,代码来源:DVD.c


示例15: LogFormat

size_t
DumpPort::Write(const void *data, size_t length)
{
  LogFormat("Write(%u)", (unsigned)length);
  size_t nbytes = port->Write(data, length);
  LogFormat("Write(%u)=%u", (unsigned)length, (unsigned)nbytes);
  HexDump("W ", data, nbytes);
  return nbytes;
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:9,代码来源:DumpPort.cpp


示例16: LogStartUp

size_t
DumpPort::Write(const void *data, size_t length)
{
  LogStartUp(_T("Write(%u)"), (unsigned)length);
  size_t nbytes = port->Write(data, length);
  LogStartUp(_T("Write(%u)=%u"), (unsigned)length, (unsigned)nbytes);
  HexDump(_T("W "), data, nbytes);
  return nbytes;
}
开发者ID:osteocool,项目名称:XCSoar-1,代码行数:9,代码来源:DumpPort.cpp


示例17: PrintRange

void PrintRange(int starting_offset, int ending_offset)
{
    char plural[2] = "";
    int num_bytes_diff;

    assert(starting_offset >= 0);
    assert(starting_offset <= ending_offset);
    if (starting_offset < ending_offset) {
        strcpy(plural, "s");
    }
    num_bytes_diff = ending_offset - starting_offset + 1;
    fprintf(ofp, "File %s:  %d (0x%x) byte%s different\n", 
                 globals.filename1, num_bytes_diff, num_bytes_diff, plural);
    HexDump(globals.ifp1, starting_offset, num_bytes_diff);
    fprintf(ofp, "File %s:\n", globals.filename2);
    HexDump(globals.ifp2, starting_offset, num_bytes_diff);
    PrintSeparator();
}
开发者ID:akipta,项目名称:hobbyutil,代码行数:18,代码来源:bd.c


示例18: fopen

void PacketLog::HexDumpStr(const char *msg, const char *data, size_t len, const char* file)
{
    FILE *pFile;
    pFile = fopen(file, "a");
    fprintf(pFile,"%s\n", msg);
    fclose(pFile);

    HexDump(data, len, file);
}
开发者ID:furen2013,项目名称:testwork,代码行数:9,代码来源:PacketLog.cpp


示例19: execute_set_tx_frequency_arm

static int execute_set_tx_frequency_arm(char *szPort, UINT8 carrier_on, UINT16 tx_frequency, int tx_power)
{
    ComHelper SerialPort;

    if (!SerialPort.OpenPort(szPort))
    {
        printf("Open %s port Failed\n", szPort);
        return 0;
    }
    int chan_num = tx_frequency - 2400;
    UINT8 hci_set_tx_frequency_arm[] = {0x01, 0x014, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
    UINT8 hci_set_tx_frequency_arm_cmd_complete_event[] = {0x04, 0x0e, 0x04, 0x01, 0x014, 0xfc, 0x00};
    hci_set_tx_frequency_arm[4] = (carrier_on == 0) ? 1 : 0;
    hci_set_tx_frequency_arm[5] = (carrier_on == 1) ? chan_num : 2;
    hci_set_tx_frequency_arm[6] = 0;                // unmodulated
    hci_set_tx_frequency_arm[7] = 0;                // modulation type  
    hci_set_tx_frequency_arm[8] = (carrier_on == 1) ? 8 : 0;
    hci_set_tx_frequency_arm[9] = tx_power;

    printf ("Sending HCI Command:\n");
    HexDump(hci_set_tx_frequency_arm, sizeof(hci_set_tx_frequency_arm));

    // write HCI reset
    SerialPort.Write(hci_set_tx_frequency_arm, sizeof(hci_set_tx_frequency_arm));

    // read HCI response header
    DWORD dwRead = SerialPort.Read((LPBYTE)&in_buffer[0], 3);

    // read HCI response payload
    if (dwRead == 3 && in_buffer[2] > 0)
        dwRead += SerialPort.Read((LPBYTE)&in_buffer[3], in_buffer[2]);

    printf ("Received HCI Event:\n");
    HexDump(in_buffer, dwRead);
    if (dwRead == sizeof(hci_set_tx_frequency_arm_cmd_complete_event))
    {
        if (memcmp(in_buffer, hci_set_tx_frequency_arm_cmd_complete_event, dwRead) == 0)
        {
            printf ("Success\n");
            return 1;
        }
    }
    return FALSE;
}
开发者ID:lucyking,项目名称:darkblue-beacon,代码行数:44,代码来源:mbt.cpp


示例20: recv_me

static void
recv_me (EIBNetIPPacket *p1)
{
  EIBnet_DescriptionResponse resp;
  if (parseEIBnet_DescriptionResponse (*p1, resp))
    die ("Invalid description response");
  printf ("Medium: %d\nState: %d\nAddr: %s\nInstallID: %d\nSerial:",
          resp.KNXmedium, resp.devicestatus,
          FormatEIBAddr (resp.individual_addr).c_str(), resp.installid);
  HexDump (resp.serial, sizeof (resp.serial));
  printf ("Multicast-Addr: %s\nMAC:", inet_ntoa (resp.multicastaddr));
  HexDump (resp.MAC, sizeof (resp.MAC));
  printf ("Name: %s\n", resp.name);
  printf ("Optional: ");
  HexDump (resp.optional.data(), resp.optional.size());
  ITER(i, resp.services)
    printf ("Service %d Version %d\n", i->family, i->version);
  ev_break(EV_DEFAULT_ EVBREAK_ALL);
}
开发者ID:ascillato,项目名称:knxd,代码行数:19,代码来源:eibnetdescribe.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ HiSax_getrev函数代码示例发布时间:2022-05-30
下一篇:
C++ Helper_Get_EA_X函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap