| Documentation For Arduino users

- Main Page
- Related Pages
- Modules
- Classes
- Files
- Examples

- File List
- File Members

NexRadio.cpp
Go to the documentation of this file.
1
15 #include "NexRadio.h"
16
17 NexRadio::NexRadio(uint8_t pid, uint8_t cid, const char *name)
18 :NexTouch(pid, cid, name)
19 {
20 }
21
22 uint32_t NexRadio::getValue(uint32_t *number)
23 {
24 String cmd = String("get ");
25 cmd += getObjName();
26 cmd += ".val";
27 sendCommand(cmd.c_str());
28 return recvRetNumber(number);
29 }
30
31 bool NexRadio::setValue(uint32_t number)
32 {
33 char buf[10] = {0};
34 String cmd;
35
36 utoa(number, buf, 10);
37 cmd += getObjName();
38 cmd += ".val=";
39 cmd += buf;
40
41 sendCommand(cmd.c_str());
42 return recvRetCommandFinished();
43 }
44
45 uint32_t NexRadio::Get_background_color_bco(uint32_t *number)
46 {
47 String cmd;
48 cmd += "get ";
49 cmd += getObjName();
50 cmd += ".bco";
51 sendCommand(cmd.c_str());
52 return recvRetNumber(number);
53 }
54
55 bool NexRadio::Set_background_color_bco(uint32_t number)
56 {
57 char buf[10] = {0};
58 String cmd;
59
60 utoa(number, buf, 10);
61 cmd += getObjName();
62 cmd += ".bco=";
63 cmd += buf;
64 sendCommand(cmd.c_str());
65
66 cmd="";
67 cmd += "ref ";
68 cmd += getObjName();
69 sendCommand(cmd.c_str());
70 return recvRetCommandFinished();
71 }
72
73 uint32_t NexRadio::Get_font_color_pco(uint32_t *number)
74 {
75 String cmd;
76 cmd += "get ";
77 cmd += getObjName();
78 cmd += ".pco";
79 sendCommand(cmd.c_str());
80 return recvRetNumber(number);
81 }
82
83 bool NexRadio::Set_font_color_pco(uint32_t number)
84 {
85 char buf[10] = {0};
86 String cmd;
87
88 utoa(number, buf, 10);
89 cmd += getObjName();
90 cmd += ".pco=";
91 cmd += buf;
92 sendCommand(cmd.c_str());
93
94 cmd = "";
95 cmd += "ref ";
96 cmd += getObjName();
97 sendCommand(cmd.c_str());
98 return recvRetCommandFinished();
99 }
NexRadio::Get_background_color_bco
uint32_t Get_background_color_bco(uint32_t *number)
Get bco attribute of component.
Definition: NexRadio.cpp:45
NexRadio::Get_font_color_pco
uint32_t Get_font_color_pco(uint32_t *number)
Get pco attribute of component.
Definition: NexRadio.cpp:73
NexRadio::setValue
bool setValue(uint32_t number)
Set val attribute of component.
Definition: NexRadio.cpp:31
NexRadio::getValue
uint32_t getValue(uint32_t *number)
Get val attribute of component.
Definition: NexRadio.cpp:22
NexRadio::Set_background_color_bco
bool Set_background_color_bco(uint32_t number)
Set bco attribute of component.
Definition: NexRadio.cpp:55
NexRadio.h
The definition of class NexRadio.
NexRadio::Set_font_color_pco
bool Set_font_color_pco(uint32_t number)
Set pco attribute of component.
Definition: NexRadio.cpp:83
NexTouch
Father class of the components with touch events.
Definition: NexTouch.h:53
NexRadio::NexRadio
NexRadio(uint8_t pid, uint8_t cid, const char *name)
Constructor.
Definition: NexRadio.cpp:17