Skip to content
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
70 changes: 70 additions & 0 deletions .github/workflows/ci-cd-esp32.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CMake

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

#Allows you to start workflow manually from the actions tab in the interface github.com
workflow_dispatch:

jobs:
#ESP32 Build
build-esp-idf-component:
name: ESP-IDF ${{ matrix.idf_ver }} for ${{ matrix.idf_target }} ${{ matrix.compile_example }}
runs-on: ubuntu-latest
strategy:
matrix:
# The version names here correspond to the versions of espressif/idf Docker image.
# See https://hub.docker.com/r/espressif/idf/tags and
# https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html
# for details.
idf_ver: ["release-v5.5"]
idf_target: ["esp32"]
compile_example: ["cloud"]
platforms:
- {
name: "Optimized",
user_config: "./config/user_config_optimized.h",
}

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Build Application
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: ${{ matrix.idf_ver }}
target: ${{ matrix.idf_target }}
path: "projects/xtensa_lx6/vscode/aether-client-cpp"
command: idf.py
build
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DCOMPILE_EXAMPLE=${{ matrix.compile_example }}
-DUSER_CONFIG=../../../../../${{ matrix.platforms.user_config }}

- name: Rename artifact
run: |
ls -lah
cp projects/xtensa_lx6/vscode/aether-client-cpp/build/bootloader/bootloader.bin bootloader-${{ matrix.idf_ver }}.bin
cp projects/xtensa_lx6/vscode/aether-client-cpp/build/partition_table/partition-table.bin partition-table-${{ matrix.idf_ver }}.bin
cp projects/xtensa_lx6/vscode/aether-client-cpp/build/Aether.bin Aether-${{ matrix.compile_example }}-${{ matrix.idf_ver }}.bin

- name: Upload
uses: actions/upload-artifact@v4
with:
name: Aether_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.compile_example }}
path: "*-${{ matrix.compile_example }}-${{ matrix.idf_ver }}.bin"

release:
needs: build-esp-idf-component
runs-on: ubuntu-latest
steps:
- name: Download Firmware Files
uses: actions/download-artifact@v4
with:
path: build
58 changes: 5 additions & 53 deletions .github/workflows/ci-cd-multi-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
cmake -B build
-G "${{ matrix.config.generator }}"
-A "${{ matrix.config.arch }}"
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }}
-DCMAKE_C_COMPILER=${{ matrix.config.cc }}
-DCMAKE_BUILD_TYPE=Release
Expand All @@ -119,67 +120,18 @@ jobs:
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build build --config Release --parallel

- name: Upload
uses: actions/upload-artifact@v4
with:
name: Aether_${{ matrix.config.name }}_${{ matrix.platforms.name }}
path: "build/*"
include-hidden-files: true
overwrite: true

- name: Test
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --test-dir build --build-config Release --output-on-failure

#ESP32 Build
build-esp-idf-component:
name: ESP-IDF ${{ matrix.idf_ver }} for ${{ matrix.idf_target }} ${{ matrix.compile_example }}
runs-on: ubuntu-latest
strategy:
matrix:
# The version names here correspond to the versions of espressif/idf Docker image.
# See https://hub.docker.com/r/espressif/idf/tags and
# https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html
# for details.
idf_ver: ["release-v5.5"]
idf_target: ["esp32"]
compile_example: ["cloud"]
platforms:
- {
name: "Optimized",
user_config: "./config/user_config_optimized.h",
}

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Build Application
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: ${{ matrix.idf_ver }}
target: ${{ matrix.idf_target }}
path: "projects/xtensa_lx6/vscode/aether-client-cpp"
command: idf.py build
-DCOMPILE_EXAMPLE=${{ matrix.compile_example }}
-DUSER_CONFIG=../../../../../${{ matrix.platforms.user_config }}
-DAE_DISTILLATION=Off

- name: Rename artifact
run: |
ls -lah
cp projects/xtensa_lx6/vscode/aether-client-cpp/build/bootloader/bootloader.bin bootloader-${{ matrix.idf_ver }}.bin
cp projects/xtensa_lx6/vscode/aether-client-cpp/build/partition_table/partition-table.bin partition-table-${{ matrix.idf_ver }}.bin
cp projects/xtensa_lx6/vscode/aether-client-cpp/build/Aether.bin Aether-${{ matrix.compile_example }}-${{ matrix.idf_ver }}.bin

