MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / GetSwitchPoint

Method GetSwitchPoint

cpp/src/Manager.cpp:3638–3667  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Gets switch point data from the schedule -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

3636// Gets switch point data from the schedule
3637//-----------------------------------------------------------------------------
3638bool Manager::GetSwitchPoint
3639(
3640 ValueID const& _id,
3641 uint8 const _idx,
3642 uint8* o_hours,
3643 uint8* o_minutes,
3644 int8* o_setback
3645)
3646{
3647 bool res = false;
3648
3649 if( ValueID::ValueType_Schedule == _id.GetType() )
3650 {
3651 if( Driver* driver = GetDriver( _id.GetHomeId() ) )
3652 {
3653 LockGuard LG(driver->m_nodeMutex);
3654 if( ValueSchedule* value = static_cast<ValueSchedule*>( driver->GetValue( _id ) ) )
3655 {
3656 res = value->GetSwitchPoint( _idx, o_hours, o_minutes, o_setback );
3657 value->Release();
3658 } else {
3659 OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "Invalid ValueID passed to GetSwitchPoint");
3660 }
3661 }
3662 } else {
3663 OZW_ERROR(OZWException::OZWEXCEPTION_CANNOT_CONVERT_VALUEID, "ValueID passed to GetSwitchPoint is not a Schedule Value");
3664 }
3665
3666 return res;
3667}
3668
3669//-----------------------------------------------------------------------------
3670// SwitchAll

Callers

nothing calls this directly

Calls 2

GetValueMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected