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


C++ Command_Packet::GetPacketBytes方法代码示例

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


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

示例1: GetResponse

// Turns on or off the LED backlight
// Parameter: true turns on the backlight, false turns it off
// Returns: True if successful, false if not
bool FPS_GT511C3::SetLED(bool on)
{
	Command_Packet* cp = new Command_Packet();
	cp->Command = Command_Packet::Commands::CmosLed;
	if (on)
	{
		if (UseSerialDebug) Serial.println("FPS - LED on");
		cp->Parameter[0] = 0x01;
	}
	else
	{
		if (UseSerialDebug) Serial.println("FPS - LED off");
		cp->Parameter[0] = 0x00;
	}
	cp->Parameter[1] = 0x00;
	cp->Parameter[2] = 0x00;
	cp->Parameter[3] = 0x00;
	byte* packetbytes = cp->GetPacketBytes();
	SendCommand(packetbytes, 12);
	Response_Packet* rp = GetResponse();
	bool retval = true;
	if (rp->ACK == false) retval = false;
	delete rp;
	delete packetbytes;
	delete cp;
	return retval;
};
开发者ID:AKD92,项目名称:Fingerprint_Scanner-TTL,代码行数:30,代码来源:FPS_GT511C3.cpp

示例2: SendCommand

// Deletes the specified ID (enrollment) from the database
// Parameter: 0-199 (id number to be deleted)
// Returns: true if successful, false if position invalid
bool FPS_GT511C3::DeleteID(int id)
{
  if (UseSerialDebug) Serial.println("FPS - DeleteID");
  Command_Packet* cp = new Command_Packet();
  cp->Command = Command_Packet::Commands::DeleteID;
  cp->ParameterFromInt(id);
  char* packetchars = cp->GetPacketBytes();
  SendCommand(packetchars, 12);
  Response_Packet* rp = GetResponse();
  bool retval = rp->ACK;
  delete rp;
  delete packetchars;
  delete cp;
  return retval;
}
开发者ID:dag10,项目名称:iDoor,代码行数:18,代码来源:FPS_GT511C3.cpp


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