MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / packU16BE

Function packU16BE

app/src/IO/Checksum.cpp:251–256  ·  view source on GitHub ↗

* @brief Packs a 16-bit unsigned integer into a big-endian QByteArray. */

Source from the content-addressed store, hash-verified

249 * @brief Packs a 16-bit unsigned integer into a big-endian QByteArray.
250 */
251static QByteArray packU16BE(uint16_t v)
252{
253 uint8_t out[2];
254 big_endian_memcpy(out, &v, sizeof(v));
255 return QByteArray(reinterpret_cast<char*>(out), sizeof(out));
256}
257
258/**
259 * @brief Packs a 16-bit unsigned integer into a little-endian QByteArray.

Callers 1

Checksum.cppFile · 0.85

Calls 1

big_endian_memcpyFunction · 0.85

Tested by

no test coverage detected