@@ -198,8 +198,6 @@ function subscribeNgsi1(device, triggers, content, callback) {
198
198
* @param {Object } content Array with the names of the attributes to retrieve in the notification.
199
199
*/
200
200
function subscribeNgsi2 ( device , triggers , content , callback ) {
201
-
202
- // console.error(device);
203
201
var options = {
204
202
method : 'POST' ,
205
203
headers : {
@@ -243,8 +241,6 @@ function subscribeNgsi2(device, triggers, content, callback) {
243
241
} else {
244
242
options . uri = config . getConfig ( ) . contextBroker . url + '/v2/subscriptions' ;
245
243
}
246
-
247
- // console.error(JSON.stringify(options));
248
244
deviceService . executeWithSecurity ( options ,
249
245
device , createSubscriptionHandlerNgsi2 ( device , triggers , store , callback ) ) ;
250
246
}
@@ -259,18 +255,14 @@ function subscribeNgsi2(device, triggers, content, callback) {
259
255
* @param {Object } triggers Array with the names of the attributes that would trigger the subscription
260
256
* @param {Object } content Array with the names of the attributes to retrieve in the notification.
261
257
*/
262
- function subscribeNgsiLD ( device , triggers , content , callback ) {
263
-
264
- // console.error(JSON.stringify(device))
265
-
266
-
258
+ function subscribeNgsiLD ( device , triggers , content , callback ) {
267
259
var options = {
268
260
method : 'POST' ,
269
261
headers : {
270
262
'fiware-service' : device . service
271
263
} ,
272
264
json : {
273
- type : " Subscription" ,
265
+ type : ' Subscription' ,
274
266
entities : [
275
267
{
276
268
id : device . name ,
@@ -301,8 +293,6 @@ function subscribeNgsiLD(device, triggers, content, callback) {
301
293
} else {
302
294
options . uri = config . getConfig ( ) . contextBroker . url + '/ngsi-ld/v1/subscriptions/' ;
303
295
}
304
-
305
- // console.error(JSON.stringify(options));
306
296
deviceService . executeWithSecurity ( options ,
307
297
device , createSubscriptionHandlerNgsi2 ( device , triggers , store , callback ) ) ;
308
298
}
@@ -320,7 +310,6 @@ function subscribe(device, triggers, content, callback) {
320
310
if ( config . checkNgsiLD ( ) ) {
321
311
subscribeNgsiLD ( device , triggers , content , callback ) ;
322
312
} else if ( config . checkNgsi2 ( ) ) {
323
- // console.error(device);
324
313
subscribeNgsi2 ( device , triggers , content , callback ) ;
325
314
} else {
326
315
subscribeNgsi1 ( device , triggers , content , callback ) ;
0 commit comments