Skip to content

Commit

Permalink
Merge pull request #105 from dcalvoalonso/task/travisCI
Browse files Browse the repository at this point in the history
Task/travis ci
  • Loading branch information
AlvaroVega authored Dec 22, 2017
2 parents b521d42 + b225434 commit a874d94
Show file tree
Hide file tree
Showing 12 changed files with 3,704 additions and 1,940 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ branches:

services:
- mongodb
- docker

install:
- npm install

before_install:
- docker pull fiware/orion:latest
- docker run -d --net host -l orion fiware/orion:latest
- npm install -g grunt-cli

dist: precise
4 changes: 3 additions & 1 deletion CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
- Update Howtos with the last changes of the IoT Agent library (#48).
- Add test cases to check first observation of a value (#54).
- Update to master branch of IoTAgent Library and LWM2M Library 0.5.0.
- FEATURE update node version to 4.8.4
- FEATURE update node version to 4.8.4
- Unit tests are executed as part of Travis CI.
- Fixing issues in the provisioning API (#99 and #100) as result of npm-shrinkwrap file update.
15 changes: 8 additions & 7 deletions lib/ngsiHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ function selectRealName(extractedName, device, callback) {
* @param {String} type Type of the entity.
* @param {Array} attributes List of attributes of the entity to be updated (including type and value).
*/
function ngsiUpdateHandler(id, type, attributes, callback) {
function ngsiUpdateHandler(id, type, service, subservice, attributes, callback) {

var name = id.substring(0, id.indexOf(':'));

logger.debug(context, 'Handling device data update from the northbound for device [%s] of type [%s]', id, type);
Expand All @@ -161,12 +162,12 @@ function ngsiUpdateHandler(id, type, attributes, callback) {
name = id;
}

iotAgentLib.getDeviceByName(id, function(error, ngsiDevice) {
iotAgentLib.getDeviceByName(id, service, subservice, function(error, ngsiDevice) {
if (error) {
callback(error);
} else {
async.waterfall([
async.apply(iotAgentLib.getDeviceByName, id),
async.apply(iotAgentLib.getDeviceByName, id, service, subservice),
async.apply(selectRealName, name),
lwm2mLib.getRegistry().getByName,
apply(updateDevice, ngsiDevice)
Expand All @@ -176,7 +177,7 @@ function ngsiUpdateHandler(id, type, attributes, callback) {

}

function ngsiExecuteHandler(id, type, attributes, callback) {
function ngsiExecuteHandler(id, type, service, subservice, attributes, callback) {
var name = id.substring(0, id.indexOf(':'));

logger.debug(context, 'Handling device command execution from the northbound for device [%s] of type [%s]',
Expand Down Expand Up @@ -215,7 +216,7 @@ function ngsiExecuteHandler(id, type, attributes, callback) {
);
}

iotAgentLib.getDeviceByName(id, function(error, ngsiDevice) {
iotAgentLib.getDeviceByName(id, service, subservice, function(error, ngsiDevice) {
if (error) {
callback(error);
} else {
Expand All @@ -237,7 +238,7 @@ function ngsiExecuteHandler(id, type, attributes, callback) {
* @param {String} type Type of the entity.
* @param {Array} attributes List of attributes to read.
*/
function ngsiQueryHandler(id, type, attributes, callback) {
function ngsiQueryHandler(id, type, service, subservice, attributes, callback) {
var name = id.substring(0, id.indexOf(':'));

logger.debug(context, 'Handling device data query from the northbound for device [%s] of type [%s]', id, type);
Expand Down Expand Up @@ -291,7 +292,7 @@ function ngsiQueryHandler(id, type, attributes, callback) {
name = id;
}

iotAgentLib.getDeviceByName(id, function(error, ngsiDevice) {
iotAgentLib.getDeviceByName(id, service, subservice, function(error, ngsiDevice) {
if (error) {
callback(error);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/services/lwm2mHandlers/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function mapConfig(device, configuration, callback) {
subservice: configuration.subservice,
lazy: configuration.lazy,
attributes: configuration.attributes,
commands: configuration.commands,
internalId: device.id
};

Expand Down Expand Up @@ -271,7 +272,6 @@ function registrationHandler(endpoint, lifetime, version, binding, payload, call
logger.debug(context, 'Handling registration of the device');

function handleIncomingRegistrationRequest(error, lwm2mDevice, configuration) {

if (error) {
callback(error);
} else {
Expand Down
Loading

0 comments on commit a874d94

Please sign in to comment.