| 524 | return false; |
| 525 | } |
| 526 | void Alarm::SetupEvents |
| 527 | ( |
| 528 | uint32 type, |
| 529 | uint32 index, |
| 530 | vector<ValueList::Item> *_items, |
| 531 | uint32 const _instance |
| 532 | ) |
| 533 | { |
| 534 | if (const NotificationCCTypes::NotificationEvents *ne = NotificationCCTypes::Get()->GetAlarmNotificationEvents(type, index)) { |
| 535 | Log::Write( LogLevel_Info, GetNodeId(), "\tEvent Type %d: %s ", ne->id, ne->name.c_str()); |
| 536 | ValueList::Item item; |
| 537 | item.m_value = ne->id; |
| 538 | item.m_label = ne->name; |
| 539 | _items->push_back( item ); |
| 540 | /* If there are Params - Lets create the correct types now */ |
| 541 | if ( Node* node = GetNodeUnsafe() ) { |
| 542 | for (std::map<uint32, NotificationCCTypes::NotificationEventParams* >::const_iterator it = ne->EventParams.begin(); it != ne->EventParams.end(); it++ ) { |
| 543 | switch (it->second->type) { |
| 544 | case NotificationCCTypes::NEPT_Location: { |
| 545 | node->CreateValueString( ValueID::ValueGenre_User, GetCommandClassId(), _instance, it->first, it->second->name, "", true, false, "", 0); |
| 546 | break; |
| 547 | } |
| 548 | case NotificationCCTypes::NEPT_List: { |
| 549 | vector<ValueList::Item> _Paramitems; |
| 550 | for (std::map<uint32, string>::iterator it2 = it->second->ListItems.begin(); it2 != it->second->ListItems.end(); it2++) { |
| 551 | ValueList::Item Paramitem; |
| 552 | Paramitem.m_value = ne->id; |
| 553 | Paramitem.m_label = ne->name; |
| 554 | _Paramitems.push_back( Paramitem ); |
| 555 | } |
| 556 | node->CreateValueList( ValueID::ValueGenre_User, GetCommandClassId(), _instance, it->first, it->second->name, "", true, false, (uint8_t)(_Paramitems.size() & 0xFF), _Paramitems, 0, 0 ); |
| 557 | break; |
| 558 | } |
| 559 | case NotificationCCTypes::NEPT_UserCodeReport: { |
| 560 | node->CreateValueByte( ValueID::ValueGenre_User, GetCommandClassId(), _instance, it->first, it->second->name, "", true, false, 0, 0); |
| 561 | node->CreateValueString(ValueID::ValueGenre_User, GetCommandClassId(), _instance, it->first+1, it->second->name, "", true, false, "", 0); |
| 562 | break; |
| 563 | } |
| 564 | case NotificationCCTypes::NEPT_Byte: { |
| 565 | node->CreateValueByte( ValueID::ValueGenre_User, GetCommandClassId(), _instance, it->first, it->second->name, "", true, false, 0, 0); |
| 566 | break; |
| 567 | } |
| 568 | case NotificationCCTypes::NEPT_String: { |
| 569 | node->CreateValueString( ValueID::ValueGenre_User, GetCommandClassId(), _instance, it->first, it->second->name, "", true, false, "", 0); |
| 570 | break; |
| 571 | } |
| 572 | case NotificationCCTypes::NEPT_Time: { |
| 573 | node->CreateValueInt( ValueID::ValueGenre_User, GetCommandClassId(), _instance, it->first, it->second->name, "", true, false, 0, 0); |
| 574 | break; |
| 575 | } |
| 576 | } |
| 577 | } |
| 578 | } |
| 579 | } else { |
| 580 | Log::Write (LogLevel_Info, GetNodeId(), "\tEvent Type %d: Unknown", index); |
| 581 | ValueList::Item item; |
| 582 | item.m_value = index; |
| 583 | item.m_label = string("Unknown"); |
nothing calls this directly
no test coverage detected