Skip to content

Commit 1251ba9

Browse files
Merge pull request #5 from CreatorKit/dev
Merge dev to master
2 parents abddd8c + 8fb0860 commit 1251ba9

21 files changed

Lines changed: 2203 additions & 2 deletions

CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Project Properties
2+
####################
3+
CMAKE_MINIMUM_REQUIRED (VERSION 2.6.2)
4+
PROJECT(motion_led_controller)
5+
# This will be extended to take the version from SCM
6+
# Version config can be simplified from 3.0+
7+
SET(motion_led_controller_VERSION_MAJOR 0)
8+
SET(motion_led_controller_VERSION_MINOR 9)
9+
SET(motion_led_controller_VERSION_PATCH 1)
10+
SET(motion_led_controller_VERSION
11+
${motion_led_controller_VERSION_MAJOR}.${motion_led_controller_VERSION_MINOR}.${motion_led_controller_VERSION_PATCH})
12+
13+
# Options
14+
###################
15+
SET(CMAKE_VERBOSE_MAKEFILE 1)
16+
SET(CMAKE_BUILD_TYPE DEBUG) # Options MINSIZEREL, RELEASE, DEBUG
17+
18+
# Paths
19+
########
20+
ADD_SUBDIRECTORY(src)

README.md

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,78 @@
1-
# light-controller
2-
Light controller application for Creator Ci40 platform
1+
2+
![Creator logo](docs/creatorlogo.png)
3+
4+
# Motion-Led Controller application
5+
6+
## Overview
7+
Motion led controller application runs on Ci40 board. One MikroE board acts as awalwm2m client having a clicker which detects motion. Controller application acts as awalwm2m server and observes any changes in lwm2m object registered by client on server, and whenever there is a change, controller gets a notification for the same, and glow led for 5 seconds.
8+
9+
| Object Name | Object ID | Resource Name | Resource ID |
10+
| :---- | :--------------| :------------- | :-----------|
11+
| "Presence Sensor" | 3302 | "IlluminanceSensor" | 5501 |
12+
13+
## Prerequisites
14+
Prior to running motion led controller application, make sure that:
15+
- Awalwm2m server daemon(awa_serverd) is running.
16+
- Awalwm2m bootstrap daemon(awa_bootstrapd) is running.
17+
18+
**NOTE:** Please do "ps" on console to see "specific" process is running or not.
19+
20+
## Application flow diagram
21+
![Motion-Led Controller Sequence Diagram](docs/motion-led-controller-seq-diag.png)
22+
23+
## API guide
24+
25+
Motion-Led Controller documentation is available as a Doxygen presentation which is generated via the following process.
26+
27+
1. Install [Doxygen ](http://www.stack.nl/~dimitri/doxygen/download.html): ```` sudo apt-get install doxygen````
28+
2. Generate the documentation:
29+
30+
$ motion-led-controller: mkdir build
31+
$ motion-led-controller/build: cd build
32+
$ motion-led-controller/build: cmake ../docs
33+
$ motion-led-controller/build: make docs
34+
35+
The output can be found in the build/html directory and viewed by opening index.html with your web browser.
36+
37+
## Running Application on Ci40 board
38+
Motion-Led Controller Application is getting started as a daemon. Although we could also start it from the command line as :
39+
40+
*$ motion_led_controller_appd*
41+
42+
Output looks something similar to this :
43+
```
44+
Motion-Led Controller Application
45+
46+
------------------------
47+
48+
49+
Establish server session for port:54321 and address:127.0.0.1
50+
51+
Server session established
52+
53+
54+
Defining IlluminanceSensor[3302] object on awalwm2m server
55+
56+
Waiting for constrained device 'MotionSensorDevice' to be up
57+
58+
Constrained device MotionSensorDevice registered
59+
60+
Successfully added observe operation for sensor object[3302/0/5501]
61+
62+
63+
Received observe callback for sensor object[3302/0/5501] with value 1
64+
65+
Sensor state has changed
66+
67+
Turn ON led on Ci40 board
68+
69+
Turn OFF led on Ci40 board
70+
71+
Received observe callback for sensor object[3302/0/5501] with value 2
72+
73+
Sensor state has changed
74+
75+
Turn ON led on Ci40 board
76+
77+
Turn OFF led on Ci40 board
78+
```

docs/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Add docs targets
2+
#################
3+
CMAKE_MINIMUM_REQUIRED (VERSION 2.6.2)
4+
5+
FIND_PACKAGE(Doxygen)
6+
IF(DOXYGEN_FOUND)
7+
SET(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in)
8+
9+
SET(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/doxyfile)
10+
CONFIGURE_FILE(${doxyfile_in} ${doxyfile} @ONLY)
11+
12+
ADD_CUSTOM_TARGET(docs
13+
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
14+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
15+
COMMENT "Generating API documentation with Doxygen"
16+
VERBATIM)
17+
ELSE()
18+
MESSAGE(WARNING "Doxygen not found. Cannot generate documentation!")
19+
ADD_CUSTOM_TARGET(docs
20+
COMMENT "***Doxygen not found! Please install doxygen to make docs***"
21+
VERBATIM)
22+
ENDIF()

docs/creator.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#imglogo {
2+
padding-left:0px;
3+
background: url(imgteclogo.png) no-repeat right center #770172;
4+
height:80px;
5+
}
6+
#creatorlogo {
7+
background: url(creatorlogo.png) no-repeat left center transparent;
8+
display:block;
9+
width:260px;
10+
height:80px;
11+
}
12+
13+
.copyright_footer {
14+
margin-left: 10px;
15+
color: #666666;
16+
}

