Skip to content

Commit eaad704

Browse files
committed
add note to all files
1 parent 8405fec commit eaad704

27 files changed

+2049
-1405
lines changed

NexButton.cpp

Lines changed: 84 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,84 @@
1-
#include "NexButton.h"
2-
3-
NexButton::NexButton(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop, void *pop_ptr)
4-
:NexTouch(pid, cid, name, pop, pop_ptr)
5-
{
6-
}
7-
8-
uint16_t NexButton::getText(char *buffer, uint16_t len)
9-
{
10-
String cmd;
11-
cmd += "get ";
12-
cmd += getObjName();
13-
cmd += ".txt";
14-
sendCommand(cmd.c_str());
15-
return recvRetString(buffer,len);
16-
}
17-
18-
bool NexButton::setText(const char *buffer)
19-
{
20-
String cmd;
21-
cmd += getObjName();
22-
cmd += ".txt=\"";
23-
cmd += buffer;
24-
cmd += "\"";
25-
sendCommand(cmd.c_str());
26-
return recvRetCommandFinished();
27-
}
28-
29-
void NexButton::attachPop(NexTouchEventCb pop, void *ptr)
30-
{
31-
NexTouch::attachPop(pop, ptr);
32-
}
33-
34-
void NexButton::detachPop(void)
35-
{
36-
NexTouch::detachPop();
37-
}
38-
39-
1+
/**
2+
* @file NexButton.cpp
3+
*
4+
* API of NexButton.
5+
*
6+
* @author Wu Pengfei (email:<[email protected]>)
7+
* @date 2015/7/10
8+
* @copyright
9+
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
10+
* This program is free software; you can redistribute it and/or
11+
* modify it under the terms of the GNU General Public License as
12+
* published by the Free Software Foundation; either version 2 of
13+
* the License, or (at your option) any later version.
14+
*/
15+
16+
#include "NexButton.h"
17+
18+
/**
19+
* Constructor,inherited NexTouch's constructor function.
20+
*
21+
*/
22+
NexButton::NexButton(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop, void *pop_ptr)
23+
:NexTouch(pid, cid, name, pop, pop_ptr)
24+
{
25+
}
26+
27+
/**
28+
* Get text value from button component.
29+
*
30+
* @param buffer - text buffer.
31+
* @param len - text buffer length.
32+
*
33+
* @return the text buffer length
34+
*/
35+
uint16_t NexButton::getText(char *buffer, uint16_t len)
36+
{
37+
String cmd;
38+
cmd += "get ";
39+
cmd += getObjName();
40+
cmd += ".txt";
41+
sendCommand(cmd.c_str());
42+
return recvRetString(buffer,len);
43+
}
44+
45+
/**
46+
* Set text value of button component.
47+
*
48+
* @param buffer - text buffer.
49+
*
50+
* @retval true - success.
51+
* @retval false - failed.
52+
*/
53+
bool NexButton::setText(const char *buffer)
54+
{
55+
String cmd;
56+
cmd += getObjName();
57+
cmd += ".txt=\"";
58+
cmd += buffer;
59+
cmd += "\"";
60+
sendCommand(cmd.c_str());
61+
return recvRetCommandFinished();
62+
}
63+
64+
/**
65+
* Register button pop callback function.
66+
*
67+
* @param pop - the pointer to button pop callback function.
68+
* @param ptr - the parameter to be transmitted to button pop callback function.
69+
*/
70+
void NexButton::attachPop(NexTouchEventCb pop, void *ptr)
71+
{
72+
NexTouch::attachPop(pop, ptr);
73+
}
74+
75+
/**
76+
* Unload button pop callback function.
77+
*
78+
*/
79+
void NexButton::detachPop(void)
80+
{
81+
NexTouch::detachPop();
82+
}
83+
84+