- name: Upload
uses: actions/upload-artifact@v4
with:
name: Aether_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.compile_example }}
path: "*-${{ matrix.compile_example }}-${{ matrix.idf_ver }}.bin"
name: Aether_${{ matrix.config.name }}_${{ matrix.platforms.name }}
path: "build/*"
include-hidden-files: true
overwrite: true

release:
needs: build
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/ci-cppcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: cppcheck

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

#Allows you to start workflow manually from the actions tab in the interface github.com
workflow_dispatch:

jobs:
cppcheck:
runs-on: ubuntu-latest
steps:
- name: configure system
run: |
sudo apt-get update
sudo apt-get install -y make ninja-build

- uses: actions/checkout@v4
with:
submodules: recursive

- name: cache cppcheck
id: cache-cppcheck
uses: actions/cache@v4
with:
path: _cppcheck
key: ${{ runner.os }}-cppcheck-2.19.0
restore-keys: ${{ runner.os }}-cppcheck-2.19.0

- if: ${{ steps.cache-cppcheck.outputs.cache-hit != 'true' }}
name: download and build cppcheck
run: |
mkdir -p _cppcheck
wget -O _cppcheck/cppcheck.tar.gz https://github.com/danmar/cppcheck/archive/refs/tags/2.19.0.tar.gz
cd _cppcheck
tar -xzf cppcheck.tar.gz
cd cppcheck-2.19.0
make -j
pwd
ls ./cppcheck
./cppcheck --version
cd ../..
_cppcheck/cppcheck-2.19.0/cppcheck --version

# we need configure cmake to get the compile_commands.json file
- name: cmake configure
run: >
cmake -B build
-G Ninja
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DCMAKE_BUILD_TYPE=Release
-C ".github/workflows/linux_initial_cache.txt"
-S projects/cmake

- name: cache cppcheck_build_dir
id: cache-cppcheck_build_dir
uses: actions/cache@v4
with:
path: _cppcheck_build_dir
key: ${{ runner.os }}-cppcheck_build_dir
restore-keys: ${{ runner.os }}-cppcheck_build_dir

# _cppcheck_build_dir is required to increase cppcheck check speed
- if: ${{ steps.cache-cppcheck_build_dir.outputs.cache-hit != 'true' }}
name: cppcheck_build_dir
run: mkdir -p _cppcheck_build_dir

- name: cppcheck
run: >
./_cppcheck/cppcheck-2.19.0/cppcheck --project=build/compile_commands.json
-D__GNUC__=4
--safety
--error-exitcode=-1
-i "third_party/*"
--enable=warning,performance,portability,missingInclude
--suppressions-list=./cppcheck_suppressions.txt
--inline-suppr
--quiet
-j $(nproc)
--cppcheck-build-dir=./_cppcheck_build_dir
--checkers-report=./checkers.txt

- name: print checkers report
run: cat checkers.txt
16 changes: 0 additions & 16 deletions .github/workflows/cpplint.yml

This file was deleted.

6 changes: 3 additions & 3 deletions aether/access_points/wifi_access_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ class WifiAccessPoint final : public AccessPoint {
Obj::ptr adapter_;
ObjPtr<IPoller> poller_;
ObjPtr<DnsResolver> resolver_;
WiFiAp wifi_ap_;
WiFiPowerSaveParam psp_;
WiFiBaseStation base_station_;
WiFiAp wifi_ap_{};
WiFiPowerSaveParam psp_{};
WiFiBaseStation base_station_{};
ActionPtr<WifiConnectAction> connect_action_;
Subscription connect_sub_;
};
Expand Down
2 changes: 1 addition & 1 deletion aether/adapters/parent_modem.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ParentModemAdapter : public Adapter {
Obj::ptr aether_;
IPoller::ptr poller_;

ModemInit modem_init_;
ModemInit modem_init_{};
};
} // namespace ae

