Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3c5974e
add flow_device_manager application
rahul-daga-imgtec Mar 11, 2016
d2e97a5
Merge pull request #2 from rahul-daga-imgtec/master
Mar 11, 2016
bed614e
set device_id, fcap, licensee_id and device_type as mandatory resources
rahul-daga-imgtec Mar 15, 2016
03725b7
Merge pull request #3 from rahul-daga-imgtec/master
Mar 15, 2016
ae72ad2
increase timeout for server read operations
rahul-daga-imgtec Mar 17, 2016
39e647c
Merge pull request #4 from rahul-daga-imgtec/increase_timeout
Mar 18, 2016
c751b3d
use observe instead of polling FlowAccess object while provisioning c…
rahul-daga-imgtec Mar 18, 2016
be56c7e
Merge pull request #6 from rahul-daga-imgtec/use_observe
Mar 18, 2016
d33e6ce
change resource type of rememberMeTokenExpiry from integer to time
rahul-daga-imgtec Mar 21, 2016
7f3c98c
continue provisioning even if flowobject instance creation fails
rahul-daga-imgtec Mar 21, 2016
21c78c1
Merge pull request #7 from rahul-daga-imgtec/use_observe
Mar 21, 2016
ab939ba
set parent id while provisioning constrained device
pratik-prajapati-imgtec Mar 21, 2016
e8076e1
Merge pull request #9 from pratik-prajapati-imgtec/dev
Mar 21, 2016
1543bc5
remove flow references from filenames
rahul-daga-imgtec Mar 21, 2016
45c504b
Merge pull request #10 from rahul-daga-imgtec/dev
Mar 21, 2016
7114bb3
Update README.md
rahul-daga-imgtec Mar 21, 2016
ddcce67
remove unnecessary files
rahul-daga-imgtec Mar 22, 2016
a5b00db
Merge pull request #11 from rahul-daga-imgtec/rahul-daga-imgtec-patch-1
Mar 22, 2016
c52505f
Merge pull request #12 from rahul-daga-imgtec/remove_unnecessary_files
Mar 22, 2016
360cf75
update revision to 0.9.0
mayank-sirotiya-imgtec Mar 22, 2016
d74a329
Merge pull request #13 from mayank-sirotiya-imgtec/dev
Mar 22, 2016
a31d885
change flow_device_manager reference to device_manager
pratik-prajapati-imgtec Apr 4, 2016
db756f2
Merge pull request #15 from pratik-prajapati-imgtec/dev
nikhil-zinjurde-imgtec Apr 4, 2016
8d45a87
fix reprovisioning failure after failing to provision once
rahul-daga-imgtec Apr 6, 2016
33d2b13
Merge pull request #16 from rahul-daga-imgtec/fix_reprovisioning
Apr 7, 2016
9733b1f
color logs
pratik-prajapati-imgtec Apr 11, 2016
867fe73
Convert tabs to spaces
mayank-sirotiya-imgtec Apr 7, 2016
9e77ea1
Replace 'success' with 'result' and merge lines
mayank-sirotiya-imgtec Apr 7, 2016
efd65ee
Fix incorrect log level from LOG_INFO to LOG_ERR
mayank-sirotiya-imgtec Apr 12, 2016
b137f93
Merge pull request #17 from mayank-sirotiya-imgtec/dev
Apr 13, 2016
634cfce
fix constrained device provisioning issue
rahul-daga-imgtec Apr 15, 2016
0fbd2fa
Merge pull request #19 from rahul-daga-imgtec/fix_provisioning_issue
Apr 18, 2016
2f7d9c7
reduce 6lowpan traffic while provisioning constrained devices
rahul-daga-imgtec Apr 22, 2016
6b719f2
Merge pull request #21 from rahul-daga-imgtec/reduce_6lowpan_traffic
Apr 26, 2016
1ed2e45
add doxygen documentation (#22)
mayank-sirotiya-imgtec May 13, 2016
96c28e2
Merge branch 'dev' to 'master'
mayank-sirotiya-imgtec May 16, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Project Properties
####################
CMAKE_MINIMUM_REQUIRED (VERSION 2.6.2)

PROJECT(device_manager)
# This will be extended to take the version from SCM
# Version config can be simplified from 3.0+
SET(device_manager_VERSION_MAJOR 0)
SET(device_manager_VERSION_MINOR 9)
SET(device_manager_VERSION_PATCH 0)
SET(device_manager_VERSION
${device_manager_VERSION_MAJOR}.${device_manager_VERSION_MINOR}.${device_manager_VERSION_PATCH})

# Options
###################
SET(CMAKE_VERBOSE_MAKEFILE 1)
SET(CMAKE_BUILD_TYPE DEBUG) # Options MINSIZEREL, RELEASE, DEBUG
SET(DOCS_INTERNAL 1 CACHE BOOL "enable internal docs generation")

# Includes
##########
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

# Paths
########
ADD_SUBDIRECTORY(src)
96 changes: 94 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,94 @@
# device-manager
device-manager application
## Device Manager
Device Manager application is used to provision the gateway device and constrained devices with access details to register with the FlowCloud. It runs on the gateway device and uses the Awalwm2m sdk to communicate with the awalwm2m server and client running on the same.
Currently it can be used to :
- Provision the gateway device
- Check if the gateway device is provisioned or not
- Provision the constrained device
- Check if the constrained device is provisioned or not
- List the constrained devices connected to the local server

## Revision History
| Revision | Changes from previous revision |
| :---- | :------------------------------|
| 0.9.0 | External Beta Trial Release |

## Prerequisites
Prior to running device manager, make sure that:
- Awalwm2m client daemon(awa_clientd) is running.
- Awalwm2m server daemon(awa_serverd) is running.

**NOTE:** Please do "ps" on console to see "specific" process is running or not.

## Application flow diagram
![Device Manager Sequence Diagram](docs/device-manager-ubusd-seq-diag.png)

## Using the ubus interface of Device Manager
### Provisioning the gateway device:

```
root@OpenWrt:/# ubus -t 60 call device_manager provision_gateway_device '{"device_name":"MyCi40","device_type":"FlowGateway","licensee_id":7,"fcap":"XXXXXXXXXX", "licensee_secret":"XXXXXXXXXXXXXX"}'
{
"provision_status": 0
}
```
Status 0 : The device was provisioned successfully.
Status 1 : Provisoning failed
Status 2 : The device was already provisioned.

### Checking if the gateway device is provisioned or not
```
root@OpenWrt:/# ubus call device_manager is_gateway_device_provisioned
{
"provision_status": false
}
```

### Listing the devices connected to the gateway device
```
root@OpenWrt:/# ubus call device_manager get_client_list
{
"clients": [
{
"clientId": "LedDevice",
"is_device_provisioned": false
}
]
}
```

### Provisioning a constrained device:
```
root@OpenWrt:/# ubus -t 60 call device_manager provision_constrained_device '{"fcap":"XXXXXXXXXX", "client_id":"LedDevice", "licensee_id": 7, "device_type" : "FlowCreatorLED", "parent_id": "08 5A 24 DE A8 C2 0A 4B AB 24 4C F6 ED 5D 5F 62 "}'
{
"status": 0
}
```
**NOTE:** The parent id should be the same as the device id of the gateway device. It can be read from /etc/lwm2m/flow_access.cfg

### Checking if the constrained device is provisioned or not
```
root@OpenWrt:/# ubus call device_manager is_constrained_device_provisioned '{"client_id":"LedDevice"}'
{
"provision_status": false
}

```

## Debugging

The logs of device manager application can be found at /var/log/device_manager_ubusd

## API guide

Device Manager documentation is available as a Doxygen presentation which is generated via the following process.

1. Install [Doxygen ](http://www.stack.nl/~dimitri/doxygen/download.html): ```` sudo apt-get install doxygen````
2. Generate the documentation:

$ device-manager: mkdir build
$ device-manager/build: cd build
$ device-manager/build: cmake ../docs
$ device-manager/build: make docs

The output can be found in the build/html directory and viewed by opening index.html with your web browser.
>>>>>>> dev
22 changes: 22 additions & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Add docs targets
#################
CMAKE_MINIMUM_REQUIRED (VERSION 2.6.2)

FIND_PACKAGE(Doxygen)
IF(DOXYGEN_FOUND)
SET(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in)

SET(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/doxyfile)
CONFIGURE_FILE(${doxyfile_in} ${doxyfile} @ONLY)

ADD_CUSTOM_TARGET(docs
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
ELSE()
MESSAGE(WARNING "Doxygen not found. Cannot generate documentation!")
ADD_CUSTOM_TARGET(docs
COMMENT "***Doxygen not found! Please install doxygen to make docs***"
VERBATIM)
ENDIF()
16 changes: 16 additions & 0 deletions docs/creator.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#imglogo {
padding-left:0px;
background: url(imgteclogo.png) no-repeat right center #770172;
height:80px;
}
#creatorlogo {
background: url(creatorlogo.png) no-repeat left center transparent;
display:block;
width:260px;
height:80px;
}

.copyright_footer {
margin-left: 10px;
color: #666666;
}
47 changes: 47 additions & 0 deletions docs/creator_footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
$navpath
<li class="footer">$generatedby
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW-->
<hr class="footer"/><address class="footer"><small>
<b>Copyright (c) 2016, Imagination Technologies Limited and/or its affiliated group companies.</b>
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials provided
with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior written
permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
HETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<BR>
$generatedby &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
</a> $doxygenversion
</small></address>
<!--END !GENERATE_TREEVIEW-->
</body>
</html>
17 changes: 17 additions & 0 deletions docs/creator_header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>$title</title>
<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"/>
<link href="$relpath$creator.css" rel="stylesheet" type="text/css"/>
$search


</head>
<body>

<div id="imglogo" title="Imagination Technologies Ltd">
<a id="creatorlogo" href="http://flow.imgtec.com/developers" height="80" target="_blank" title="Creator"></a>
</div>
Binary file added docs/creatorlogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/device-manager-ubusd-seq-diag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions docs/doxyfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
PROJECT_NAME = "@CMAKE_PROJECT_NAME@"
PROJECT_NUMBER = @device_manager_VERSION@
JAVADOC_AUTOBRIEF = YES
HTML_HEADER = @PROJECT_SOURCE_DIR@/creator_header.html
HTML_FOOTER = @PROJECT_SOURCE_DIR@/creator_footer.html
GENERATE_LATEX = NO
#HAVE_DOT = YES
STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ \
@PROJECT_BINARY_DIR@
INPUT = @PROJECT_SOURCE_DIR@/../src/ \
@PROJECT_SOURCE_DIR@/mainpage.dox
FILE_PATTERNS = *.h \
*.c
RECURSIVE = YES
EXTRACT_STATIC = YES
HTML_STYLESHEET = @PROJECT_SOURCE_DIR@/doxygen.css
HTML_EXTRA_STYLESHEET = @PROJECT_SOURCE_DIR@/creator.css
HTML_EXTRA_FILES = @PROJECT_SOURCE_DIR@/tabs.css \
@PROJECT_SOURCE_DIR@/imgteclogo.png \
@PROJECT_SOURCE_DIR@/creatorlogo.png
GENERATE_TAGFILE = @PROJECT_BINARY_DIR@/tagfile
USE_MDFILE_AS_MAINPAGE = @doxy_main_page@
IMAGE_PATH = @PROJECT_SOURCE_DIR@/device-manager-ubusd-seq-diag.png
Loading