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

OpenLightingProject / ola / 16911433572

12 Aug 2025 02:08PM UTC coverage: 45.869% (-0.04%) from 45.909%
16911433572

Pull #1739

github

web-flow
Merge 02faeaa2d into 3566c28d9
Pull Request #1739: New web UI, store highest channel number used

7157 of 16316 branches covered (43.86%)

20915 of 45597 relevant lines covered (45.87%)

52.03 hits per line

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

0.0
/plugins/usbdmx/DMXCProjectsNodleU1Factory.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
 * DMXCProjectsNodleU1Factory.cpp
17
 * The WidgetFactory for Nodle widgets.
18
 * Copyright (C) 2015 Stefan Krupop
19
 */
20

21
#include "plugins/usbdmx/DMXCProjectsNodleU1Factory.h"
22

23
#include "ola/Logging.h"
24
#include "ola/base/Flags.h"
25
#include "plugins/usbdmx/DMXCProjectsNodleU1.h"
26

27
DECLARE_bool(use_async_libusb);
28

29
namespace ola {
30
namespace plugin {
31
namespace usbdmx {
32

33
const uint16_t DMXCProjectsNodleU1Factory::VENDOR_ID = 0x16d0;
34
const uint16_t DMXCProjectsNodleU1Factory::PRODUCT_ID = 0x0830;
35

36
bool DMXCProjectsNodleU1Factory::DeviceAdded(
×
37
    WidgetObserver *observer,
38
    libusb_device *usb_device,
39
    const struct libusb_device_descriptor &descriptor) {
40
  if (descriptor.idVendor != VENDOR_ID || descriptor.idProduct != PRODUCT_ID) {
×
41
    return false;
42
  }
43

44
  OLA_INFO << "Found a new Nodle U1 device";
×
45
  ola::usb::LibUsbAdaptor::DeviceInformation info;
×
46
  if (!m_adaptor->GetDeviceInfo(usb_device, descriptor, &info)) {
×
47
    return false;
48
  }
49

50
  OLA_INFO << "Nodle U1 serial: " << info.serial;
×
51

52
  if (m_preferences->SetDefaultValue(
×
53
      "nodle-" + info.serial + "-mode",
×
54
      UIntValidator(DMXCProjectsNodleU1::NODLE_MIN_MODE,
×
55
                    DMXCProjectsNodleU1::NODLE_MAX_MODE),
×
56
      DMXCProjectsNodleU1::NODLE_DEFAULT_MODE)) {
57
    m_preferences->Save();
×
58
  }
59

60
  unsigned int mode;
×
61
  if (!StringToInt(m_preferences->GetValue("nodle-" + info.serial + "-mode"),
×
62
                   &mode)) {
63
    mode = DMXCProjectsNodleU1::NODLE_DEFAULT_MODE;
×
64
  }
65

66
  OLA_INFO << "Setting Nodle U1 mode to " << mode;
×
67

68
  DMXCProjectsNodleU1 *widget = NULL;
×
69
  if (FLAGS_use_async_libusb) {
×
70
    widget = new AsynchronousDMXCProjectsNodleU1(m_adaptor, usb_device,
×
71
                                                 m_plugin_adaptor, info.serial,
×
72
                                                 mode);
×
73
  } else {
74
    widget = new SynchronousDMXCProjectsNodleU1(m_adaptor, usb_device,
×
75
                                                m_plugin_adaptor, info.serial,
×
76
                                                mode);
×
77
  }
78
  return AddWidget(observer, widget);
×
79
}
×
80
}  // namespace usbdmx
81
}  // namespace plugin
82
}  // namespace ola
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