New Nextion Begin.

This commit is contained in:
shennongmin
2015-07-15 10:23:40 +08:00
parent e571c8c3ed
commit 7d9afd1a95
46 changed files with 1353 additions and 567 deletions

39
NexButton.cpp Normal file
View File

@@ -0,0 +1,39 @@
#include "NexButton.h"
NexButton::NexButton(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop, void *pop_ptr)
:NexTouch(pid, cid, name, pop, pop_ptr)
{
}
uint16_t NexButton::getText(char *buffer, uint16_t len)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".txt";
sendCommand(cmd.c_str());
return recvRetString(buffer,len);
}
bool NexButton::setText(const char *buffer)
{
String cmd;
cmd += getObjName();
cmd += ".txt=\"";
cmd += buffer;
cmd += "\"";
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
void NexButton::attachPop(NexTouchEventCb pop, void *ptr)
{
NexTouch::attachPop(pop, ptr);
}
void NexButton::detachPop(void)
{
NexTouch::detachPop();
}