forked from DanNixon/NeoNextion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNextionPage.cpp
More file actions
33 lines (29 loc) · 715 Bytes
/
NextionPage.cpp
File metadata and controls
33 lines (29 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*! \file */
#include "NextionPage.h"
/*!
* \copydoc INextionWidget::INextionWidget
*/
NextionPage::NextionPage(Nextion &nex, uint8_t page, uint8_t component,
const char *name)
: INextionWidget(nex, page, component, name)
{
}
/*!
* \brief Sets this page as the currently displayed page.
* \return True if successful
*/
bool NextionPage::show()
{
size_t commandLen = 6 + strlen(m_name);
char command[commandLen];
snprintf(command, commandLen, "page %s", m_name);
return sendCommand(command);
}
/*!
* \brief Determines if this page is currently displayed.
* \return True if displayed
*/
bool NextionPage::isShown()
{
return m_nextion.getCurrentPage() == m_pageID;
}