Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
9 changes: 8 additions & 1 deletion bin/lwm2mAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ function start() {
config = require('../config');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an entry in CHANGES_NEXT_RELEASE about the changes included in this PR, eg:

- Add: DTLS support (#xx)

where #xx is an issue number, if we have some one for DTLS implementation in this repository.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(y)

}

if ( typeof(config.ngsi.contextBroker.verify) != "undefined" ){
if (config.ngsi.contextBroker.verify == false) {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
logger.info(context, 'Verify certificate for contextBroker are disabled.');
}
}

iotAgent.start(config, function (error) {
if (error) {
logger.error(context, 'Error starting Agent: [%s] Exiting process', error);
Expand All @@ -48,4 +55,4 @@ function start() {
});
}

start();
start();
106 changes: 106 additions & 0 deletions config-secure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
*
* This file is part of fiware-iotagent-lib
*
* fiware-iotagent-lib is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* fiware-iotagent-lib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with fiware-iotagent-lib.
* If not, seehttp://www.gnu.org/licenses/.
*
* For those usages not covered by the GNU Affero General Public License
* please contact with::[contacto@tid.es]
*/

var config = {};

config.lwm2m = {
logLevel: 'DEBUG',
port: 5683,
dtls: {
port: 5684,
cert: "cert.crt",
key: "cert.key"
},
defaultType: 'Device',
ipProtocol: 'udp4',
serverProtocol: 'udp4',
formats: [
{
name: 'application-vnd-oma-lwm2m/text',
value: 1541
},
{
name: 'application-vnd-oma-lwm2m/tlv',
value: 1542
},
{
name: 'application-vnd-oma-lwm2m/json',
value: 1543
},
{
name: 'application-vnd-oma-lwm2m/opaque',
value: 1544
}
],
writeFormat: 'application-vnd-oma-lwm2m/text',
types: [ ]
};

config.ngsi = {
logLevel: 'DEBUG',
contextBroker: {
host: 'localhost',
port: '1026',
protocol: 'https',
verify: false
},
server: {
port: 4041,
tls: {
key: "cert.key",
crt: "cert.crt"
}
},
deviceRegistry: {
type: 'memory'
},
types: {
'Raspberry':{
service: 'raspberry',
subservice: '/devices',
removeSuffix: true,
commands: [],
lazy: [],
active: [
{
name: "Light",
type: 'string'
}
],
lwm2mResourceMapping: {
'Light' : {
objectType: 3311,
objectInstance: 0,
objectResource: 0
}
}
}
},
service: 'raspberry',
subservice: '/devices',
providerUrl: 'https://localhost:4041',
deviceRegistrationDuration: 'P1M'
};

module.exports = config;

Loading