OpenZWave / node-openzwave-shared

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

compilation fails with openzwave 1.6 #301

Closed nouknouk closed 5 years ago

nouknouk commented 5 years ago

Hi,

I got two compilation error with openzwave-1.6.737:

../src/utils.cc:255:49: error: ‘OpenZWave::Value’ has not been declared
   AddStringProp (nodeobj, type,      OpenZWave::Value::GetTypeNameFromEnum(value.GetType()));

../src/utils.cc:256:49: error: ‘OpenZWave::Value’ has not been declared
   AddStringProp (nodeobj, genre,     OpenZWave::Value::GetGenreNameFromEnum(value.GetGenre()));

I replaced the namespace for those two lines:

diff --git a/src/utils.cc b/src/utils.cc
index b5d8fa7..d46886c 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -252,8 +252,8 @@ namespace OZW {
                AddStringProp(nodeobj,  value_id,  buffer.c_str());
                AddIntegerProp(nodeobj, node_id,   value.GetNodeId());
                AddIntegerProp(nodeobj, class_id,  value.GetCommandClassId());
-               AddStringProp (nodeobj, type,      OpenZWave::Value::GetTypeNameFromEnum(value.GetType()));
-               AddStringProp (nodeobj, genre,     OpenZWave::Value::GetGenreNameFromEnum(value.GetGenre()));
+               AddStringProp (nodeobj, type,      OpenZWave::Internal::VC::Value::GetTypeNameFromEnum(value.GetType()));
+               AddStringProp (nodeobj, genre,     OpenZWave::Internal::VC::Value::GetGenreNameFromEnum(value.GetGenre()));
                AddIntegerProp(nodeobj, instance,  value.GetInstance());
                AddIntegerProp(nodeobj, index,     value.GetIndex());
                AddStringProp (nodeobj, label,     mgr->GetValueLabel(value).c_str());

... and it compiles now, but I don't know if it's an appropriate fix.

notes:

btw: thanks for your huge work on this lib

nouknouk commented 5 years ago

It seems related to a merge of yesterday in master branch of openzwave. Cf https://github.com/OpenZWave/open-zwave/pull/1829/commits/e9273febf8ae7a627da13d77e07996d1b5050581

Fishwaldo commented 5 years ago

As implied by the namespace changes, Value Classes etc are internal implementation details and not intended to be used by applications directly.

I can see the value of those two methods though, and I will create a Public Method to get to them: https://github.com/OpenZWave/open-zwave/issues/1831

ekarak commented 5 years ago

resolving - fixed with #302