Skip to content

Commit 3109644

Browse files
committed
keep origin API
1 parent f104dd8 commit 3109644

File tree

6 files changed

+133
-0
lines changed

6 files changed

+133
-0
lines changed

NexCrop.cpp

+23
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,26 @@ bool NexCrop::Set_background_crop_picc(uint32_t number)
4343
return recvRetCommandFinished();
4444
}
4545

46+
bool NexCrop::getPic(uint32_t *number)
47+
{
48+
String cmd = String("get ");
49+
cmd += getObjName();
50+
cmd += ".picc";
51+
sendCommand(cmd.c_str());
52+
return recvRetNumber(number);
53+
}
54+
55+
bool NexCrop::setPic(uint32_t number)
56+
{
57+
char buf[10] = {0};
58+
String cmd;
59+
60+
utoa(number, buf, 10);
61+
cmd += getObjName();
62+
cmd += ".picc=";
63+
cmd += buf;
64+
65+
sendCommand(cmd.c_str());
66+
return recvRetCommandFinished();
67+
}
68+

NexCrop.h

+20
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,26 @@ class NexCrop: public NexTouch
5555
* @retval false - failed.
5656
*/
5757
bool Set_background_crop_picc(uint32_t number);
58+
59+
/**
60+
* Get the number of picture.
61+
*
62+
* @param number - an output parameter to save the number of picture.
63+
*
64+
* @retval true - success.
65+
* @retval false - failed.
66+
*/
67+
bool getPic(uint32_t *number);
68+
69+
/**
70+
* Set the number of picture.
71+
*
72+
* @param number - the number of picture.
73+
*
74+
* @retval true - success.
75+
* @retval false - failed.
76+
*/
77+
bool setPic(uint32_t number);
5878
};
5979

6080
/**

NexPicture.cpp

+22
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,25 @@ bool NexPicture::Set_background_image_pic(uint32_t number)
4343
return recvRetCommandFinished();
4444
}
4545

46+
bool NexPicture::getPic(uint32_t *number)
47+
{
48+
String cmd = String("get ");
49+
cmd += getObjName();
50+
cmd += ".pic";
51+
sendCommand(cmd.c_str());
52+
return recvRetNumber(number);
53+
}
54+
55+
bool NexPicture::setPic(uint32_t number)
56+
{
57+
char buf[10] = {0};
58+
String cmd;
59+
60+
utoa(number, buf, 10);
61+
cmd += getObjName();
62+
cmd += ".pic=";
63+
cmd += buf;
64+
65+
sendCommand(cmd.c_str());
66+
return recvRetCommandFinished();
67+
}

NexPicture.h

+20
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,26 @@ class NexPicture: public NexTouch
5454
* @retval false - failed.
5555
*/
5656
bool Set_background_image_pic(uint32_t number);
57+
58+
/**
59+
* Get picture's number.
60+
*
61+
* @param number - an output parameter to save picture number.
62+
*
63+
* @retval true - success.
64+
* @retval false - failed.
65+
*/
66+
bool getPic(uint32_t *number);
67+
68+
/**
69+
* Set picture's number.
70+
*
71+
* @param number -the picture number.
72+
*
73+
* @retval true - success.
74+
* @retval false - failed.
75+
*/
76+
bool setPic(uint32_t number);
5777
};
5878

5979
/**

NexTimer.cpp

+26
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,30 @@ bool NexTimer::disable(void)
8383
return recvRetCommandFinished();
8484
}
8585

86+
bool NexTimer::getCycle(uint32_t *number)
87+
{
88+
String cmd = String("get ");
89+
cmd += getObjName();
90+
cmd += ".tim";
91+
sendCommand(cmd.c_str());
92+
return recvRetNumber(number);
93+
}
94+
95+
bool NexTimer::setCycle(uint32_t number)
96+
{
97+
char buf[10] = {0};
98+
String cmd;
99+
if (number < 50)
100+
{
101+
number = 50;
102+
}
103+
utoa(number, buf, 10);
104+
cmd += getObjName();
105+
cmd += ".tim=";
106+
cmd += buf;
107+
108+
sendCommand(cmd.c_str());
109+
return recvRetCommandFinished();
110+
}
111+
86112

NexTimer.h

+22
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,28 @@ class NexTimer: public NexTouch
9595
* @retval false - failed.
9696
*/
9797
bool disable(void);
98+
99+
/**
100+
* Get the value of timer cycle val.
101+
*
102+
* @param number - an output parameter to save the value of timer cycle.
103+
*
104+
* @retval true - success.
105+
* @retval false - failed.
106+
*/
107+
bool getCycle(uint32_t *number);
108+
109+
/**
110+
* Set the value of timer cycle val.
111+
*
112+
* @param number - the value of timer cycle.
113+
*
114+
* @retval true - success.
115+
* @retval false - failed.
116+
*
117+
* @warning the cycle value must be greater than 50.
118+
*/
119+
bool setCycle(uint32_t number);
98120

99121
};
100122
/**

0 commit comments

Comments
 (0)