mirror of
https://github.com/esphome/esphome.git
synced 2026-06-01 17:57:37 +08:00
[dsmr] Small refactoring: Move Aes128GcmDecryptorImpl type inside esphome::dsmr namespace. (#15940)
This commit is contained in:
@@ -18,22 +18,27 @@
|
|||||||
|
|
||||||
#if __has_include(<psa/crypto.h>)
|
#if __has_include(<psa/crypto.h>)
|
||||||
#include <dsmr_parser/decryption/aes128gcm_tfpsa.h>
|
#include <dsmr_parser/decryption/aes128gcm_tfpsa.h>
|
||||||
using Aes128GcmDecryptorImpl = dsmr_parser::Aes128GcmTfPsa;
|
|
||||||
#elif __has_include(<mbedtls/gcm.h>)
|
#elif __has_include(<mbedtls/gcm.h>)
|
||||||
#if __has_include(<mbedtls/esp_config.h>)
|
#if __has_include(<mbedtls/esp_config.h>)
|
||||||
#include <mbedtls/esp_config.h>
|
#include <mbedtls/esp_config.h>
|
||||||
#endif
|
#endif
|
||||||
#include <dsmr_parser/decryption/aes128gcm_mbedtls.h>
|
#include <dsmr_parser/decryption/aes128gcm_mbedtls.h>
|
||||||
using Aes128GcmDecryptorImpl = dsmr_parser::Aes128GcmMbedTls;
|
|
||||||
#elif __has_include(<bearssl/bearssl.h>)
|
#elif __has_include(<bearssl/bearssl.h>)
|
||||||
#include <dsmr_parser/decryption/aes128gcm_bearssl.h>
|
#include <dsmr_parser/decryption/aes128gcm_bearssl.h>
|
||||||
using Aes128GcmDecryptorImpl = dsmr_parser::Aes128GcmBearSsl;
|
|
||||||
#else
|
#else
|
||||||
#error "The platform doesn't provide a compatible encryption library for dsmr_parser"
|
#error "The platform doesn't provide a compatible encryption library for dsmr_parser"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace esphome::dsmr {
|
namespace esphome::dsmr {
|
||||||
|
|
||||||
|
#if __has_include(<psa/crypto.h>)
|
||||||
|
using Aes128GcmDecryptorImpl = dsmr_parser::Aes128GcmTfPsa;
|
||||||
|
#elif __has_include(<mbedtls/gcm.h>)
|
||||||
|
using Aes128GcmDecryptorImpl = dsmr_parser::Aes128GcmMbedTls;
|
||||||
|
#else
|
||||||
|
using Aes128GcmDecryptorImpl = dsmr_parser::Aes128GcmBearSsl;
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace dsmr_parser::fields;
|
using namespace dsmr_parser::fields;
|
||||||
|
|
||||||
#ifndef DSMR_SENSOR_LIST
|
#ifndef DSMR_SENSOR_LIST
|
||||||
|
|||||||
Reference in New Issue
Block a user