When using client.js to discovery the server resources , sometimes it can't find the resource, but using iot-rest-api-server/test/oic-get to get the resource, it can find the resources every time. I am not clear the reason, is there anything missing?
Reproduce Steps:
Prepare two Joule boards with iot-ref-kit image, one as OCF Client, other is OCF Server.
Run this server led.js on the server board, and run this client.js on client board:
Description
When using client.js to discovery the server resources , sometimes it can't find the resource, but using iot-rest-api-server/test/oic-get to get the resource, it can find the resources every time. I am not clear the reason, is there anything missing?
Reproduce Steps:
var client = require( 'iotivity-node' ).client;
// Error handler function errorHandler(error) { console.log(error.message + JSON.stringify( error, null, 4 ) ); }
// Add error event listener. client.on("error", errorHandler);
client.on( "resourcefound", function( resource ) { console.log(resource); } ) .findResources() .then( function() { console.log( "find" ); }, function( error ) { console.log( 'Failed'); } );
indResources: Unexpected response{ "response": { "devAddr": { "adapter": 2, "flags": 0, "ifindex": 0, "port": 0, "addr": "" }, "addr": { "adapter": 2, "flags": 0, "ifindex": 0, "port": 0, "addr": "" }, "connType": 131072, "identity": [], "result": 255, "sequenceNumber": 0, "resourceUri": "/oic/res", "rcvdVendorSpecificHeaderOptions": [] } }