Expand Down
2 changes: 1 addition & 1 deletion aether/adapters/parent_wifi.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ParentWifiAdapter : public Adapter {
ObjPtr<IPoller> poller_;
ObjPtr<DnsResolver> dns_resolver_;

WiFiInit wifi_init_;
WiFiInit wifi_init_{};
};
} // namespace ae
#endif
Expand Down
2 changes: 1 addition & 1 deletion aether/ae_actions/select_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ UpdateStatus SelectClientAction::Update() {
return {};
}

Client::ptr SelectClientAction::client() const { return client_; }
Client::ptr const& SelectClientAction::client() const { return client_; }

SelectClientAction::State SelectClientAction::state() const { return state_; }

Expand Down
2 changes: 1 addition & 1 deletion aether/ae_actions/select_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class SelectClientAction final : public Action<SelectClientAction> {

UpdateStatus Update();

Client::ptr client() const;
Client::ptr const& client() const;
State state() const;

private:
Expand Down
32 changes: 16 additions & 16 deletions aether/ae_actions/time_sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,25 +104,25 @@ void TimeSyncAction::SyncRequest() {
CloudVisit::Visit(
[this](CloudServerConnection* sc) {
assert((sc != nullptr) && "Server connection is null!");
assert((sc->client_connection()->stream_info().link_state ==
LinkState::kLinked) &&

auto* cc = sc->client_connection();
assert((cc->stream_info().link_state == LinkState::kLinked) &&
"Client connection is not linked!");

write_action_sub_ =
sc->client_connection()
->LoginApiCall(SubApi<LoginApi>{[this](auto& api) {
AE_TELED_DEBUG("Make time sync request");
ApiPromisePtr<uint64_t> promise = api->get_time_utc();
response_sub_ = promise->StatusEvent().Subscribe(
OnResult{[this, request_time{Clock::now()}](auto& p) {
HandleResponse(
std::chrono::milliseconds{
static_cast<std::int64_t>(p.value())},
request_time, Clock::now());
// time synced, wait for next sync interval
state_ = State::kWaitInterval;
}});
}})
cc->LoginApiCall(SubApi<LoginApi>{[this](auto& api) {
AE_TELED_DEBUG("Make time sync request");
ApiPromisePtr<uint64_t> promise = api->get_time_utc();
response_sub_ = promise->StatusEvent().Subscribe(
OnResult{[this, request_time{Clock::now()}](auto& p) {
HandleResponse(
std::chrono::milliseconds{
static_cast<std::int64_t>(p.value())},
request_time, Clock::now());
// time synced, wait for next sync interval
state_ = State::kWaitInterval;
}});
}})
->StatusEvent()
.Subscribe(OnError{[this]() {
AE_TELED_ERROR("Time sync write error, repeat");
Expand Down
2 changes: 2 additions & 0 deletions aether/aether_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ static IPoller::ptr PollerFactory(AetherAppContext const& context) {
return WinPoller::ptr::Create(CreateWith{context.domain()}
.with_id(GlobalId::kPoller)
.with_flags(ObjFlags::kUnloadedByDefault));
# else
return {};
# endif
}

Expand Down
8 changes: 4 additions & 4 deletions aether/aether_c/aether_capi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,18 @@ ae::ActionPtr<ae::WriteAction> WriteMessageImpl(AetherClient* client,
return action;
}

void WriteMessage(AetherClient* client, ae::Uid destination,
void WriteMessage(AetherClient* client, ae::Uid const& destination,
ae::DataBuffer&& data, ActionStatusCb status_cb,
void* user_data) {
assert(client);

// if client still is not selected, add send message to queue
if (!client->client) {
client->actions_queue_->Push(
ae::Stage([client, destination, data{std::move(data)}, status_cb,
ae::Stage([client, destination, d{std::move(data)}, status_cb,
user_data]() mutable {
return WriteMessageImpl(client, destination, std::move(data),
status_cb, user_data);
return WriteMessageImpl(client, destination, std::move(d), status_cb,
user_data);
}));
} else {
WriteMessageImpl(client, destination, std::move(data), status_cb,
Expand Down
Loading