diff --git a/include/nlohmann/std_unique_ptr_logical_link_control_packet.hpp b/include/nlohmann/std_unique_ptr_logical_link_control_packet.hpp index bf5fe40..62e69a3 100644 --- a/include/nlohmann/std_unique_ptr_logical_link_control_packet.hpp +++ b/include/nlohmann/std_unique_ptr_logical_link_control_packet.hpp @@ -63,20 +63,25 @@ template <> struct adl_serializer> { throw std::runtime_error("Cannot process packets different API version."); } - auto key = j["key"].template get(); + auto key = PacketType(std::stoi(j["key"].template get())); switch (key) { case PacketType::kLogicalLinkControlPacket: packet = std::make_unique(j["value"].template get()); + break; case PacketType::kMobileLinkEntityPacket: packet = std::make_unique(j["value"].template get()); + break; case PacketType::kCircuitModeControlEntityPacket: packet = std::make_unique( j["value"].template get()); + break; case PacketType::kMobileManagementPacket: packet = std::make_unique(j["value"].template get()); + break; case PacketType::kShortDataServicePacket: packet = std::make_unique(j["value"].template get()); + break; } } };