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

Commit

Permalink
All: Build against 809b1b1e9be15724a6d756b403328a95894e639f
Browse files Browse the repository at this point in the history
Fixes gh-2
Fixes gh-6
  • Loading branch information
Gabriel Schulhof committed Jun 5, 2015
1 parent cc98359 commit 4d3d17c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This project provides [iotivity](http://iotivity.org/) node.js bindings.

## Installation

iotivity-node depends on [iotivity](http://iotivity.org/) proper. It has been tested against [6a49412](https://gerrit.iotivity.org/gerrit/gitweb?p=iotivity.git;a=tree;h=40514d0b79627ff4372d36fea1d12b346e284c86;hb=6a49412877aed68effcaee9e5d2210f1a173e570) on Linux. During compilation, it uses pkgconfig to retrieve the iotivity compiler and linker flags. This means that you have to first build and install iotivity. The following procedure is known to work on Linux:
iotivity-node depends on [iotivity](http://iotivity.org/) proper. It has been tested against [809b1b1](https://gerrit.iotivity.org/gerrit/gitweb?p=iotivity.git;a=tree;hb=809b1b1e9be15724a6d756b403328a95894e639f) on Linux. During compilation, it uses pkgconfig to retrieve the iotivity compiler and linker flags. This means that you have to first build and install iotivity. The following procedure is known to work on Linux:

0. Grab a [snapshot](https://gerrit.iotivity.org/gerrit/gitweb?p=iotivity.git;a=snapshot;h=40514d0b79627ff4372d36fea1d12b346e284c86;sf=tgz) of iotivity from its git repository and unpack it locally.
0. Make sure a compiler, make, and [scons](http://www.scons.org/) (a build tool) are installed. Your distribution should provide all these tools.
Expand Down
5 changes: 4 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"<!(node -e \"require('nan')\")"
],
"libraries": [ '<!(pkg-config --libs octbstack)' ],
"cflags": [ '<!(pkg-config --cflags octbstack)' ]
"cflags": [
'<!(pkg-config --cflags octbstack)',
'-std=c++11'
]
},
"targets": [
{
Expand Down
2 changes: 1 addition & 1 deletion js/client.observe.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function getAbsoluteUrl( response ) {

return "coap://" +
ipv4Bytes[ 0 ] + "." + ipv4Bytes[ 1 ] + "." + ipv4Bytes[ 2 ] + "." + ipv4Bytes[ 3 ] + ":" +
portHolder.port + JSON.parse( response.resJSONPayload ).oc[ 0 ].href;
portHolder.port + JSON.parse( response.resJSONPayload ).oic[ 0 ].href;
}

iotivity.OCInit( null, 0, iotivity.OCMode.OC_CLIENT );
Expand Down
2 changes: 1 addition & 1 deletion js/server.observe.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ iotivity.OCCreateResource(
}
} );

console.log( "OCCreateResource() handler: Entering" );
console.log( "OCCreateResource() handler: Responding with " + payload );
iotivity.OCDoResponse( {
requestHandle: request.requestHandle.handle,
resourceHandle: request.resource.handle,
Expand Down
11 changes: 5 additions & 6 deletions src/enums.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ using namespace v8;
static Local<Object> bind_OCEntityHandlerFlag() {
Local<Object> returnValue = NanNew<Object>();

returnValue->ForceSet(NanNew<String>("OC_INIT_FLAG"),
NanNew<Number>(OC_INIT_FLAG),
static_cast<PropertyAttribute>(ReadOnly || DontDelete));
returnValue->ForceSet(NanNew<String>("OC_REQUEST_FLAG"),
NanNew<Number>(OC_REQUEST_FLAG),
static_cast<PropertyAttribute>(ReadOnly || DontDelete));
Expand Down Expand Up @@ -43,6 +40,9 @@ static Local<Object> bind_OCEntityHandlerResult() {
returnValue->ForceSet(NanNew<String>("OC_EH_FORBIDDEN"),
NanNew<Number>(OC_EH_FORBIDDEN),
static_cast<PropertyAttribute>(ReadOnly || DontDelete));
returnValue->ForceSet(NanNew<String>("OC_EH_RESOURCE_NOT_FOUND"),
NanNew<Number>(OC_EH_RESOURCE_NOT_FOUND),
static_cast<PropertyAttribute>(ReadOnly || DontDelete));

return returnValue;
}
Expand Down Expand Up @@ -296,10 +296,9 @@ static Local<Object> bind_OCVirtualResources() {
static Local<Object> bind_OCConnectivityType() {
Local<Object> returnValue = NanNew<Object>();

returnValue->ForceSet(NanNew<String>("OC_ETHERNET"),
NanNew<Number>(OC_ETHERNET),
returnValue->ForceSet(NanNew<String>("OC_IPV4"), NanNew<Number>(OC_IPV4),
static_cast<PropertyAttribute>(ReadOnly || DontDelete));
returnValue->ForceSet(NanNew<String>("OC_WIFI"), NanNew<Number>(OC_WIFI),
returnValue->ForceSet(NanNew<String>("OC_IPV6"), NanNew<Number>(OC_IPV6),
static_cast<PropertyAttribute>(ReadOnly || DontDelete));
returnValue->ForceSet(NanNew<String>("OC_EDR"), NanNew<Number>(OC_EDR),
static_cast<PropertyAttribute>(ReadOnly || DontDelete));
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/simple-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ test( "Simple client", function( assert ) {

// Make sure the callback was called with the right response
assert.deepEqual(
JSON.parse( response.resJSONPayload ).oc[ 0 ],
JSON.parse( response.resJSONPayload ).oic[ 0 ],
magicToken,
"OCDoResource observation handler has received the " +
"expected response" );
Expand Down

0 comments on commit 4d3d17c

Please sign in to comment.