• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OpenLightingProject / ola / 10576413709

27 Aug 2024 10:31AM UTC coverage: 45.677% (-0.01%) from 45.687%
10576413709

push

github

web-flow
Merge pull request #1960 from peternewman/e1.33-cherry-pick

E1.33 cherry pick vii

7787 of 17922 branches covered (43.45%)

10 of 42 new or added lines in 9 files covered. (23.81%)

4 existing lines in 2 files now uncovered.

22243 of 48696 relevant lines covered (45.68%)

54.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/tools/e133/E133Endpoint.cpp
1
/*
2
 * This program is free software; you can redistribute it and/or modify
3
 * it under the terms of the GNU General Public License as published by
4
 * the Free Software Foundation; either version 2 of the License, or
5
 * (at your option) any later version.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 * GNU Library General Public License for more details.
11
 *
12
 * You should have received a copy of the GNU General Public License
13
 * along with this program; if not, write to the Free Software
14
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15
 *
16
 * E133Endpoint.cpp
17
 * Copyright (C) 2012 Simon Newton
18
 */
19

20
#include <ola/Logging.h>
21
#include <ola/rdm/RDMControllerInterface.h>
22
#include <ola/rdm/UID.h>
23
#include <ola/rdm/UIDSet.h>
24
#include <memory>
25
#include <string>
26
#include <vector>
27
#include "tools/e133/E133Endpoint.h"
28

29
using ola::rdm::RDMCallback;
30
using ola::rdm::RDMDiscoveryCallback;
31
using ola::rdm::RDMRequest;
32
using std::auto_ptr;
33
using std::string;
34
using std::vector;
35

36
const uint16_t E133EndpointInterface::UNPATCHED_UNIVERSE = 0;
37
const uint16_t E133EndpointInterface::COMPOSITE_UNIVERSE = 0xffff;
38

39
typedef vector<string> RDMPackets;
40

41
E133Endpoint::E133Endpoint(DiscoverableRDMControllerInterface *controller,
×
42
                           const EndpointProperties &properties)
×
43
    : m_identify_mode(false),
×
44
      m_is_physical(properties.is_physical),
×
45
      m_universe(UNPATCHED_UNIVERSE),
×
46
      m_endpoint_label(""),
×
NEW
47
      m_responder_list_change(0),
×
48
      m_controller(controller) {
×
49
}
×
50

51

52
void E133Endpoint::set_identify_mode(bool identify_on) {
×
53
  m_identify_mode = identify_on;
×
54
  OLA_INFO << "IDENTIFY MODE " << (identify_on ? "ON" : "OFF");
×
55
}
×
56

57
/**
58
 * Run full discovery for this endpoint.
59
 */
60
void E133Endpoint::RunFullDiscovery(RDMDiscoveryCallback *callback) {
×
61
  if (m_controller) {
×
62
    m_controller->RunFullDiscovery(callback);
×
63
    return;
×
64
  }
65

66
  ola::rdm::UIDSet uid_set;
×
67
  callback->Run(uid_set);
×
68
}
×
69

70

71
/**
72
 * Run incremental discovery for this endpoint.
73
 */
74
void E133Endpoint::RunIncrementalDiscovery(RDMDiscoveryCallback *callback) {
×
75
  if (m_controller) {
×
76
    m_controller->RunIncrementalDiscovery(callback);
×
77
    return;
×
78
  }
79

80
  ola::rdm::UIDSet uid_set;
×
81
  callback->Run(uid_set);
×
82
}
×
83

84

85
/**
86
 * Handle RDM requests to this endpoint
87
 */
88
void E133Endpoint::SendRDMRequest(RDMRequest *request_ptr,
×
89
                                  RDMCallback *on_complete) {
90
  if (m_controller) {
×
91
    m_controller->SendRDMRequest(request_ptr, on_complete);
×
92
    return;
×
93
  } else {
94
    auto_ptr<const RDMRequest> request(request_ptr);
×
95
    OLA_WARN << "Endpoint " << m_endpoint_label
×
96
             << " has no controller attached";
×
97
    ola::rdm::RunRDMCallback(on_complete, ola::rdm::RDM_UNKNOWN_UID);
×
98
  }
×
99
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc