Application Service Node Device Platform based on Node.js.
Git Hub Project Link |
&Cube:Lavender |
Gub Hub Release Direct DownLoad Link | ||
Direct Link | Revision | Release Date |
nCube-Lavender-2.4.0.zip | v2.0.0 | Mar 2015 |
nCube-Lavender-2.0.0.zip | v2.0.0 | July 2017 |
As one of the oneM2M platforms, &Cube:Lavender provides common service functions (CSFs) to oneM2M applications and other oneM2M devices. &Cube:Lavender does have an implementation of ASN-CSE defined in oneM2M Functional Architecture and thus it acts as an end-device and provides proximity based IoT service.
nCube:Lavender shares the common source codes with Mobius platform since it has similarities of which it can provide common service functions (CSFs) defined in oneM2M Architecture but it does not allow other ASN-CSE (i.e., nCube:Lavender) or ADN-AE (i.e., nCubeThyme) to be registered with itself.
Source File | Role and Function |
lavender.js | It configures settings of &Cube:Lavender and also is used to run &Cube:Lavender. |
app.js | This file acts as role of flow router and it is the main code running Mobius-YT server.
① It handles initial processing of received packets. ② It initiates HTTP server with ‘listening’ mode to wait for HTTP requests target to the Mobius HTTP server. ③ It handles the parsing of URL of packets and evaluate the correctness of the request body resulted of parsing. It then sends the request to resource.js to continue the processing if the request is valid one, otherwise throws exceptions. This file also implements the server clustering algorithms to improve the performance of HTTP server. |
mobius/resource.js | It is core file to process the CREATE, RETRIEVE, UPDATE, DELETE, NOTIFY and DISCOVERY operations for oneM2M resource primitives. This file undertakes the processing of parsed request URI and request body received from app.js according to corresponding operation. It converts the data into a format to process the data and connect to mysql database. The mysql database is initialized and handled by db_action.js and sql_action.js module. |
mobius/responder.js | It is responsible for handling the response process. It receives processing results from app.js and resource.js modules and generates responses from the processing results following format requested by originator either XML or JSON serialization. |
mobius/db_action.js | This file contains parameters used to connect and access to the database and parameters for returning response results from the database. |
mobius/sql_action.js | This file contains functions to receive data and parameters required for a series of database operations and functions to call db_action.js module to return data from database. |
mobius/sgn.js | This module file is responsible for checking the existence of <subscription> child resource under the requested target resource. If it exists, the module checks the event type and retrieves the field value of attribute notificationUril. Then it generates and sends a notification message to the address indicated by field value of attribute notificationUril. |
mobius/security.js | This file contains functions to check the access privileges of originators for a requested resource when the resource applies with <accessControlPolicy> resource. The originator ID is abstracted from request header field of X-M2MOrigin. The process checks the access right of current originator ID to a target resource and responds with ACESS_DENIED error when the originator ID has no privileges to access to the resource. |
mobius/fopt.js | |
mobius/ts_agent.js | This file contains functions to manage <timeSeriesInstance> resource. It monitors the mssing data in the <timeSeriesInstance> resource and then stores the missing data. |
pxymqtt.js |
This file contains functions implementing mqtt proxying function to handle mqtt protocol messages in http protocol manner as following procedures: ① It creates a oneM2M mqtt topic with configuration information of Mobius server and then subscribe to the topic to receive mqtt requests targeted to this topic later. ② Whenever receiving mqtt protocol messages, it generates and sends a http request wrapping mqtt request message to Mobius server and waits for http response from Mobius server. It then abstracts http response and generates a mqtt response message correspondingly. ③ It responds with mqtt protocol message. |
pxy_coap.js |
This file contains functions implementing coap proxying function to handle coap protocol messages with http protocol module. |
pxu_ws.js |
This file contains functions implementing websocket proxying function to handle websocket protocol messages with http protocol module. |
mobius/acp.js | It contains functions to parse accessControlPolicy request. The accessControlPolicy resource is used to manage the access control privileges to resources that apply with access control policy. |
mobius/ae.js | It contains functions to parse AE request. |
mobius/cb.js | It contains functions to parse CSEBase request. The CSEBase resource contains configuration information of Mobius server. |
mobius/cin.js | It contains functions to parse contentInstance request. |
mobius/cnt.js | It contains functions to parse container request. |
mobius/csr.js | It contains functions to parse remoteCSE request. |
mobius/grp.js | It contains functions to parse group request. |
mobius/lcp.js | It contains functions to parse locationPolicy request. |
mobius/mms.js | It contains functions to parse multimediaSession request. |
mobius/mn.js | It contains functions to register this CSE to the other CSE. |
mobius/sd.js | It contains functions to parse semanticDescriptor request. |
mobius/sub.js | It contains functions to parse subscription request. |
mobius/ts.js | It contains functions to parse timeSeries request. |
mobius/tsi.js | It contains functions to parse timeSeriesInstance request. |
The &Cube-Lavender is the open source IoT device platform based on the oneM2M (http://www.oneM2M.org) standard. As one of the oneM2M platforms, &Cube-Lavender provides common services functions to oneM2M device applications that runs on the same device.
nCube-Lavender implementation of oneM2M ASN-CSE which can be connected to MN-CSE or IN-CSE.
The nCube-Lavender was developed with javascript of node.js and it also uses the MySQL to store data.
[nCube-Lavender home]/mobius/mobiusdb.sql
npm install
{
"parent": {
"cbname": "Mobius", //CSEbase name
"cbcseid": "/Mobius", //CSEbase ID
"cbhost": "203.253.128.161", //CSEbase host IP
"cbhostport": "7579", //CSEbase http hosting port
"cbprotocol": "http", //CSEbase communication protocol
"mqttbroker": "203.253.128.161" //MQTT Broker IP
},
"csebaseport": "7499", //MN-CSE HTTP hosting IP
"dbpass": "dksklfdug2" //Local MySQL root password
}
Use node.js application execution command as below
node lavender.js
This is the list of library dependencies for &Cube-Lavender
If you want more details please dowload the full installation guide document.
Copyright (c) 2017, IoTKETI All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* 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.
* 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, WHETHER 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.