NexButton.h

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,38 @@
1-
#ifndef __NEXBUTTON_H__
2-
#define __NEXBUTTON_H__
3-
#ifdef __cplusplus
4-
#include "NexTouch.h"
5-
6-
7-
/*
8-
* Button
9-
*/
10-
class NexButton: public NexTouch
11-
{
12-
public: /* methods */
13-
NexButton(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop = NULL, void *pop_ptr = NULL);
14-
15-
void attachPop(NexTouchEventCb pop, void *ptr = NULL);
16-
void detachPop(void);
17-
18-
uint16_t getText(char *buffer, uint16_t len);
19-
bool setText(const char *buffer);
20-
};
21-
22-
#endif /* #ifdef __cplusplus */
23-
#endif /* #ifndef __NEXBUTTON_H__ */
1+
/**
2+
* @file NexButton.h
3+
*
4+
* API of NexButton.
5+
*
6+
* @author Wu Pengfei (email:<[email protected]>)
7+
* @date 2015/7/10
8+
* @copyright
9+
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
10+
* This program is free software; you can redistribute it and/or
11+
* modify it under the terms of the GNU General Public License as
12+
* published by the Free Software Foundation; either version 2 of
13+
* the License, or (at your option) any later version.
14+
*/
15+
16+
#ifndef __NEXBUTTON_H__
17+
#define __NEXBUTTON_H__
18+
#ifdef __cplusplus
19+
#include "NexTouch.h"
20+
21+
/**
22+
* NexButton,subclass of NexTouch,provides simple methods to control button component.
23+
*
24+
*/
25+
class NexButton: public NexTouch
26+
{
27+
public: /* methods */
28+
NexButton(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop = NULL, void *pop_ptr = NULL);
29+
30+
void attachPop(NexTouchEventCb pop, void *ptr = NULL);
31+
void detachPop(void);
32+
33+
uint16_t getText(char *buffer, uint16_t len);
34+
bool setText(const char *buffer);
35+
};
36+
37+
#endif /* #ifdef __cplusplus */
38+
#endif /* #ifndef __NEXBUTTON_H__ */

NexHotspot.cpp

Lines changed: 67 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,67 @@
1-
#include "NexHotspot.h"
2-
3-
NexHotspot::NexHotspot(NexPid pid, NexCid cid, char *name,
4-
NexTouchEventCb pop, void *pop_ptr,
5-
NexTouchEventCb push, void *push_ptr)
6-
:NexTouch(pid, cid, name, pop, pop_ptr, push, push_ptr)
7-
{
8-
}
9-
10-
void NexHotspot::attachPush(NexTouchEventCb push, void *ptr)
11-
{
12-
NexTouch::attachPush(push, ptr);
13-
}
14-
15-
void NexHotspot::detachPush(void)
16-
{
17-
NexTouch::detachPush();
18-
}
19-
20-
void NexHotspot::attachPop(NexTouchEventCb pop, void *ptr)
21-
{
22-
NexTouch::attachPop(pop, ptr);
23-
}
24-
25-
void NexHotspot::detachPop(void)
26-
{
27-
NexTouch::detachPop();
28-
}
1+
/**
2+
* @file NexHotspot.cpp
3+
*
4+
* API of NexHotspot.
5+
*
6+
* @author Wu Pengfei (email:<[email protected]>)
7+
* @date 2015/7/10
8+
* @copyright
9+
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
10+
* This program is free software; you can redistribute it and/or
11+
* modify it under the terms of the GNU General Public License as
12+
* published by the Free Software Foundation; either version 2 of
13+
* the License, or (at your option) any later version.
14+
*/
15+
16+
#include "NexHotspot.h"
17+
18+
/**
19+
* Constructor,inherited NexTouch's constructor function.
20+
*
21+
*/
22+
NexHotspot::NexHotspot(NexPid pid, NexCid cid, char *name,
23+
NexTouchEventCb pop, void *pop_ptr,
24+
NexTouchEventCb push, void *push_ptr)
25+
:NexTouch(pid, cid, name, pop, pop_ptr, push, push_ptr)
26+
{
27+
}
28+
29+
/**
30+
* Register hotspot push callback function.
31+
*
32+
* @param pop - the pointer to hotspot push callback function.
33+
* @param ptr - the parameter to be transmitted to hotspot push callback function.
34+
*/
35+
void NexHotspot::attachPush(NexTouchEventCb push, void *ptr)
36+
{
37+
NexTouch::attachPush(push, ptr);
38+
}
39+
40+
/**
41+
* Unload hotsopt push callback function.
42+
*
43+
*/
44+
void NexHotspot::detachPush(void)
45+
{
46+
NexTouch::detachPush();
47+
}
48+
49+
/**
50+
* Register hotspot pop callback function.
51+
*
52+
* @param pop - the pointer to hotspot pot callback function.
53+
* @param ptr - the parameter to be transmitted to hotspot pop callback function.
54+
*/
55+
void NexHotspot::attachPop(NexTouchEventCb pop, void *ptr)
56+
{
57+
NexTouch::attachPop(pop, ptr);
58+
}
59+
60+
/**
61+
* Unload hotsopt pop callback function.
62+
*
63+
*/
64+
void NexHotspot::detachPop(void)
65+
{
66+
NexTouch::detachPop();
67+
}

