Repository navigation
556 fixing the modem code. Fix modem I/O, connection lifecycle, and graceful shutdown - #557
Open
dmitriyk-aethernet wants to merge 15 commits into
Open
dmitriyk-aethernet wants to merge 15 commits into
dmitriyk-aethernet wants to merge 15 commits into
Conversation
BartolomeyKant
requested changes
Sep 10, 2026
| #include "aether/adapters/adapter.h" | ||
|
|
||
| namespace ae { | ||
| Action* Adapter::Stop() { return nullptr; } |
Collaborator
There was a problem hiding this comment.
leave it pure virtual
|
|
||
| // Stop runtime network resources. The adapter owns the returned action and | ||
| // keeps it alive until destruction. nullptr means no asynchronous work. | ||
| virtual Action* Stop(); |
Collaborator
There was a problem hiding this comment.
define your own action interface based on Action
like class IAdapterStop: public Action.
return refernce to it.
|
|
||
| void ProtocolContext::SetSendResultResponse(RequestId request_id) { | ||
| auto entry = TakePending(request_id); | ||
| auto* p = parser(); |
Collaborator
There was a problem hiding this comment.
What problem are you trying to solve?
| // IWYU pragma: end_keeps | ||
|
|
||
| namespace ae { | ||
| namespace ethernet_transport_factory_internal { |
| # include "aether/channels/channel.h" | ||
|
|
||
| namespace ae::modem_channel_internal { | ||
| TransportBuildSender ConnectTransport(std::unique_ptr<ByteIStream> transport); |
|
|
||
| s = t->stream_update_event().Subscribe([&]() { | ||
| if (t->stream_info().link_state == LinkState::kLinked) { | ||
| auto complete = [&]() noexcept { |
Collaborator
There was a problem hiding this comment.
don't make sense to me
| Uid const& destination() const; | ||
|
|
||
| private: | ||
| static constexpr auto kBufferCapacity = AE_P2P_MESSAGE_STREAM_BUFFER_CAPACITY; |
| template <std::size_t Capacity> | ||
| class SafeStream; | ||
|
|
||
| static constexpr inline std::size_t kP2pSafeStreamCapacity = |
Collaborator
There was a problem hiding this comment.
The rule
define static constexpr variable and assign to it defined values from config
Than use this variable in templates.
|
|
||
| private: | ||
| SizedPacketGate sized_packet_gate_; | ||
| // TODO: add config |
Collaborator
There was a problem hiding this comment.
looks like you solved merge conflicts wrong
BartolomeyKant
requested changes
Sep 12, 2026
| // task_sub controls if task reset or no | ||
| op_base_.task_sub = ac_.scheduler().DelayedTask( | ||
| [&]() noexcept { | ||
| if (op_base_.is_reset()) { |
Collaborator
There was a problem hiding this comment.
make no sense
Reset twice do nothing
- Make Adapter::Stop() pure virtual and return IAdapterStop&. - Add adapter-owned shutdown operations with stable lifetimes. - Restore configurable buffer, queue, and action pool capacities. - Remove the redundant timeout guard and internal modem channel header. - Preserve transport subscription cleanup that prevents shutdown crashes. - Keep early returns for unexpected protocol responses and remove redundant parser checks. - Add regression tests for shutdown lifetimes and unknown or duplicate responses. Validation: clean single-threaded build, four targeted test suites, and fresh/preserved-state A/B and cloud smoke tests over Ethernet passed.
- Implement buffered UART transport. - Add a FireBeetle 2 ESP32-C6 configuration for SIM7070G. - Stop pings and reconnection attempts before shutting down the modem. - Power off the modem using AT+CPOWD=1 and wait for NORMAL POWER DOWN. - Add shutdown and modem error-handling tests. - Set the main task stack size to 24 KB. - Switch the current build configuration to Wi-Fi.
- Define WIFI_SSID and WIFI_PASSWORD through target_compile_definitions. - Use the supplied credentials instead of hardcoded values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes modem communication stalls and shutdown crashes, and adds orderly network cleanup for SIM7070 and Thingy91X. Application exit now waits for modem shutdown before releasing runtime resources.
Changes include:
The branch also enables SIM7070 by default, increases connection/request timeouts, limits cloud connections to one, and replaces several configurable capacities with fixed values.
Validation: