intel / iotivity-node

Node.js bindings for IoTivity
https://www.iotivity.org/
42 stars 44 forks source link

iotivity-node on iotivity 1.2.0-RC2 #76

Closed sanbeam closed 8 years ago

sanbeam commented 8 years ago

Made the following changes to make iotivity-node work on iotivity 1.2.0-RC2 Platform : artik

diff --git a/src/structures/oc-dev-addr.cc b/src/structures/oc-dev-addr.cc index ebe26c6..eb7b03a 100644 --- a/src/structures/oc-dev-addr.cc +++ b/src/structures/oc-dev-addr.cc @@ -30,7 +30,7 @@ Local js_OCDevAddr(OCDevAddr *address) {

SET_VALUE_ON_OBJECT(returnValue, Number, address, adapter); SET_VALUE_ON_OBJECT(returnValue, Number, address, flags);

  • SET_VALUE_ON_OBJECT(returnValue, Number, address, interface);
  • SET_VALUE_ON_OBJECT(returnValue, Number, address, ifindex); SET_VALUE_ON_OBJECT(returnValue, Number, address, port);

    // addr.addr @@ -53,7 +53,7 @@ bool c_OCDevAddr(Local jsDevAddr, OCDevAddr *address) { false, jsDevAddr, Uint32Value); VALIDATE_AND_ASSIGN(local, flags, OCTransportFlags, IsUint32, "addr", false, jsDevAddr, Uint32Value);

  • VALIDATE_AND_ASSIGN(local, interface, uint32_t, IsUint32, "addr", false,
  • VALIDATE_AND_ASSIGN(local, ifindex, uint32_t, IsUint32, "addr", false, jsDevAddr, Uint32Value); VALIDATE_AND_ASSIGN(local, port, uint16_t, IsUint32, "addr", false, jsDevAddr, Uint32Value); diff --git a/src/structures/oc-payload.cc b/src/structures/oc-payload.cc index 688a935..128590a 100644 --- a/src/structures/oc-payload.cc +++ b/src/structures/oc-payload.cc @@ -237,10 +237,10 @@ static Local js_OCLinksPayload(OCLinksPayload *payload) { ADD_STRING_ARRAY(returnValue, payload, itf); SET_STRING_IF_NOT_NULL(returnValue, payload, rel); Nan::Set(returnValue, Nan::New("obs").ToLocalChecked(),
  • Nan::New(payload->obs));
  • Nan::New(payload->p & 0x2)); SET_STRING_IF_NOT_NULL(returnValue, payload, title);
  • SET_STRING_IF_NOT_NULL(returnValue, payload, uri);
  • ADD_STRING_ARRAY(returnValue, payload, mt);
  • SET_STRING_IF_NOT_NULL(returnValue, payload, anchor);
  • ADD_STRING_ARRAY(returnValue, payload, type);

    return returnValue; }

  • Devices are discovered but no resources are reported.

    Insecure mode.

    Native client works fine.

    gabrielschulhof commented 8 years ago

    Please have a look at branch 1.2.0, for which the build passes.

    sanbeam commented 8 years ago

    Gabriel, I have set the OCTBSTACK_CFLAGS/LIBS to a version of iotivity based on 1.2.0-RC2 then I do node-gyp configure and rebuild.

    I get the following error npm http GET https://github.com/01org/iot-js-api-test-suite.git npm http 200 https://github.com/01org/iot-js-api-test-suite.git npm ERR! not a package /root/tmp/npm-6747-KqXnLwys/1475581201101-0.990159175824374/tmp.tgz npm ERR! Error: ENOENT, open '/root/tmp/npm-6747-KqXnLwys/1475581201101-0.990159175824374/package/package.json' npm ERR! If you need help, you may report this log at: npm ERR! http://github.com/isaacs/npm/issues npm ERR! or email it to: npm ERR! npm-@googlegroups.com

    npm ERR! System Linux 3.10.93 npm ERR! command "node" "/usr/bin/npm" "install" npm ERR! cwd /root/iotivity/wsi/iotivity-node npm ERR! node -v v0.10.42 npm ERR! npm -v 1.3.6 npm ERR! path /root/tmp/npm-6747-KqXnLwys/1475581201101-0.990159175824374/package/package.json

    I removed the test suite from package.json and built it.

    I have two resources that have same version of iotivity. Native client reports the resouces. This version of iotivity-node does not.

    sanbeam commented 8 years ago

    OCTBSTACK_CFLAGS was missing ROUTING_EP while building. That fixed it. Kudos Gabriel Thank you so much.