diff --git a/.github/workflows/ci-cd-multi-platforms.yml b/.github/workflows/ci-cd-multi-platforms.yml index eeb3b625..fb95e9cf 100644 --- a/.github/workflows/ci-cd-multi-platforms.yml +++ b/.github/workflows/ci-cd-multi-platforms.yml @@ -67,11 +67,12 @@ jobs: } - { name: "macOS Clang", - os: [self-hosted, macOS, ARM64], + os: macos-latest, shell: "bash", generator: "Unix Makefiles", cc: "clang", cxx: "clang++", + jobs_count: 4, initial_cache: ".github/workflows/macos_initial_cache.txt", } diff --git a/aether/format/default_formatters.h b/aether/format/default_formatters.h index d966c996..b70c5023 100644 --- a/aether/format/default_formatters.h +++ b/aether/format/default_formatters.h @@ -17,11 +17,12 @@ #ifndef AETHER_FORMAT_DEFAULT_FORMATTERS_H_ #define AETHER_FORMAT_DEFAULT_FORMATTERS_H_ -#include +#include #include #include #include #include +#include #include #include @@ -55,17 +56,7 @@ template struct Formatter< T, std::enable_if_t::value && !IstextSpecified::value && !std::is_enum_v && - !std::is_integral_v && !IsTimePoint::value && - !IsDuration::value>> { - template - void Format(T const& value, FormatContext& ctx) const { - ctx.out().stream() << value; - } -}; - -// for any integral type -template -struct Formatter>> { + !IsTimePoint::value && !IsDuration::value>> { template void Format(T const& value, FormatContext& ctx) const { ctx.out().stream() << value; @@ -131,16 +122,38 @@ struct Formatter>::value || template void FormatBuffer(T const& value, FormatContext& ctx) const { - ctx.out().stream() << std::setfill('0'); - for (auto it = std::begin(value); it != std::end(value); ++it) { - ctx.out().stream() << std::setw(2) << std::hex; - if constexpr (std::is_unsigned_v) { - ctx.out().stream() << std::uint64_t{*it}; + static_assert(sizeof(typename T::value_type) == 1, + "Print buffer only for one byte size values"); + + constexpr std::size_t kLocalBuffSize = 128; + constexpr std::size_t kTwoMinCharValue = 0x10; + constexpr int kPrintBase = 16; + std::size_t v_size = 2; // 2 chars on byte + std::size_t buff_size = v_size * value.size(); + + std::array local_buff; + std::unique_ptr alloc_buff; // NOLINT(*avoid-c-arrays) + + char* buff; // NOLINT(*init-variables) + if (buff_size > local_buff.size()) { + alloc_buff = + std::make_unique(buff_size); // NOLINT(*avoid-c-arrays) + buff = alloc_buff.get(); + } else { + buff = local_buff.data(); + } + std::size_t wp = 0; + for (auto const& v : value) { + // convert value with leading 0 + if (v < kTwoMinCharValue) { + *(buff + wp) = '0'; + std::to_chars(buff + wp + 1, buff + wp + v_size, v, kPrintBase); } else { - ctx.out().stream() << std::int64_t{*it}; + std::to_chars(buff + wp, buff + wp + v_size, v, kPrintBase); } + wp += v_size; } - ctx.out().stream() << std::setfill(' ') << std::setw(0) << std::dec; + ctx.out().stream().write(buff, static_cast(wp)); } }; diff --git a/aether/poller/epoll_poller.cpp b/aether/poller/epoll_poller.cpp index fa90f057..2937c22e 100644 --- a/aether/poller/epoll_poller.cpp +++ b/aether/poller/epoll_poller.cpp @@ -112,8 +112,7 @@ void EpollImpl::Callback(DescriptorType fd, EventCb cb) { } void EpollImpl::Event(DescriptorType fd, EventType events) { - AE_TELED_DEBUG("Poller event for fd:{} events: {}", fd, - static_cast(events)); + AE_TELED_DEBUG("Poller event for fd:{} events: {}", fd, events); auto it = event_map_.find(fd); if (it == event_map_.end()) { assert(false && "Callback should setup first"); diff --git a/aether/safe_stream/details/safe_stream_send_action.h b/aether/safe_stream/details/safe_stream_send_action.h index bb03a595..ff30834d 100644 --- a/aether/safe_stream/details/safe_stream_send_action.h +++ b/aether/safe_stream/details/safe_stream_send_action.h @@ -216,8 +216,6 @@ class SafeStreamSendAction { [this, range{selected_sch.range}]() { repeat_timer_.Reset(); ProcessRepeat(range); - // enqueue repeat timeout for the next chunk - EnqueueRepeatTimeout(); }, wait_time); } @@ -302,6 +300,7 @@ class SafeStreamSendAction { return RegisterChunk(dspan, chunk_index_range, current_time); }); if (!res) { + AE_TELED_DEBUG("Send chunk error {}", res.error()); // If any error over empty buffer if (res.error() != 0) { AE_TELED_ERROR("Chunk send error!"); diff --git a/aether/transport/system_sockets/sockets/lwip_cb_udp_socket.cpp b/aether/transport/system_sockets/sockets/lwip_cb_udp_socket.cpp index c0ea8afb..906d77d5 100644 --- a/aether/transport/system_sockets/sockets/lwip_cb_udp_socket.cpp +++ b/aether/transport/system_sockets/sockets/lwip_cb_udp_socket.cpp @@ -69,8 +69,13 @@ std::optional LwipCBUdpSocket::Send(Span data) { memcpy(p->payload, data.data(), data.size()); err = udp_send(pcb_, p); + if (err != ERR_OK) { - AE_TELED_ERROR("Send failed: {}", err); + if (err == ERR_MEM) { + // internal buffer is full + return 0; + } + AE_TELED_ERROR("Send failed: {}", static_cast(err)); OnError(); return std::nullopt; } diff --git a/aether/transport/system_sockets/tcp/tcp.h b/aether/transport/system_sockets/tcp/tcp.h index 17483607..d88612b0 100644 --- a/aether/transport/system_sockets/tcp/tcp.h +++ b/aether/transport/system_sockets/tcp/tcp.h @@ -67,6 +67,11 @@ class SendAction final : public PacketSendAction { SetStatus(WriteAction::Status::kFail); return; } + if (*res == 0) { + reenqueue_ = true; + return; + } + AE_TELED_DEBUG("Data has been written size {} data {}", *res, data_); sent_offset_ += *res; diff --git a/aether/transport/system_sockets/udp/udp.h b/aether/transport/system_sockets/udp/udp.h index 2b721d25..1f52e1c3 100644 --- a/aether/transport/system_sockets/udp/udp.h +++ b/aether/transport/system_sockets/udp/udp.h @@ -53,6 +53,7 @@ class SendAction final : public PacketSendAction { AE_CLASS_MOVE_ONLY(SendAction) void Send() override { + reenqueue_ = false; auto res = socket_->Send(Span{data_.data(), data_.size()}); if (!res) { AE_TELED_ERROR("Data has not been written"); @@ -62,6 +63,7 @@ class SendAction final : public PacketSendAction { AE_TELED_DEBUG("Data has been written size {}", data_.size()); if (*res == 0) { + reenqueue_ = true; // Not sent yet return; } @@ -80,7 +82,7 @@ class SendAction final : public PacketSendAction { } bool is_done() const override { return is_done_; } - bool re_enqueue() const override { return reenque_; } + bool re_enqueue() const override { return reenqueue_; } protected: void SetStatus(WriteAction::Status status) noexcept override { @@ -93,7 +95,7 @@ class SendAction final : public PacketSendAction { AeContext ae_context_; Socket* socket_; DataBuffer data_; - bool reenque_ = false; + bool reenqueue_ = false; bool is_done_ = false; TaskSubscription set_status_; }; diff --git a/aether/types/uid.h b/aether/types/uid.h index 495cebcd..0d42e091 100644 --- a/aether/types/uid.h +++ b/aether/types/uid.h @@ -22,10 +22,10 @@ #include #include #include +#include #include #include "aether/type_traits.h" -#include "aether/types/span.h" #include "aether/format/format.h" #include "aether/reflect/reflect.h" #include "aether/types/literal_array.h" @@ -102,9 +102,35 @@ template <> struct Formatter { template void Format(Uid const& uid, FormatContext& ctx) const { - ae::Format(ctx.out(), "{}-{}-{}-{}-{}", Span{uid.value.data(), 4}, - Span{uid.value.data() + 4, 2}, Span{uid.value.data() + 6, 2}, - Span{uid.value.data() + 8, 2}, Span{uid.value.data() + 10, 6}); + constexpr std::uint8_t kMinTwoCharsValue = 0x10; + constexpr int kPrintBase = 16; + // each hex value takes 2 chars + 4 '-' + std::array buff; + std::size_t wp = 0; + + for (std::size_t i = 0; i < Uid::kSize; i++) { + switch (i) { + case 4: + case 6: + case 8: + case 10: + buff[wp++] = '-'; + break; + default: + break; + } + auto v = uid.value[i]; + // convert value with leading 0 + if (v < kMinTwoCharsValue) { + *(buff.data() + wp) = '0'; + std::to_chars(buff.data() + wp + 1, buff.data() + wp + 2, v, + kPrintBase); + } else { + std::to_chars(buff.data() + wp, buff.data() + wp + 2, v, kPrintBase); + } + wp += 2; + } + ctx.out().stream().write(buff.data(), buff.size()); } }; diff --git a/aether/wifi/esp_wifi_driver.cpp b/aether/wifi/esp_wifi_driver.cpp index b2e1c913..50d451ac 100644 --- a/aether/wifi/esp_wifi_driver.cpp +++ b/aether/wifi/esp_wifi_driver.cpp @@ -67,7 +67,7 @@ void EventHandler(void* arg, esp_event_base_t event_base, int32_t event_id, case EspWifiDriver::State::kDisconnected: driver->DisconnectedEventHandler(event_base, event_id, event_data); break; - case EspWifiDriver::State::kDisconnecring: + case EspWifiDriver::State::kDisconnecting: driver->DisconnectingEventHandler(event_base, event_id, event_data); break; case EspWifiDriver::State::kConnecting: @@ -236,13 +236,6 @@ void StartWifiConnection(esp_netif_t* espt_init_sta, WiFiAp const& wifi_ap, AE_TELED_DEBUG("Using DHCP for IP configuration"); } - wifi_init_config_t wifi_init_config = WIFI_INIT_CONFIG_DEFAULT(); - // We disable aggregation so that the packages go out one by one and quickly - wifi_init_config.ampdu_rx_enable = 0; - wifi_init_config.ampdu_tx_enable = 0; - - ESP_ERROR_CHECK(esp_wifi_init(&wifi_init_config)); - ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config)); if (psp) { @@ -310,8 +303,12 @@ void EspWifiDriver::Init() { espt_init_sta_ = esp_netif_create_default_wifi_sta(); - wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); - ESP_ERROR_CHECK(esp_wifi_init(&cfg)); + wifi_init_config_t wifi_init_config = WIFI_INIT_CONFIG_DEFAULT(); + // We disable aggregation so that the packages go out one by one and quickly + wifi_init_config.ampdu_rx_enable = 0; + wifi_init_config.ampdu_tx_enable = 0; + + ESP_ERROR_CHECK(esp_wifi_init(&wifi_init_config)); esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, esp_wifi_driver_internal::EventHandler, this); @@ -342,7 +339,7 @@ void EspWifiDriver::Deinit() { } void EspWifiDriver::Disconnect() { - connection_state_.state = State::kDisconnecring; + connection_state_.state = State::kDisconnecting; connected_to_.reset(); esp_wifi_disconnect(); esp_wifi_stop(); diff --git a/aether/wifi/esp_wifi_driver.h b/aether/wifi/esp_wifi_driver.h index f17df6f7..3431249f 100644 --- a/aether/wifi/esp_wifi_driver.h +++ b/aether/wifi/esp_wifi_driver.h @@ -49,7 +49,7 @@ class EspWifiDriver final : public WifiDriver { public: enum class State : char { kDisconnected, - kDisconnecring, + kDisconnecting, kConnecting, kConnected, }; diff --git a/aether/work_cloud_api/client_api/client_api_safe.cpp b/aether/work_cloud_api/client_api/client_api_safe.cpp index 840999cb..a3d53fde 100644 --- a/aether/work_cloud_api/client_api/client_api_safe.cpp +++ b/aether/work_cloud_api/client_api/client_api_safe.cpp @@ -23,9 +23,22 @@ #include "aether/tele/tele.h" namespace ae { + ClientApiSafe::ClientApiSafe(ProtocolContext& protocol_context) : ApiClassImpl{protocol_context}, return_result{protocol_context} {} +void ClientApiSafe::ChangeParent([[maybe_unused]] Uid const& uid) { + AE_TELED_DEBUG("ChangeParent"); +} + +void ClientApiSafe::ChangeAlias([[maybe_unused]] Uid const& uid) { + AE_TELED_DEBUG("ChangeAlias"); +} + +void ClientApiSafe::NewChildren([[maybe_unused]] std::vector const& uids) { + AE_TELED_DEBUG("NewChildren"); +} + void ClientApiSafe::SendMessages(std::vector const& messages) { for (auto const& msg : messages) { AE_TELED_DEBUG("Received message uid:{}", msg.uid); @@ -58,4 +71,48 @@ void ClientApiSafe::SendClouds( void ClientApiSafe::RequestTelemetry() { request_telemetry_event_.Emit(); } +void ClientApiSafe::SendAccessGroups( + [[maybe_unused]] std::vector const& access_group) { + AE_TELED_DEBUG("SendAccessGroups"); +} +void ClientApiSafe::SendAccessGroupForClient( + [[maybe_unused]] Uid const& uid, + [[maybe_unused]] std::vector const& groups) { + AE_TELED_DEBUG("SendAccessGroupForClient"); +} +void ClientApiSafe::AddItemsToAccessGroup( + [[maybe_unused]] std::uint64_t id, + [[maybe_unused]] std::vector const& groups) { + AE_TELED_DEBUG("AddItemsToAccessGroup"); +} +void ClientApiSafe::RemoveItemsFromAccessGroup( + [[maybe_unused]] std::uint64_t id, + [[maybe_unused]] std::vector const& groups) { + AE_TELED_DEBUG("RemoveItemsFromAccessGroup"); +} +void ClientApiSafe::AddAccessGroupsToClient( + [[maybe_unused]] Uid const& uid, + [[maybe_unused]] std::vector const& groups) { + AE_TELED_DEBUG("AddAccessGroupsToClient"); +} +void ClientApiSafe::RemoveAccessGroupsFromClient( + [[maybe_unused]] Uid const& uid, + [[maybe_unused]] std::vector const& groups) { + AE_TELED_DEBUG("RemoveAccessGroupsFromClient"); +} +void ClientApiSafe::SendAllAccessedClients( + [[maybe_unused]] Uid const& uid, + [[maybe_unused]] std::vector const& accessed_clients) { + AE_TELED_DEBUG("SendAllAccessedClients"); +} +void ClientApiSafe::SendAccessCheckResults( + [[maybe_unused]] std::vector const& results) { + AE_TELED_DEBUG("SendAccessCheckResults"); +} + +void ClientApiSafe::SendMessage(AeMessage const& msg) { + AE_TELED_DEBUG("Received message uid:{}", msg.uid); + send_message_event_.Emit(msg); +} + } // namespace ae diff --git a/aether/work_cloud_api/client_api/client_api_safe.h b/aether/work_cloud_api/client_api/client_api_safe.h index e01474f3..2a1d5af1 100644 --- a/aether/work_cloud_api/client_api/client_api_safe.h +++ b/aether/work_cloud_api/client_api/client_api_safe.h @@ -27,11 +27,27 @@ #include "aether/work_cloud_api/server_descriptor.h" namespace ae { +struct AccessGroup { + AE_REFLECT_MEMBERS(owner, id, data); + Uid owner; + std::uint64_t id; + DataBuffer data; +}; + +struct AccessCheckResult { + AE_REFLECT_MEMBERS(source_uid, target_uid, has_access); + Uid source_uid; + Uid target_uid; + bool has_access; +}; class ClientApiSafe : public ApiClassImpl { public: explicit ClientApiSafe(ProtocolContext& protocol_context); + void ChangeParent(Uid const& uid); + void ChangeAlias(Uid const& uid); + void NewChildren(std::vector const& uids); void SendMessages(std::vector const& messages); void SendServerDescriptor(ServerDescriptor const& server_descriptor); @@ -42,14 +58,41 @@ class ClientApiSafe : public ApiClassImpl { void RequestTelemetry(); + void SendAccessGroups(std::vector const& access_group); + void SendAccessGroupForClient(Uid const& uid, + std::vector const& groups); + void AddItemsToAccessGroup(std::uint64_t id, std::vector const& groups); + void RemoveItemsFromAccessGroup(std::uint64_t id, + std::vector const& groups); + void AddAccessGroupsToClient(Uid const& uid, + std::vector const& groups); + void RemoveAccessGroupsFromClient(Uid const& uid, + std::vector const& groups); + void SendAllAccessedClients(Uid const& uid, + std::vector const& accessed_clients); + void SendAccessCheckResults(std::vector const& results); + void SendMessage(AeMessage const& message); + ReturnResultApi return_result; - AE_METHODS(RegMethod<6, &ClientApiSafe::SendMessages>, + AE_METHODS(RegMethod<3, &ClientApiSafe::ChangeParent>, + RegMethod<4, &ClientApiSafe::ChangeAlias>, + RegMethod<5, &ClientApiSafe::NewChildren>, + RegMethod<6, &ClientApiSafe::SendMessages>, RegMethod<7, &ClientApiSafe::SendServerDescriptor>, RegMethod<8, &ClientApiSafe::SendServerDescriptors>, RegMethod<9, &ClientApiSafe::SendCloud>, RegMethod<10, &ClientApiSafe::SendClouds>, RegMethod<11, &ClientApiSafe::RequestTelemetry>, + RegMethod<12, &ClientApiSafe::SendAccessGroups>, + RegMethod<13, &ClientApiSafe::SendAccessGroupForClient>, + RegMethod<14, &ClientApiSafe::AddItemsToAccessGroup>, + RegMethod<15, &ClientApiSafe::RemoveItemsFromAccessGroup>, + RegMethod<16, &ClientApiSafe::AddAccessGroupsToClient>, + RegMethod<17, &ClientApiSafe::RemoveAccessGroupsFromClient>, + RegMethod<18, &ClientApiSafe::SendAllAccessedClients>, + RegMethod<19, &ClientApiSafe::SendAccessCheckResults>, + RegMethod<20, &ClientApiSafe::SendMessage>, ExtApi<&ClientApiSafe::return_result>); auto send_message_event() { return EventSubscriber{send_message_event_}; } diff --git a/cmake/repo_init.cmake b/cmake/repo_init.cmake deleted file mode 100644 index ebef313f..00000000 --- a/cmake/repo_init.cmake +++ /dev/null @@ -1,155 +0,0 @@ -# Copyright 2025 Aethernet Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -cmake_minimum_required(VERSION 3.16.0) - -# -# Initiate, update, patch project submodule dependencies -# - -set(ROOT_REPO_DIR "${CMAKE_CURRENT_LIST_DIR}/..") -set(THIRD_PARTY_DIR "${ROOT_REPO_DIR}/third_party") -set(UPDATED_FILE "${THIRD_PARTY_DIR}/.updated") - -find_program(GIT_EXECUTABLE NAMES git) - -# -# Check if repository is a git repository -# -function(_ae_is_git_repo RESULT_VAR) - if(NOT EXISTS "${ROOT_REPO_DIR}/.git") - set(${RESULT_VAR} "NotAGit" PARENT_SCOPE) - return() - endif() - if (NOT GIT_EXECUTABLE) - set(${RESULT_VAR} "NotAGit" PARENT_SCOPE) - return() - endif() - set(${RESULT_VAR} "AGit" PARENT_SCOPE) -endfunction() - -# -# Get list of submodules -# in format -# -function(_ae_submodules_list RESULT_VAR) - execute_process(COMMAND "${GIT_EXECUTABLE}" -C ${ROOT_REPO_DIR} submodule status - OUTPUT_VARIABLE output_result - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - - # output_result should has list of strings in format - # - # b9d897b5f38674248c86fb58342b87cb6006fe1f ../third_party/Unity (v2.6.1-15-gb9d897b) - # - # Add a timestamp for a path at the end of the line - string(REPLACE "\n" ";" output_result ${output_result}) - - set(modules_list "") - foreach(module IN LISTS output_result) - string(REGEX MATCH "[a-fA-F0-9]+ (.+) \(.*\)$" match "${module}") - set(file_path ${CMAKE_MATCH_1}) - file(TIMESTAMP "${ROOT_REPO_DIR}/${file_path}" timestamp) - string(APPEND modules_list "${module} ${timestamp}\n") - endforeach() - - set(${RESULT_VAR} "${modules_list}" PARENT_SCOPE) -endfunction() - -# -# Check if update for third_parties required -# -function(_ae_is_updated RESULT_VAR) - - if(NOT EXISTS "${UPDATED_FILE}") - set(${RESULT_VAR} "InitRequired" PARENT_SCOPE) - return() - endif() - - # get current submodules list - _ae_submodules_list(submodules_list) - - file(READ "${UPDATED_FILE}" file_submodules_list) - if (NOT submodules_list STREQUAL file_submodules_list) - set(${RESULT_VAR} "UpdateRequired" PARENT_SCOPE) - return() - endif() - - set(${RESULT_VAR} "Updated" PARENT_SCOPE) -endfunction() - -# -# Update third_parties -# -function(_ae_update_third_parties ) - message(STATUS "Updating/Initializing third_party dependencies") - # update and init submodules - execute_process(COMMAND "${GIT_EXECUTABLE}" -C ${ROOT_REPO_DIR} submodule update --force --init --recursive - RESULT_VARIABLE submodule_update_result) - if (NOT submodule_update_result EQUAL 0 ) - message(FATAL_ERROR "Failed to update third_party dependencies") - endif() - execute_process(COMMAND "${GIT_EXECUTABLE}" -C ${ROOT_REPO_DIR} submodule foreach "'${GIT_EXECUTABLE}'" reset --hard HEAD - RESULT_VARIABLE submodule_reset_result) - if (NOT submodule_reset_result EQUAL 0 ) - message(FATAL_ERROR "Failed to reset to default third_party dependencies") - endif() - - # apply patches - file(GLOB patch_list LIST_DIRECTORIES false RELATIVE "${THIRD_PARTY_DIR}" "${THIRD_PARTY_DIR}/*.patch") - foreach(patch_file IN LISTS patch_list) - string(REPLACE ".patch" "" dep_name "${patch_file}") - message(STATUS "Applying patch to ${dep_name}") - - execute_process(COMMAND "${GIT_EXECUTABLE}" -C "${THIRD_PARTY_DIR}/${dep_name}" apply --ignore-whitespace "${THIRD_PARTY_DIR}/${patch_file}" - RESULT_VARIABLE patch_apply_result) - if (NOT patch_apply_result EQUAL 0 ) - message(FATAL_ERROR "Failed to apply patch ${patch_file}") - endif() - endforeach() - - #copy cmake files - file(GLOB cmake_files LIST_DIRECTORIES false RELATIVE "${THIRD_PARTY_DIR}" "${THIRD_PARTY_DIR}/CMakeLists.*") - foreach(cmake_file IN LISTS cmake_files) - string(REPLACE "CMakeLists." "" dep_name "${cmake_file}") - message(STATUS "Copying cmake file to ${dep_name}") - - if (EXISTS "${THIRD_PARTY_DIR}/${dep_name}/CMakeLists.txt") - file(REMOVE "${THIRD_PARTY_DIR}/${dep_name}/CMakeLists.txt") - endif() - file(COPY "${THIRD_PARTY_DIR}/${cmake_file}" DESTINATION "${THIRD_PARTY_DIR}/${dep_name}") - file(RENAME "${THIRD_PARTY_DIR}/${dep_name}/${cmake_file}" "${THIRD_PARTY_DIR}/${dep_name}/CMakeLists.txt") - endforeach() -endfunction() - -function(ae_update_dependencies) - _ae_is_git_repo(IS_GIT) - if (IS_GIT STREQUAL "NotAGit" ) - message(STATUS "Git not available, dependencies will not be updated") - return() - endif() - - _ae_is_updated(update_status) - if (update_status STREQUAL "Updated") - message(STATUS "Dependencies updated does not required") - return() - endif() - - _ae_update_third_parties() - - #write updated file - _ae_submodules_list(submodules_list) - message(STATUS "Submodules list is\n${submodules_list}") - file(WRITE "${UPDATED_FILE}" "${submodules_list}") -endfunction() diff --git a/examples/cloud/cloud_test.cpp b/examples/cloud/cloud_test.cpp index 379471ed..d3d0f3ae 100644 --- a/examples/cloud/cloud_test.cpp +++ b/examples/cloud/cloud_test.cpp @@ -40,9 +40,9 @@ constexpr SafeStreamConfig kSafeStreamConfig{ .window_size = AE_SAFE_STREAM_CAPACITY / 2 - 1, .max_packet_size = AE_SAFE_STREAM_CAPACITY / 2 - 1, .max_repeat_count = 10, - .wait_ack_timeout = std::chrono::milliseconds{1500}, - .send_ack_timeout = std::chrono::milliseconds{0}, - .send_repeat_timeout = std::chrono::milliseconds{200}, + .wait_ack_timeout = std::chrono::seconds{5}, + .send_ack_timeout = std::chrono::seconds{0}, + .send_repeat_timeout = std::chrono::seconds{2}, }; } // namespace ae::cloud_test