Files
2026-11-23 03:28:32 +02:00

19 lines
570 B
C++

#pragma once
#include <array>
#include <cstdint>
#include <span>
#include <stdexcept>
namespace gateway {
// Tortoise SMSG_SET_PROFICIENCY 0x127 is class:u8, mask:u32le.
// Forever SMSG_SET_PROFICIENCY 0x4501DF writes mask:u32le, class:u8.
inline std::array<uint8_t, 5> forever_set_proficiency(std::span<const uint8_t> source) {
if (source.size() != 5 || (source[0] != 2 && source[0] != 4))
throw std::invalid_argument("unsupported Source proficiency packet");
return {source[1], source[2], source[3], source[4], source[0]};
}
} // namespace gateway