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