NexHotspot.h

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
1-
#ifndef __NEXHOTSPOT_H__
2-
#define __NEXHOTSPOT_H__
3-
#ifdef __cplusplus
4-
#include "NexTouch.h"
5-
6-
7-
/*
8-
* Hotspot
9-
*/
10-
class NexHotspot: public NexTouch
11-
{
12-
public: /* methods */
13-
NexHotspot(NexPid pid, NexCid cid, char *name,
14-
NexTouchEventCb pop = NULL, void *pop_ptr = NULL,
15-
NexTouchEventCb push = NULL, void *push_ptr = NULL);
16-
17-
void attachPush(NexTouchEventCb push, void *ptr = NULL);
18-
void detachPush(void);
19-
void attachPop(NexTouchEventCb pop, void *ptr = NULL);
20-
void detachPop(void);
21-
22-
};
23-
24-
#endif /* #ifdef __cplusplus */
25-
#endif /* #ifndef __NEXHOTSPOT_H__ */
1+
/**
2+
* @file NexHotspot.h
3+
*
4+
* API of NexHotspot.
5+
*
6+
* @author Wu Pengfei (email:<[email protected]>)
7+
* @date 2015/7/10
8+
* @copyright
9+
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
10+
* This program is free software; you can redistribute it and/or
11+
* modify it under the terms of the GNU General Public License as
12+
* published by the Free Software Foundation; either version 2 of
13+
* the License, or (at your option) any later version.
14+
*/
15+
16+
#ifndef __NEXHOTSPOT_H__
17+
#define __NEXHOTSPOT_H__
18+
#ifdef __cplusplus
19+
#include "NexTouch.h"
20+
21+
/**
22+
* NexHotspot,subclass of NexTouch,provides simple methods to control hotspot component.
23+
*
24+
*/
25+
class NexHotspot: public NexTouch
26+
{
27+
public: /* methods */
28+
NexHotspot(NexPid pid, NexCid cid, char *name,
29+
NexTouchEventCb pop = NULL, void *pop_ptr = NULL,
30+
NexTouchEventCb push = NULL, void *push_ptr = NULL);
31+
32+
void attachPush(NexTouchEventCb push, void *ptr = NULL);
33+
void detachPush(void);
34+
void attachPop(NexTouchEventCb pop, void *ptr = NULL);
35+
void detachPop(void);
36+
37+
};
38+
39+
#endif /* #ifdef __cplusplus */
40+
#endif /* #ifndef __NEXHOTSPOT_H__ */

0 commit comments

Comments
 (0)