-1

i am using these codes:

Client.js:

var client = require('./Client');
client.on("resourcefound",function(event){
    //client.retrieve();
    //client.update();
});
client.findResources();

Server.js:

var server=require('./Server');

server.register({
    resourcePath:"/a/fan",
    resourceTypes:[ "core.fan" ],
    interfaces:["oic.if.baseline"],
    discoverable: true,
    properties:{on:false}
});

I am running these codes and nothing happened like a infinite loop in both terminals.

I am using Sakari's code and i get a lot of errors

Can anyone help me to understand if client discovers the resource and what can i do to see the request and response.

PS:i dont know if require is correct Sakari says require("oic")("client") for the client.js but i get error like oic not found.

jimloca
  • 1
  • 2

1 Answers1

0

I would recommend you to use a more recent version of the iotivity-node. IoTivity 1.3.0 has been released and it should now be supported by the recent version of iotivity-node.

Please use the latest code and let me know if you still face the issues.

refer to the client and server code under the following path.

js/high-level-client-example.js js/high-level-server-example.js

Sanjeev BA
  • 307
  • 1
  • 6