Skip to content
Open
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
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ WarningsAsErrors: 'misc-const-correctness,modernize-use-default-member-init,cppc
# do not match smp.hpp
# all other headers are *.h
HeaderFilterRegex: '.*\.h$'
AnalyzeTemporaryDtors: false
FormatStyle: file
CheckOptions:
hicpp-move-const-arg.CheckMoveToConstRef: 'true'
Expand Down
2 changes: 1 addition & 1 deletion ci/build_for_pc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ ninja
cd ..
mkdir build_clang
cd build_clang
CC=clang-20 CXX=clang++-20 cmake ../native -G Ninja -D CMAKE_CXX_FLAGS=-DASIO_STANDALONE
CC=clang-21 CXX=clang++-21 cmake ../native -G Ninja -D CMAKE_CXX_FLAGS=-DASIO_STANDALONE
ninja
cd ..
2 changes: 1 addition & 1 deletion ci/check_codestyle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

set -eo pipefail

ci/run-clang-format.py --clang-format-executable clang-format-20 -r main/ components/ native/
ci/run-clang-format.py --clang-format-executable clang-format-21 -r main/ components/ native/
4 changes: 2 additions & 2 deletions ci/static_code_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ set -eo pipefail

mkdir build_clang
cd build_clang
CC=clang-20 CXX=clang++-20 cmake ../native -G Ninja -D CMAKE_CXX_FLAGS=-DASIO_STANDALONE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
CC=clang-21 CXX=clang++-21 cmake ../native -G Ninja -D CMAKE_CXX_FLAGS=-DASIO_STANDALONE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

run-clang-tidy-20.py -clang-tidy-binary clang-tidy-20
run-clang-tidy-21.py -clang-tidy-binary clang-tidy-21
23 changes: 13 additions & 10 deletions components/sip_client/include/sip_client/mbedtls_md5.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@

#pragma once

#include "mbedtls/md5.h"
#include "psa/crypto.h"

class MbedtlsMd5
{
public:
MbedtlsMd5()
{
mbedtls_md5_init(&m_ctx);
}
MbedtlsMd5() = default;

~MbedtlsMd5()
{
mbedtls_md5_free(&m_ctx);
psa_status_t status = psa_hash_abort(&operation);
assert(status == PSA_SUCCESS);
}

MbedtlsMd5(const MbedtlsMd5&) = delete;
Expand All @@ -38,19 +36,24 @@ class MbedtlsMd5

void start()
{
mbedtls_md5_starts(&m_ctx);
psa_status_t status = psa_hash_setup(&operation, PSA_ALG_MD5);
assert(status == PSA_SUCCESS);
}

void update(const std::string& input)
{
mbedtls_md5_update(&m_ctx, reinterpret_cast<const unsigned char*>(input.c_str()), input.size());
psa_status_t status = psa_hash_update(&operation, reinterpret_cast<const unsigned char*>(input.c_str()), input.size());
assert(status == PSA_SUCCESS);
}

void finish(std::array<unsigned char, 16>& hash)
{
mbedtls_md5_finish(&m_ctx, hash.data());
size_t hash_len;
psa_status_t status = psa_hash_finish(&operation, hash.data(), hash.size(), &hash_len);
assert(status == PSA_SUCCESS);
assert(hash_len == hash.size());
}

private:
mbedtls_md5_context m_ctx {};
psa_hash_operation_t operation = PSA_HASH_OPERATION_INIT;
};
2 changes: 1 addition & 1 deletion components/web_server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
idf_component_register(INCLUDE_DIRS "include"
REQUIRES esp_http_server json app_update
REQUIRES esp_http_server app_update
PRIV_REQUIRES sip_client
EMBED_FILES index.html
)
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM espressif/idf:release-v5.5
FROM espressif/idf:release-v6.0

ARG DEBIAN_FRONTEND=noninteractive

Expand Down
8 changes: 4 additions & 4 deletions docker/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ apt-get update \

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -

echo deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-20 main > /etc/apt/sources.list.d/llvm.list
echo deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-21 main > /etc/apt/sources.list.d/llvm.list

wget https://github.com/chriskohlhoff/asio/archive/asio-1-32-0.tar.gz -O /tmp/asio-1-32-0.tar.gz

tar -C /usr/include --strip-components=3 -x -f /tmp/asio-1-32-0.tar.gz asio-asio-1-32-0/asio/include/

apt-get update \
&& apt-get install -y clang-20 \
clang-format-20 \
clang-tidy-20 \
&& apt-get install -y clang-21 \
clang-format-21 \
clang-tidy-21 \
&& rm -rf /var/lib/apt/lists/*
5 changes: 2 additions & 3 deletions main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
idf_component_register(SRCS ./main.cpp
REQUIRES driver esp_netif esp_wifi mbedtls
nvs_flash sip_client web_server)

nvs_flash sip_client web_server
#INCLUDE_DIRS include # Edit following two lines to set component requirements (see docs)
# REQUIRES )
# PRIV_REQUIRES )
PRIV_REQUIRES esp_driver_gpio)

target_compile_options(${COMPONENT_LIB} PRIVATE -std=gnu++17)
5 changes: 3 additions & 2 deletions main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## IDF Component Manager Manifest File
dependencies:
espressif/mdns: "^1.9.1"
espressif/mdns: ^1.9.1
## Required IDF version
idf:
version: ">=5.5.2"
version: '>=6.0'
# # Put list of dependencies here
# # For components maintained by Espressif:
# component: "~1.0.0"
Expand All @@ -15,3 +15,4 @@ dependencies:
# # `public` flag doesn't have an effect dependencies of the `main` component.
# # All dependencies of `main` are public by default.
# public: true
espressif/cjson: ^1.7.19~1
Loading