Skip to content

Commit 220c4be

Browse files
fix: various Echo fixes
1 parent 42f0029 commit 220c4be

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

postmaster/instantiations/EchoServer.hpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@
77

88
namespace main_
99
{
10+
class EchoOnConnection
11+
: public services::EchoOnConnection
12+
{
13+
public:
14+
EchoOnConnection(services::EchoOnSesame& otherEcho, services::MethodSerializerFactory& serializerFactory)
15+
: services::EchoOnConnection(serializerFactory)
16+
, otherEcho(otherEcho)
17+
{}
18+
19+
virtual void Detaching() override
20+
{
21+
ReleaseReader();
22+
otherEcho.Reset();
23+
}
24+
25+
private:
26+
services::EchoOnSesame& otherEcho;
27+
};
28+
1029
struct EchoServer
1130
{
1231
EchoServer(services::ConnectionFactory& connectionFactory, UartCreator& serialCreator, uint16_t port);
@@ -19,7 +38,7 @@ namespace main_
1938
services::MethodSerializerFactory::ForServices<>::AndProxies<> serializerFactory;
2039
hal::BufferedSerialCommunicationOnUnbuffered::WithStorage<256> bufferedSerial{ *serial };
2140
main_::EchoOnSesame::WithMessageSize<256> echoUart{ bufferedSerial, serializerFactory };
22-
services::EchoOnConnection echoConnection{ serializerFactory };
41+
EchoOnConnection echoConnection{ echoUart.echo, serializerFactory };
2342

2443
services::ServiceForwarderAll forwardLeft{ echoUart.echo, echoConnection };
2544
services::ServiceForwarderAll forwardRight{ echoConnection, echoUart.echo };

0 commit comments

Comments
 (0)