File tree 6 files changed +133
-0
lines changed
6 files changed +133
-0
lines changed Original file line number Diff line number Diff line change @@ -43,3 +43,26 @@ bool NexCrop::Set_background_crop_picc(uint32_t number)
43
43
return recvRetCommandFinished ();
44
44
}
45
45
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
+
Original file line number Diff line number Diff line change @@ -55,6 +55,26 @@ class NexCrop: public NexTouch
55
55
* @retval false - failed.
56
56
*/
57
57
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);
58
78
};
59
79
60
80
/* *
Original file line number Diff line number Diff line change @@ -43,3 +43,25 @@ bool NexPicture::Set_background_image_pic(uint32_t number)
43
43
return recvRetCommandFinished ();
44
44
}
45
45
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
+ }
Original file line number Diff line number Diff line change @@ -54,6 +54,26 @@ class NexPicture: public NexTouch
54
54
* @retval false - failed.
55
55
*/
56
56
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);
57
77
};
58
78
59
79
/* *
Original file line number Diff line number Diff line change @@ -83,4 +83,30 @@ bool NexTimer::disable(void)
83
83
return recvRetCommandFinished ();
84
84
}
85
85
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
+
86
112
Original file line number Diff line number Diff line change @@ -95,6 +95,28 @@ class NexTimer: public NexTouch
95
95
* @retval false - failed.
96
96
*/
97
97
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);
98
120
99
121
};
100
122
/* *
You can’t perform that action at this time.
0 commit comments