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

OpenLightingProject / ola / 8383043622

21 Mar 2024 11:25PM UTC coverage: 45.276% (+0.001%) from 45.275%
8383043622

push

github

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

E1.33 cherry pick the second

7682 of 17750 branches covered (43.28%)

32 of 91 new or added lines in 11 files covered. (35.16%)

2 existing lines in 1 file now uncovered.

21691 of 47908 relevant lines covered (45.28%)

63.75 hits per line

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

0.0
/tools/e133/DeviceManager.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
 * DeviceManager.cpp
17
 * Copyright (C) 2013 Simon Newton
18
 */
19

20
#include <memory>
21
#include <string>
22
#include <vector>
23

24
#include "ola/e133/DeviceManager.h"
25
#include "ola/io/SelectServer.h"
26
#include "ola/network/IPV4Address.h"
27
#include "tools/e133/DeviceManagerImpl.h"
28

29
namespace ola {
30
namespace e133 {
31

32
using ola::NewCallback;
33
using ola::network::IPV4Address;
34
using ola::network::IPV4SocketAddress;
35
using std::string;
36

37

38
/**
39
 * Construct a new DeviceManager
40
 * @param ss a pointer to a SelectServerInterface to use
41
 * @param cid the CID of this controller.
42
 */
43
DeviceManager::DeviceManager(ola::io::SelectServerInterface *ss,
×
44
                             ola::e133::MessageBuilder *message_builder)
×
45
    : m_impl(new DeviceManagerImpl(ss, message_builder)) {
×
46
}
×
47

48

49
/**
50
 * Clean up
51
 */
52
DeviceManager::~DeviceManager() {}
×
53

54

55
/**
56
 * Set the callback to be run when RDMNet data is received from a device.
57
 * @param callback the RDMMessageCallback to run when data is received.
58
 */
NEW
59
void DeviceManager::SetRDMMessageCallback(RDMMessageCallback *callback) {
×
60
  m_impl->SetRDMMessageCallback(callback);
×
61
}
×
62

63

64
/**
65
 * Set the callback to be run when we become the designated controller for a
66
 * device.
67
 */
68
void DeviceManager::SetAcquireDeviceCallback(AcquireDeviceCallback *callback) {
×
69
  m_impl->SetAcquireDeviceCallback(callback);
×
70
}
×
71

72

73
/*
74
 * Set the callback to be run when we lose the designated controller status for
75
 * a device.
76
 */
77
void DeviceManager::SetReleaseDeviceCallback(ReleaseDeviceCallback *callback) {
×
78
  m_impl->SetReleaseDeviceCallback(callback);
×
79
}
×
80

81

82
/**
83
 * Start maintaining a connection to this device.
84
 */
85
void DeviceManager::AddDevice(const IPV4Address &ip_address) {
×
86
  m_impl->AddDevice(ip_address);
×
87
}
×
88

89

90
/**
91
 * Remove a device, closing the connection if we have one.
92
 */
93
void DeviceManager::RemoveDevice(const IPV4Address &ip_address) {
×
94
  m_impl->RemoveDevice(ip_address);
×
95
}
×
96

97

98
/**
99
 * Remove a device if there is no open connection.
100
 */
101
void DeviceManager::RemoveDeviceIfNotConnected(const IPV4Address &ip_address) {
×
102
  m_impl->RemoveDeviceIfNotConnected(ip_address);
×
103
}
×
104

105

106
/**
107
 * Populate the vector with the devices that we are the designated controller
108
 * for.
109
 */
110
void DeviceManager::ListManagedDevices(vector<IPV4Address> *devices) const {
×
111
  m_impl->ListManagedDevices(devices);
×
112
}
×
113
}  // namespace e133
114
}  // 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

© 2025 Coveralls, Inc