docs/creator_footer.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!-- HTML footer for doxygen 1.8.6-->
2+
<!-- start footer part -->
3+
<!--BEGIN GENERATE_TREEVIEW-->
4+
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
5+
<ul>
6+
$navpath
7+
<li class="footer">$generatedby
8+
<a href="http://www.doxygen.org/index.html">
9+
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
10+
</ul>
11+
</div>
12+
<!--END GENERATE_TREEVIEW-->
13+
<!--BEGIN !GENERATE_TREEVIEW-->
14+
<hr class="footer"/><address class="footer"><small>
15+
<b>Copyright (c) 2016, Imagination Technologies Limited and/or its affiliated group companies.</b>
16+
All rights reserved.
17+
18+
Redistribution and use in source and binary forms, with or without modification, are permitted
19+
provided that the following conditions are met:
20+
21+
1. Redistributions of source code must retain the above copyright notice, this list of conditions
22+
and the following disclaimer.
23+
24+
2. Redistributions in binary form must reproduce the above copyright notice, this list of
25+
conditions and the following disclaimer in the documentation and/or other materials provided
26+
with the distribution.
27+
28+
3. Neither the name of the copyright holder nor the names of its contributors may be used to
29+
endorse or promote products derived from this software without specific prior written
30+
permission.
31+
32+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
33+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
34+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
35+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
38+
HETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
39+
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40+
<BR>
41+
$generatedby &#160;<a href="http://www.doxygen.org/index.html">
42+
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
43+
</a> $doxygenversion
44+
</small></address>
45+
<!--END !GENERATE_TREEVIEW-->
46+
</body>
47+
</html>

docs/creator_header.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5+
<title>$title</title>
6+
<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
7+
<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"/>
8+
<link href="$relpath$creator.css" rel="stylesheet" type="text/css"/>
9+
$search
10+
11+
12+
</head>
13+
<body>
14+
15+
<div id="imglogo" title="Imagination Technologies Ltd">
16+
<a id="creatorlogo" href="http://flow.imgtec.com/developers" height="80" target="_blank" title="Creator"></a>
17+
</div>

docs/creatorlogo.png

8.15 KB
Loading

docs/doxyfile.in

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
PROJECT_NAME = "@CMAKE_PROJECT_NAME@"
2+
PROJECT_NUMBER = @led_controller_VERSION@
3+
JAVADOC_AUTOBRIEF = YES
4+
HTML_HEADER = @PROJECT_SOURCE_DIR@/creator_header.html
5+
HTML_FOOTER = @PROJECT_SOURCE_DIR@/creator_footer.html
6+
GENERATE_LATEX = NO
7+
#HAVE_DOT = YES
8+
STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ \
9+
@PROJECT_BINARY_DIR@
10+
INPUT = @PROJECT_SOURCE_DIR@/../src/ \
11+
@PROJECT_SOURCE_DIR@/mainpage.dox
12+
FILE_PATTERNS = *.h \
13+
*.c
14+
RECURSIVE = YES
15+
EXTRACT_STATIC = YES
16+
HTML_STYLESHEET = @PROJECT_SOURCE_DIR@/doxygen.css
17+
HTML_EXTRA_STYLESHEET = @PROJECT_SOURCE_DIR@/creator.css
18+
HTML_EXTRA_FILES = @PROJECT_SOURCE_DIR@/tabs.css \
19+
@PROJECT_SOURCE_DIR@/imgteclogo.png \
20+
@PROJECT_SOURCE_DIR@/creatorlogo.png
21+
GENERATE_TAGFILE = @PROJECT_BINARY_DIR@/tagfile
22+
USE_MDFILE_AS_MAINPAGE = @doxy_main_page@

0 commit comments

Comments
 (0)