diff --git a/NexButton.cpp b/NexButton.cpp index 5e1b64b..204f3bc 100644 --- a/NexButton.cpp +++ b/NexButton.cpp @@ -19,7 +19,7 @@ * Constructor,inherited NexTouch's constructor function. * */ -NexButton::NexButton(NexPid pid, NexCid cid, const char *name) +NexButton::NexButton(uint8_t pid, uint8_t cid, const char *name) :NexTouch(pid, cid, name) { } diff --git a/NexButton.h b/NexButton.h index 07c9c4a..fd12c17 100644 --- a/NexButton.h +++ b/NexButton.h @@ -27,7 +27,7 @@ class NexButton: public NexTouch { public: /* methods */ - NexButton(NexPid pid, NexCid cid, const char *name); + NexButton(uint8_t pid, uint8_t cid, const char *name); uint16_t getText(char *buffer, uint16_t len); bool setText(const char *buffer); diff --git a/NexCrop.cpp b/NexCrop.cpp index 3f75171..39ce0ce 100644 --- a/NexCrop.cpp +++ b/NexCrop.cpp @@ -19,7 +19,7 @@ * Constructor,inherited NexTouch's constructor function. * */ -NexCrop::NexCrop(NexPid pid, NexCid cid, const char *name) +NexCrop::NexCrop(uint8_t pid, uint8_t cid, const char *name) :NexTouch(pid, cid, name) { } diff --git a/NexCrop.h b/NexCrop.h index 4c3155a..7206068 100644 --- a/NexCrop.h +++ b/NexCrop.h @@ -27,7 +27,7 @@ class NexCrop: public NexTouch { public: /* methods */ - NexCrop(NexPid pid, NexCid cid, const char *name); + NexCrop(uint8_t pid, uint8_t cid, const char *name); bool getPic(uint32_t *number); bool setPic(uint32_t number); diff --git a/NexGauge.cpp b/NexGauge.cpp index 7ff174d..ed60e62 100644 --- a/NexGauge.cpp +++ b/NexGauge.cpp @@ -19,7 +19,7 @@ * Constructor,inherited NexTouch's constructor function. * */ -NexGauge::NexGauge(NexPid pid, NexCid cid, const char *name) +NexGauge::NexGauge(uint8_t pid, uint8_t cid, const char *name) :NexObject(pid, cid, name) { } diff --git a/NexGauge.h b/NexGauge.h index cf45efb..c5a4db6 100644 --- a/NexGauge.h +++ b/NexGauge.h @@ -27,7 +27,7 @@ class NexGauge: public NexObject { public: /* methods */ - NexGauge(NexPid pid, NexCid cid, const char *name); + NexGauge(uint8_t pid, uint8_t cid, const char *name); bool getValue(uint32_t *number); bool setValue(uint32_t number); diff --git a/NexHardware.cpp b/NexHardware.cpp index a2f67d4..509242a 100644 --- a/NexHardware.cpp +++ b/NexHardware.cpp @@ -249,7 +249,7 @@ static void mainEventLoop(NexTouch **list) if (0xFF == __buffer[4] && 0xFF == __buffer[5] && 0xFF == __buffer[6]) { - NexTouch::iterate(list, (NexPid)__buffer[1], (NexCid)__buffer[2], (NexEventType)__buffer[3]); + NexTouch::iterate(list, (uint8_t)__buffer[1], (uint8_t)__buffer[2], (NexEventType)__buffer[3]); } } diff --git a/NexHotspot.cpp b/NexHotspot.cpp index 6b78ebe..148c743 100644 --- a/NexHotspot.cpp +++ b/NexHotspot.cpp @@ -19,7 +19,7 @@ * Constructor,inherited NexTouch's constructor function. * */ -NexHotspot::NexHotspot(NexPid pid, NexCid cid, const char *name) +NexHotspot::NexHotspot(uint8_t pid, uint8_t cid, const char *name) :NexTouch(pid, cid, name) { } diff --git a/NexHotspot.h b/NexHotspot.h index 212b5f1..30ab30f 100644 --- a/NexHotspot.h +++ b/NexHotspot.h @@ -27,7 +27,7 @@ class NexHotspot: public NexTouch { public: /* methods */ - NexHotspot(NexPid pid, NexCid cid, const char *name); + NexHotspot(uint8_t pid, uint8_t cid, const char *name); }; diff --git a/NexObject.cpp b/NexObject.cpp index ab123ab..f2d5ac9 100644 --- a/NexObject.cpp +++ b/NexObject.cpp @@ -21,7 +21,7 @@ * @param cid - component id. * @param name - component name. */ -NexObject::NexObject(NexPid pid, NexCid cid, const char *name) +NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name) { this->pid = pid; this->cid = cid; @@ -34,7 +34,7 @@ NexObject::NexObject(NexPid pid, NexCid cid, const char *name) * * @return the id of page. */ -NexPid NexObject::getObjPid(void) +uint8_t NexObject::getObjPid(void) { return pid; } @@ -44,7 +44,7 @@ NexPid NexObject::getObjPid(void) * * @return the id of component. */ -NexCid NexObject::getObjCid(void) +uint8_t NexObject::getObjCid(void) { return cid; } diff --git a/NexObject.h b/NexObject.h index 612d57a..9979af5 100644 --- a/NexObject.h +++ b/NexObject.h @@ -18,16 +18,6 @@ #include #include "NexConfig.h" -/** - * Page ID - * - * Actually, Page is also a component which can contain other components such as - * Button, Text, etc. - */ -typedef uint8_t NexPid; - -typedef uint8_t NexCid; /**< Component ID */ - /** * Root class of all Nextion components. * @@ -38,17 +28,17 @@ typedef uint8_t NexCid; /**< Component ID */ class NexObject { public: /* methods */ - NexObject(NexPid pid, NexCid cid, const char *name); + NexObject(uint8_t pid, uint8_t cid, const char *name); void printObjInfo(void); protected: /* methods */ - NexPid getObjPid(void); - NexCid getObjCid(void); + uint8_t getObjPid(void); + uint8_t getObjCid(void); const char *getObjName(void); private: /* data */ - NexPid pid; /* Page ID */ - NexCid cid; /* Component ID */ + uint8_t pid; /* Page ID */ + uint8_t cid; /* Component ID */ const char *name; /* An unique name */ }; diff --git a/NexPage.cpp b/NexPage.cpp index cc61eb5..4546ef2 100644 --- a/NexPage.cpp +++ b/NexPage.cpp @@ -19,7 +19,7 @@ * Constructor,inherited NexTouch's constructor function. * */ -NexPage::NexPage(NexPid pid, NexCid cid, const char *name) +NexPage::NexPage(uint8_t pid, uint8_t cid, const char *name) :NexTouch(pid, cid, name) { } diff --git a/NexPage.h b/NexPage.h index fc67d4e..0df588f 100644 --- a/NexPage.h +++ b/NexPage.h @@ -23,11 +23,13 @@ /** * NexPage,subclass of NexTouch,provides simple methods to control page component. * + * Actually, Page is also a component which can contain other components such as + * Button, Text, etc. */ class NexPage: public NexTouch { public: /* methods */ - NexPage(NexPid pid, NexCid cid, const char *name); + NexPage(uint8_t pid, uint8_t cid, const char *name); bool show(void); }; diff --git a/NexPicture.cpp b/NexPicture.cpp index c2bedf4..e2ee261 100644 --- a/NexPicture.cpp +++ b/NexPicture.cpp @@ -19,7 +19,7 @@ * Constructor,inherited NexTouch's constructor function. * */ -NexPicture::NexPicture(NexPid pid, NexCid cid, const char *name) +NexPicture::NexPicture(uint8_t pid, uint8_t cid, const char *name) :NexTouch(pid, cid, name) { } diff --git a/NexPicture.h b/NexPicture.h index dd9e0f3..2f400f0 100644 --- a/NexPicture.h +++ b/NexPicture.h @@ -27,7 +27,7 @@ class NexPicture: public NexTouch { public: /* methods */ - NexPicture(NexPid pid, NexCid cid, const char *name); + NexPicture(uint8_t pid, uint8_t cid, const char *name); bool getPic(uint32_t *number); bool setPic(uint32_t number); diff --git a/NexProgressBar.cpp b/NexProgressBar.cpp index dfda0fa..737c8d1 100644 --- a/NexProgressBar.cpp +++ b/NexProgressBar.cpp @@ -19,7 +19,7 @@ * Constructor,inherited NexTouch's constructor function. * */ -NexProgressBar::NexProgressBar(NexPid pid, NexCid cid, const char *name) +NexProgressBar::NexProgressBar(uint8_t pid, uint8_t cid, const char *name) :NexObject(pid, cid, name) { } diff --git a/NexProgressBar.h b/NexProgressBar.h index c003916..9010333 100644 --- a/NexProgressBar.h +++ b/NexProgressBar.h @@ -27,7 +27,7 @@ class NexProgressBar: public NexObject { public: /* methods */ - NexProgressBar(NexPid pid, NexCid cid, const char *name); + NexProgressBar(uint8_t pid, uint8_t cid, const char *name); bool getValue(uint32_t *number); bool setValue(uint32_t number); diff --git a/NexSlider.cpp b/NexSlider.cpp index 3dcad42..63398f2 100644 --- a/NexSlider.cpp +++ b/NexSlider.cpp @@ -18,7 +18,7 @@ * Constructor,inherited NexTouch's constructor function. * */ -NexSlider::NexSlider(NexPid pid, NexCid cid, const char *name) +NexSlider::NexSlider(uint8_t pid, uint8_t cid, const char *name) :NexTouch(pid, cid, name) { } diff --git a/NexSlider.h b/NexSlider.h index 4c5285f..27d2e43 100644 --- a/NexSlider.h +++ b/NexSlider.h @@ -27,7 +27,7 @@ class NexSlider: public NexTouch { public: /* methods */ - NexSlider(NexPid pid, NexCid cid, const char *name); + NexSlider(uint8_t pid, uint8_t cid, const char *name); bool getValue(uint32_t *number); bool setValue(uint32_t number); diff --git a/NexText.cpp b/NexText.cpp index 643b15a..5644e49 100644 --- a/NexText.cpp +++ b/NexText.cpp @@ -18,7 +18,7 @@ * Constructor,inherited NexTouch's constructor function. * */ -NexText::NexText(NexPid pid, NexCid cid, const char *name) +NexText::NexText(uint8_t pid, uint8_t cid, const char *name) :NexTouch(pid, cid, name) { } diff --git a/NexText.h b/NexText.h index 1e89b1b..afbd389 100644 --- a/NexText.h +++ b/NexText.h @@ -27,7 +27,7 @@ class NexText: public NexTouch { public: /* methods */ - NexText(NexPid pid, NexCid cid, const char *name); + NexText(uint8_t pid, uint8_t cid, const char *name); uint16_t getText(char *buffer, uint16_t len); bool setText(const char *buffer); diff --git a/NexTouch.cpp b/NexTouch.cpp index bd1b068..32ae045 100644 --- a/NexTouch.cpp +++ b/NexTouch.cpp @@ -23,7 +23,7 @@ * @param name - name * */ -NexTouch::NexTouch(NexPid pid, NexCid cid, const char *name) +NexTouch::NexTouch(uint8_t pid, uint8_t cid, const char *name) :NexObject(pid, cid, name) { this->cbPush = NULL; @@ -72,7 +72,7 @@ void NexTouch::pop(void) } } -void NexTouch::iterate(NexTouch **list, NexPid pid, NexCid cid, NexEventType event) +void NexTouch::iterate(NexTouch **list, uint8_t pid, uint8_t cid, NexEventType event) { NexTouch *e = NULL; uint16_t i = 0; diff --git a/NexTouch.h b/NexTouch.h index c7138dd..203f5ba 100644 --- a/NexTouch.h +++ b/NexTouch.h @@ -36,10 +36,10 @@ typedef enum { class NexTouch: public NexObject { public: /* static methods */ - static void iterate(NexTouch **list, NexPid pid, NexCid cid, NexEventType event); + static void iterate(NexTouch **list, uint8_t pid, uint8_t cid, NexEventType event); public: /* methods */ - NexTouch(NexPid pid, NexCid cid, const char *name); + NexTouch(uint8_t pid, uint8_t cid, const char *name); void attachPush(NexTouchEventCb push, void *ptr = NULL); void detachPush(void); diff --git a/NexWaveform.cpp b/NexWaveform.cpp index 1675bfb..4e7857b 100644 --- a/NexWaveform.cpp +++ b/NexWaveform.cpp @@ -18,7 +18,7 @@ * Constructor,inherited NexTouch's constructor function. * */ -NexWaveform::NexWaveform(NexPid pid, NexCid cid, const char *name) +NexWaveform::NexWaveform(uint8_t pid, uint8_t cid, const char *name) :NexObject(pid, cid, name) { } diff --git a/NexWaveform.h b/NexWaveform.h index 8dc5366..297c8e9 100644 --- a/NexWaveform.h +++ b/NexWaveform.h @@ -26,7 +26,7 @@ class NexWaveform: public NexObject { public: /* methods */ - NexWaveform(NexPid pid, NexCid cid, const char *name); + NexWaveform(uint8_t pid, uint8_t cid, const char *name); bool addValue(uint8_t ch, uint8_t number); };