OpenZWave / node-openzwave-shared

OpenZWave addon for Node.js (all versions) including management and security functions
Other
199 stars 113 forks source link

no longer compiles against openzwave 1.5 #319

Closed sjorge closed 5 years ago

sjorge commented 5 years ago

This might be intentional though? But I was having a lot of issues with node-openzwave-shared + openzwave 1.6, that I wanted to revert to openzwave 1.5...

However node-openzwave-shared now fails to compile.

  CXX(target) Release/obj.target/openzwave_shared/src/callbacks.o
../src/callbacks.cc: In function 'void OZW::ozw_watcher_callback(const OpenZWave::Notification*, void*)':
../src/callbacks.cc:94:26: error: 'const class OpenZWave::Notification' has no member named 'GetCommand'; did you mean 'GetHomeId'?
     notif->command = cb->GetCommand();
                          ^~~~~~~~~~
                          GetHomeId
../src/callbacks.cc:99:33: error: 'Type_UserAlerts' is not a member of 'OpenZWave::Notification'
   case OpenZWave::Notification::Type_UserAlerts:
                                 ^~~~~~~~~~~~~~~
../src/callbacks.cc:100:31: error: 'const class OpenZWave::Notification' has no member named 'GetUserAlertType'
     notif->notification = cb->GetUserAlertType();
                               ^~~~~~~~~~~~~~~~
../src/callbacks.cc: In function 'void OZW::handleNotification(OZW::NotifInfo*)':
../src/callbacks.cc:459:33: error: 'Type_UserAlerts' is not a member of 'OpenZWave::Notification'
   case OpenZWave::Notification::Type_UserAlerts: {
                                 ^~~~~~~~~~~~~~~
../src/callbacks.cc:468:33: error: 'Type_ManufacturerSpecificDBReady' is not a member of 'OpenZWave::Notification'
   case OpenZWave::Notification::Type_ManufacturerSpecificDBReady: {
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sjorge commented 5 years ago

Ok so that means it walked the OPENZWAVE_16 path... which is weird.

sjorge commented 5 years ago

OK, maybe not as the version of 1.5 I was using has ValueBitSet.h, that might be because SmartOS support was between 1.5 and 1.6 ... so I mine was build form a git hash that has the file already...

edit: so the git branch I was using was between 1.5 and 1.6... but identified as 1.4 👎

sjorge commented 5 years ago

Moving ValueBitSet.h out of the way did not help :( As I am now hitting another error but that is also after the safe define... I am rather confused now... but I will dig a bit deeper.

Edit: this was a leftover from a bad uninstall of 1.6

[root@amethyst /opt/zwave2mqtt]# pkg-config --cflags-only-I libopenzwave | sed s/-I//g
/opt/local/include/openzwave/
[root@amethyst /opt/zwave2mqtt]# find /opt/local/include/openzwave/ -name ValueBitSet.h | wc -l
0
make: Entering directory '/opt/zwave2mqtt/node_modules/openzwave-shared/build'
  CXX(target) Release/obj.target/openzwave_shared/src/callbacks.o
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave.o
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave-config.o
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave-driver.o
  CXX(target) Release/obj.target/openzwave_shared/src/openzwave-groups.o
In file included from ../src/openzwave.hpp:45:0,
                 from ../src/openzwave-groups.cc:18:
../src/openzwave-groups.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE OZW::OZW::IsGroupMultiInstance(Nan::NAN_METHOD_ARGS_TYPE)':
../src/openzwave-groups.cc:175:37: error: 'class OpenZWave::Manager' has no member named 'IsMultiInstance'; did you mean 's_instance'?
   OZWManagerAssign(isMultiInstance, IsMultiInstance, homeid, nodeid, groupidx);
                                     ^
../src/utils.hpp:36:43: note: in definition of macro 'OZWManagerAssign'
      VALUE = OpenZWave::Manager::Get() -> METHOD ( __VA_ARGS__ ); \
sjorge commented 5 years ago

Using pkg-config to detect the version should probably also be a better solution e.g. pkg-config --modversion libopenzwave

sjorge commented 5 years ago

Ok so the problem is that the first version with smartos support is from between 1.5 and 1.6... but the git version tag is still 1.4 :S

The first version that somewhat works on SmartOS has both ValueBitSet.h and OZWException.h, so the build is now failing, I grabbed an older version of node-openzwave-shared and it is fine.

I'm going to close this for now, as I think moving forwards to 1.6 support is probably better in the short and long term.