DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
tdemodules
src
utilities.cpp
Go to the documentation of this file.
1
#include "
utilities.hpp
"
2
#include <boost/endian/arithmetic.hpp>
3
4
namespace
dunedaq
{
5
namespace
tdemodules
{
6
7
// Append a 16-bit big-endian value to a buffer
8
void
9
append_big_uint16
(std::vector<uint8_t>& buffer, uint16_t value)
10
{
11
boost::endian::big_uint16_t be_val = value;
12
uint8_t temp[2];
13
std::memcpy(temp, &be_val,
sizeof
(be_val));
14
buffer.insert(buffer.end(), temp, temp +
sizeof
(be_val));
15
}
16
17
// Append a 32-bit big-endian value to a buffer
18
void
19
append_big_uint32
(std::vector<uint8_t>& buffer, uint32_t value)
20
{
21
boost::endian::big_uint32_t be_val = value;
22
uint8_t temp[4];
23
std::memcpy(temp, &be_val,
sizeof
(be_val));
24
buffer.insert(buffer.end(), temp, temp +
sizeof
(be_val));
25
}
26
27
}
28
}
// namespace dunedaq
dunedaq::tdemodules
Definition
AMCController.hpp:17
dunedaq::tdemodules::append_big_uint16
void append_big_uint16(std::vector< uint8_t > &buffer, uint16_t value)
Definition
utilities.cpp:9
dunedaq::tdemodules::append_big_uint32
void append_big_uint32(std::vector< uint8_t > &buffer, uint32_t value)
Definition
utilities.cpp:19
dunedaq
The DUNE-DAQ namespace.
Definition
cib_utilities.cpp:5
utilities.hpp
Generated on
for DUNE-DAQ by
1.18.0