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

Method ClearSwitchPoints

cpp/src/Manager.cpp:3611–3632  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Clears all switch points from the schedule -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

3609// Clears all switch points from the schedule
3610//-----------------------------------------------------------------------------
3611void Manager::ClearSwitchPoints
3612(
3613 ValueID const& _id
3614)
3615{
3616 if( ValueID::ValueType_Schedule == _id.GetType() )
3617 {
3618 if( Driver* driver = GetDriver( _id.GetHomeId() ) )
3619 {
3620 LockGuard LG(driver->m_nodeMutex);
3621 if( ValueSchedule* value = static_cast<ValueSchedule*>( driver->GetValue( _id ) ) )
3622 {
3623 value->ClearSwitchPoints();
3624 value->Release();
3625 } else {
3626 OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "Invalid ValueID passed to ClearSwitchPoints");
3627 }
3628 }
3629 } else {
3630 OZW_ERROR(OZWException::OZWEXCEPTION_CANNOT_CONVERT_VALUEID, "ValueID passed to ClearSwitchPoints is not a Schedule Value");
3631 }
3632}
3633
3634//-----------------------------------------------------------------------------
3635// <Manager::GetSwitchPoint>

Callers

nothing calls this directly

Calls 2

GetValueMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected