open-zwave icon indicating copy to clipboard operation
open-zwave copied to clipboard

Add GetValueEndPoint() to Manager

Open petergebruers opened this issue 5 years ago • 2 comments

Introduces helper function:

uint8 Manager::GetValueEndPoint(ValueID const &_id)

The purpose is

  • To allow printing of "End Point" for diagnosis. End Point is what is used in conversation with a device, not "Instance".
  • To allow selection of Values with certain End Point for use in "Multi Channel Association". This class does not accept "Instance".

Adds tests to cpp/test/Manager_test.cpp - verifies a (fake) mapping and tests exception thrown.

Adds "TestHelper" as a friend to allow testing of existing OZW classes without refactoring and without having to start a "real" Manager and Driver (which would have its merits but would be to involved and heavy)

If this PR gets accepted, I will update ozwcp to display the "endpoint".

The "TestHelper" can (will) be re-used to test a recent commit, 79663e1e by gizmocuz, "Making GetValue code more consistent, Releasing values", mainly as a proof-of-concept on how to test things.

I am not totally new to testing, but I am new to using "google test" and testing of C++ code so please give an honest opinion 🙂

petergebruers avatar Nov 25 '19 20:11 petergebruers

Thanks. Will review soon.

Fishwaldo avatar Nov 29 '19 05:11 Fishwaldo

Wasn't aware that Github would close my PR if I removed the branch. Was doing some spring cleaning 🙂...

petergebruers avatar Mar 06 '20 08:03 petergebruers