Files
cariflex/tools/EVerest-main/lib/everest/framework/everestjs/conversions.hpp
Eric F d398a6ced2 Add extracted tools: CitrineOS, OpenOCPP, ShapeShifter
- CitrineOS core extracted (CSMS OCPP 2.0.1)
- OpenOCPP extracted (firmware OCPP 1.6J/2.0.1)
- ShapeShifter library installed (pip install -e)
- ShapeShifter specification extracted
- EVerest extracted

TODO updated with progress
2026-06-08 00:38:27 -04:00

51 lines
1.7 KiB
C++

// SPDX-License-Identifier: Apache-2.0
// Copyright 2020 - 2021 Pionix GmbH and Contributors to EVerest
#ifndef CONVERSIONS_HPP
#define CONVERSIONS_HPP
#include <framework/everest.hpp>
#include <napi.h>
#include <utils/conversions.hpp>
#include <utils/types.hpp>
#include <utils/error.hpp>
#include <utils/error/error_state_monitor.hpp>
namespace EverestJs {
static const char* const napi_valuetype_strings[] = {
"undefined", //
"null", //
"boolean", //
"number", //
"string", //
"symbol", //
"object", //
"function", //
"external", //
"bigint", //
};
Everest::json convertToJson(const Napi::Value& value);
Everest::json convertToConfigMap(const Everest::json& json_config);
Everest::TelemetryMap convertToTelemetryMap(const Napi::Object& obj);
Napi::Value convertToNapiValue(const Napi::Env& env, const Everest::json& value);
// Error related
Everest::error::Error convertToError(const Napi::Value& value);
Everest::error::ErrorType convertToErrorType(const Napi::Value& value);
Everest::error::ErrorSubType convertToErrorSubType(const Napi::Value& value);
Everest::error::Severity convertToErrorSeverity(const Napi::Value& value);
Everest::error::State convertToErrorState(const Napi::Value& value);
Napi::Value convertToNapiValue(const Napi::Env& env, const Everest::error::Error& error);
// ErrorStateCondition related
bool isSingleErrorStateCondition(const Napi::Value& value);
Everest::error::ErrorStateMonitor::StateCondition convertToErrorStateCondition(const Napi::Value& value);
std::list<Everest::error::ErrorStateMonitor::StateCondition> convertToErrorStateConditionList(const Napi::Value& value);
} // namespace EverestJs
#endif // CONVERSIONS_HPP