Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerOn non-functional in OZWForm sample app #16

Open
rscott78 opened this issue Jun 28, 2017 · 2 comments
Open

PowerOn non-functional in OZWForm sample app #16

rscott78 opened this issue Jun 28, 2017 · 2 comments

Comments

@rscott78
Copy link

rscott78 commented Jun 28, 2017

I'm trying to use the sample app to evaluate this library for a project of mine. I'm finding that the app won't power on/off my devices.

I've tracked it down to this function:

Manager.cpp


	if( ValueID::ValueType_Int == _id.GetType() )
	{
		if( Driver* driver = GetDriver( _id.GetHomeId() ) )
		{
			if( _id.GetNodeId() != driver->GetControllerNodeId() )
			{
				LockGuard LG(driver->m_nodeMutex);
				if( ValueInt* value = static_cast<ValueInt*>( driver->GetValue( _id ) ) )
				{
					res = value->Set( _value );
					value->Release();
				} else {
					OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "Invalid ValueID passed to SetValue");
				}
			}
		}
	} else {
		OZW_ERROR(OZWException::OZWEXCEPTION_CANNOT_CONVERT_VALUEID, "ValueID passed to SetValue is not a Int Value");
	}

First, when the SetValue is called m_manager.SetValue(new ZWValueId(m_homeId, m_rightClickNode, ZWValueGenre.Basic, 0x20, 0x01, 0x00, ZWValueType.Byte, 0x00), 0xFF); it fails on the first if statement in the above method because the value is passed as a Byte.

When I bypass that first if statement, it fails on the if statement that says if( ValueInt* value = static_cast<ValueInt*>( driver->GetValue( _id ) ) ) (invalid value id passed).

Is this a configuration problem with my devices?

@dotMorten
Copy link
Member

dotMorten commented Jun 28, 2017

Do I read this right that the value type is an int, but you send a byte? The types must match.

How are you calling the API that gets you in here?

@rscott78
Copy link
Author

rscott78 commented Jun 28, 2017

Sure... but that's what's in the sample code provided with the project (i.e, if you ran the sample OZWForm project you'd run into the same problem). Even when I change it to a byte, it still fails on the following IF statement.

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

No branches or pull requests

2 participants