Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Opens for building iotivity-node on host #39

Closed
wanghongjuan opened this issue Jan 14, 2016 · 1 comment
Closed

Opens for building iotivity-node on host #39

wanghongjuan opened this issue Jan 14, 2016 · 1 comment

Comments

@wanghongjuan
Copy link

Follow the README.md(https://github.com/otcshare/iotivity-node/blob/master/README.md) to set up iotivity-node:

  1. Run the steps 1 to 5, grab a snapshot of iotivity from https://gerrit.iotivity.org/gerrit/gitweb?p=iotivity.git;a=tree;hb=1.0.0
  2. Set up the environment(steps 6):
$ export OCTBSTACK_CFLAGS="-I/home/nix/iot/iotivity/resource/csdk/stack/include"
$ export OCTBSTACK_LIBS="-L/home/nix/iot/iotivity/out/linux/x86/release -loctbstack -Wl,-rpath=/home/nix/iot/iotivity/out/linux/x86/release"
$ npm install
$ ./dish.sh

But failed to run command $ node-gyp rebuild in file dish.sh, then I update the environment path

$ export OCTBSTACK_CFLAGS="-I/home/nix/iot/iotivity/resource/csdk/stack/include"

to

$ export OCTBSTACK_CFLAGS="-I/home/nix/iot/iotivity/resource/csdk/stack/include 
-I/home/hj/iot/eg/iotivity-node-test/iotivity/resource/c_common 
-I/home/hj/iot/eg/iotivity-node-test/iotivity/resource/csdk/ocrandom/include/"

Rerun command $ node-gyp rebuild, build successfully.
3. Run the examples in the README.md

$ node js/server.discoverable.js

Open one new terminal

$ node js/client.discovery.js

Show some json format data after run the client script:

{
    "devAddr": {
        "adapter": 1,
        "flags": 32,
        "interface": 2,
        "port": 44131,
        "addr": [
            102,
            101,
            56,
            48,
            58,
            58,
            57,
            97,
            57,
            48,
            58,
            57,
            54,
            102,
            102,
            58,
            102,
            101,
            98,
            98,
            58,
            100,
            97,
            100,
            50,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
        ]
    },
    "connType": 0,
    "result": 65568,
    "sequenceNumber": 0,
    "rcvdVendorSpecificHeaderOptions": []
}

Should I update the environment path when set up the environment for iotivity-node on PC host?
Is the result right about the examples "server/client.discovery.js" of repo iotivity-node?

@zqzhang zqzhang changed the title Set up iotivity-node on desktop Opens for building iotivity-node on host Jan 14, 2016
@gabrielschulhof
Copy link

Yes, the paths specified in the environment variables OCTBSTACK_CFLAGS and OCTBSTACK_LIBS need to reflect your own environment.

The output looks right. Of course, the examples in js/ are not designed to be tests.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants