Skip to content

Commit

Permalink
Update doc.
Browse files Browse the repository at this point in the history
Signed-off-by: shennongmin <[email protected]>
  • Loading branch information
shennongmin committed Aug 14, 2015
1 parent 1b8b1d8 commit 4ca5031
Show file tree
Hide file tree
Showing 153 changed files with 1,083 additions and 1,430 deletions.
20 changes: 0 additions & 20 deletions NexButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,11 @@

#include "NexButton.h"

/**
* Constructor,inherited NexTouch's constructor function.
*
*/
NexButton::NexButton(uint8_t pid, uint8_t cid, const char *name)
:NexTouch(pid, cid, name)
{
}

/**
* Get text value from button component.
*
* @param buffer - text buffer.
* @param len - text buffer length.
*
* @return the text buffer length
*/
uint16_t NexButton::getText(char *buffer, uint16_t len)
{
String cmd;
Expand All @@ -42,14 +30,6 @@ uint16_t NexButton::getText(char *buffer, uint16_t len)
return recvRetString(buffer,len);
}

/**
* Set text value of button component.
*
* @param buffer - text buffer.
*
* @retval true - success.
* @retval false - failed.
*/
bool NexButton::setText(const char *buffer)
{
String cmd;
Expand Down
20 changes: 19 additions & 1 deletion NexButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@
#include "NexHardware.h"

/**
* NexButton,subclass of NexTouch,provides simple methods to control button component.
* NexButton component.
*
* Commonly, you want to do something after push and pop it. It is recommanded that only
* call @ref NexTouch::attachPop to satisfy your purpose.
*
* @warning Please do not call @ref NexTouch::attachPush on this component, even though you can.
*/
class NexButton: public NexTouch
{
Expand All @@ -33,7 +37,21 @@ class NexButton: public NexTouch
*/
NexButton(uint8_t pid, uint8_t cid, const char *name);

/**
* Get text attribute of component.
*
* @param buffer - buffer storing text returned.
* @param len - length of buffer.
* @return The real length of text returned.
*/
uint16_t getText(char *buffer, uint16_t len);

/**
* Set text attribute of component.
*
* @param buffer - text buffer terminated with '\0'.
* @return true if success, false for failure.
*/
bool setText(const char *buffer);
};

Expand Down
20 changes: 0 additions & 20 deletions NexCrop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,11 @@

#include "NexCrop.h"

/**
* Constructor,inherited NexTouch's constructor function.
*
*/
NexCrop::NexCrop(uint8_t pid, uint8_t cid, const char *name)
:NexTouch(pid, cid, name)
{
}

/*
* Get the number of picture.
*
* @param number - an output parameter to save the number of picture.
*
* @retval true - success.
* @retval false - failed.
*/
bool NexCrop::getPic(uint32_t *number)
{
String cmd = String("get ");
Expand All @@ -41,14 +29,6 @@ bool NexCrop::getPic(uint32_t *number)
return recvRetNumber(number);
}

/*
* Set the number of picture.
*
* @param number - the number of picture.
*
* @retval true - success.
* @retval false - failed.
*/
bool NexCrop::setPic(uint32_t number)
{
char buf[10] = {0};
Expand Down
22 changes: 19 additions & 3 deletions NexCrop.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include "NexHardware.h"

/**
* NexCrop,subclass of NexTouch,provides simple methods to control crop component.
*
* NexCrop component.
*/
class NexCrop: public NexTouch
{
Expand All @@ -32,8 +31,25 @@ class NexCrop: public NexTouch
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
*/
NexCrop(uint8_t pid, uint8_t cid, const char *name);


/**
* Get the number of picture.
*
* @param number - an output parameter to save the number of picture.
*
* @retval true - success.
* @retval false - failed.
*/
bool getPic(uint32_t *number);

/**
* Set the number of picture.
*
* @param number - the number of picture.
*
* @retval true - success.
* @retval false - failed.
*/
bool setPic(uint32_t number);
};

Expand Down
20 changes: 0 additions & 20 deletions NexGauge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,11 @@

#include "NexGauge.h"

/**
* Constructor,inherited NexTouch's constructor function.
*
*/
NexGauge::NexGauge(uint8_t pid, uint8_t cid, const char *name)
:NexObject(pid, cid, name)
{
}

/**
* Get the value of gauge.
*
* @param number - an output parameter to save gauge's value.
*
* @retval true - success.
* @retval false - failed.
*/
bool NexGauge::getValue(uint32_t *number)
{
String cmd = String("get ");
Expand All @@ -41,14 +29,6 @@ bool NexGauge::getValue(uint32_t *number)
return recvRetNumber(number);
}

/**
* Set the value of gauge.
*
* @param number - the value of gauge.
*
* @retval true - success.
* @retval false - failed.
*/
bool NexGauge::setValue(uint32_t number)
{
char buf[10] = {0};
Expand Down
22 changes: 19 additions & 3 deletions NexGauge.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include "NexHardware.h"

/**
* NexGauge,subclass of NexTouch,provides simple methods to control gauge component.
*
* NexGauge component.
*/
class NexGauge: public NexObject
{
Expand All @@ -31,8 +30,25 @@ class NexGauge: public NexObject
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
*/
NexGauge(uint8_t pid, uint8_t cid, const char *name);


/**
* Get the value of gauge.
*
* @param number - an output parameter to save gauge's value.
*
* @retval true - success.
* @retval false - failed.
*/
bool getValue(uint32_t *number);

/**
* Set the value of gauge.
*
* @param number - the value of gauge.
*
* @retval true - success.
* @retval false - failed.
*/
bool setValue(uint32_t number);
};

Expand Down
10 changes: 5 additions & 5 deletions NexHardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define NEX_RET_INVALID_VARIABLE (0x1A)
#define NEX_RET_INVALID_OPERATION (0x1B)

/**
/*
* Receive uint32_t data.
*
* @param number - save uint32_t data.
Expand Down Expand Up @@ -84,7 +84,7 @@ bool recvRetNumber(uint32_t *number, uint32_t timeout)
}


/**
/*
* Receive string data.
*
* @param buffer - save string data.
Expand Down Expand Up @@ -156,7 +156,7 @@ uint16_t recvRetString(char *buffer, uint16_t len, uint32_t timeout)
return ret;
}

/**
/*
* Send command to Nextion.
*
* @param cmd - the string of command.
Expand All @@ -175,7 +175,7 @@ void sendCommand(const char* cmd)
}


/**
/*
* Command is executed successfully.
*
* @param timeout - set timeout time.
Expand Down Expand Up @@ -232,7 +232,7 @@ bool nexInit(void)
return ret1 && ret2;
}

void nexLoop(NexTouch **nex_listen_list)
void nexLoop(NexTouch *nex_listen_list[])
{
static uint8_t __buffer[10];

Expand Down
2 changes: 1 addition & 1 deletion NexHardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bool nexInit(void);
* @warning This function must be called repeatedly to response touch events
* from Nextion touch panel. Actually, you should place it in your loop function.
*/
void nexLoop(NexTouch **nex_listen_list);
void nexLoop(NexTouch *nex_listen_list[]);

/**
* @}
Expand Down
4 changes: 0 additions & 4 deletions NexHotspot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

#include "NexHotspot.h"

/**
* Constructor,inherited NexTouch's constructor function.
*
*/
NexHotspot::NexHotspot(uint8_t pid, uint8_t cid, const char *name)
:NexTouch(pid, cid, name)
{
Expand Down
3 changes: 1 addition & 2 deletions NexHotspot.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include "NexHardware.h"

/**
* NexHotspot,subclass of NexTouch,provides simple methods to control hotspot component.
*
* NexHotspot component.
*/
class NexHotspot: public NexTouch
{
Expand Down
10 changes: 0 additions & 10 deletions NexPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,11 @@

#include "NexPage.h"

/**
* Constructor,inherited NexTouch's constructor function.
*
*/
NexPage::NexPage(uint8_t pid, uint8_t cid, const char *name)
:NexTouch(pid, cid, name)
{
}

/**
* Change page.
*
* @retval true - success.
* @retval false - failed.
*/
bool NexPage::show(void)
{
uint8_t buffer[4] = {0};
Expand Down
13 changes: 8 additions & 5 deletions NexPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
#include "NexHardware.h"

/**
* 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.
* A special component , which can contain other components such as NexButton,
* NexText and NexWaveform, etc.
*/
class NexPage: public NexTouch
{
Expand All @@ -33,8 +31,13 @@ class NexPage: public NexTouch
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
*/
NexPage(uint8_t pid, uint8_t cid, const char *name);

/**
* Show itself.
*
* @return true if success, false for faileure.
*/
bool show(void);
};


#endif /* #ifndef __NEXPAGE_H__ */
20 changes: 0 additions & 20 deletions NexPicture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,11 @@

#include "NexPicture.h"

/**
* Constructor,inherited NexTouch's constructor function.
*
*/
NexPicture::NexPicture(uint8_t pid, uint8_t cid, const char *name)
:NexTouch(pid, cid, name)
{
}

/**
* Get picture's number.
*
* @param number - an output parameter to save picture number.
*
* @retval true - success.
* @retval false - failed.
*/
bool NexPicture::getPic(uint32_t *number)
{
String cmd = String("get ");
Expand All @@ -41,14 +29,6 @@ bool NexPicture::getPic(uint32_t *number)
return recvRetNumber(number);
}

/**
* Set picture's number.
*
* @param number -the picture number.
*
* @retval true - success.
* @retval false - failed.
*/
bool NexPicture::setPic(uint32_t number)
{
char buf[10] = {0};
Expand Down
Loading

0 comments on commit 4ca5031

Please sign in to comment.