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

Method ClearEventParams

cpp/src/command_classes/Alarm.cpp:588–637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586}
587
588void Alarm::ClearEventParams
589(
590 uint32 const _instance
591)
592{
593 /* Reset Any of the Params that may have been previously set with another event */
594 for (std::vector<uint32>::iterator it = m_ParamsSet.begin(); it != m_ParamsSet.end(); it++)
595 {
596
597 Value *value = GetValue(_instance, (*it));
598
599 switch (value->GetID().GetType()) {
600 case ValueID::ValueType_Byte: {
601 if (ValueByte *value = static_cast<ValueByte *>(GetValue(_instance, (*it))))
602 {
603 value->OnValueRefreshed(0);
604 value->Release();
605 }
606 }
607 break;
608 case ValueID::ValueType_String: {
609 if (ValueString *value = static_cast<ValueString *>(GetValue(_instance, (*it))))
610 {
611 value->OnValueRefreshed("");
612 value->Release();
613 }
614 }
615 break;
616 case ValueID::ValueType_List: {
617 if (ValueList *value = static_cast<ValueList *>(GetValue(_instance, (*it))))
618 {
619 /* XXX TODO: Need to specify that the default is. Not all Lists have 0 index */
620 value->OnValueRefreshed(0);
621 value->Release();
622 }
623 }
624 break;
625 case ValueID::ValueType_Int: {
626 if (ValueInt *value = static_cast<ValueInt *>(GetValue(_instance, (*it))))
627 {
628 value->OnValueRefreshed(0);
629 value->Release();
630 }
631 }
632 break;
633 default:
634 Log::Write(LogLevel_Warning, GetNodeId(), "TODO: Clear Events for ValueType %d", value->GetID().GetType());
635 }
636 }
637}
638
639void Alarm::ClearAlarm(uint32 type) {
640 uint32 _instance;

Callers

nothing calls this directly

Calls 6

WriteFunction · 0.85
GetNodeIdFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
OnValueRefreshedMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected