Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing conversion to uint64_t #762

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.14)

project(ocpp
VERSION 0.16.1
VERSION 0.16.2
DESCRIPTION "A C++ implementation of the Open Charge Point Protocol"
LANGUAGES CXX
)
Expand Down
5 changes: 4 additions & 1 deletion include/ocpp/v201/device_model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ template <typename T> struct RequestDeviceModelResponse {
template <typename T> T to_specific_type(const std::string& value) {
static_assert(std::is_same<T, std::string>::value || std::is_same<T, int>::value ||
std::is_same<T, double>::value || std::is_same<T, size_t>::value ||
std::is_same<T, DateTime>::value || std::is_same<T, bool>::value,
std::is_same<T, DateTime>::value || std::is_same<T, bool>::value ||
std::is_same<T, uint64_t>::value,
"Requested unknown datatype");

if constexpr (std::is_same<T, std::string>::value) {
Expand All @@ -43,6 +44,8 @@ template <typename T> T to_specific_type(const std::string& value) {
return DateTime(value);
} else if constexpr (std::is_same<T, bool>::value) {
return ocpp::conversions::string_to_bool(value);
} else if constexpr (std::is_same<T, uint64_t>::value) {
return std::stoull(value);
}
}

Expand Down
Loading