• 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

88.24
/libs/acn/LLRPProbeRequestPDU.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
 * LLRPProbeRequestPDU.cpp
17
 * The LLRPProbeRequestPDU
18
 * Copyright (C) 2020 Peter Newman
19
 */
20

21
#include "libs/acn/LLRPProbeRequestPDU.h"
22

23
#include <ola/network/NetworkUtils.h>
24
#include <ola/rdm/UID.h>
25
#include <ola/rdm/UIDSet.h>
26

27
namespace ola {
28
namespace acn {
29

30
using ola::io::OutputStream;
31
using ola::network::HostToNetwork;
32
using ola::rdm::UID;
33
using std::vector;
34

35
void LLRPProbeRequestPDU::PrependPDU(ola::io::IOStack *stack,
1✔
36
                                     const UID &lower_uid,
37
                                     const UID &upper_uid,
38
                                     bool client_tcp_connection_inactive,
39
                                     bool brokers_only,
40
                                     const ola::rdm::UIDSet &known_uids) {
41
  llrp_probe_request_pdu_data data;
1✔
42
  lower_uid.Pack(data.lower_uid, sizeof(data.lower_uid));
1✔
43
  upper_uid.Pack(data.upper_uid, sizeof(data.upper_uid));
1✔
44
  uint16_t filter = 0;
1✔
45
  if (client_tcp_connection_inactive) {
1✔
NEW
46
    filter |= FILTER_CLIENT_TCP_CONNECTION_INACTIVE;
×
47
  }
48
  if (brokers_only) {
1✔
NEW
49
    filter |= FILTER_BROKERS_ONLY;
×
50
  }
51
  data.filter = HostToNetwork(filter);
1✔
52
  known_uids.Pack(data.known_uids, sizeof(data.known_uids));
1✔
53
  stack->Write(reinterpret_cast<uint8_t*>(&data),
1✔
54
               static_cast<unsigned int>(sizeof(llrp_probe_request_pdu_data) -
55
                                         sizeof(data.known_uids) +
56
                                         (known_uids.Size() * UID::LENGTH)));
1✔
57
  uint8_t vector = HostToNetwork(VECTOR_PROBE_REQUEST_DATA);
1✔
58
  stack->Write(reinterpret_cast<uint8_t*>(&vector), sizeof(vector));
1✔
59
  PrependFlagsAndLength(stack, VFLAG_MASK | HFLAG_MASK | DFLAG_MASK, true);
1✔
60
}
1✔
61
}  // namespace acn
62
}  // 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