Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 32577b3

Browse files
committed
Fixes from testing with serial modem
1 parent f723d93 commit 32577b3

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

SerialTransceiver.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ std::unique_ptr<Command> SerialTransceiver::CreateCommand(const String& text,
5151
command.reset(new PushCommand(fbase));
5252
} else if (text == "REMOVE") {
5353
command.reset(new RemoveCommand(fbase));
54+
} else if (text == "BEGIN_STREAM") {
55+
command.reset(new StreamCommand(fbase));
5456
}
5557
return command;
5658
}

modem/stream-command.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ bool StreamCommand::execute(const String& command,
3636
} else if (in->available()) {
3737
String command = in->readLine();
3838
if (command == "END_STREAM") {
39+
out->println("+OK");
3940
running = false;
4041
} else {
4142
out->println("-FAIL Cannot call any command but END_STREAM.");

modem/test/stream-command_test.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ TEST_F(StreamCommandTest, streams) {
4646
.WillOnce(Return(path))
4747
.WillOnce(Return("END_STREAM"));
4848

49-
5049
const String value("Test value");
5150
EXPECT_CALL(*stream_, available())
5251
.WillOnce(Return(true))
@@ -70,6 +69,9 @@ TEST_F(StreamCommandTest, streams) {
7069
EXPECT_CALL(out_, println(value))
7170
.WillOnce(Return(1));
7271

72+
EXPECT_CALL(out_, println(String("+OK")))
73+
.WillOnce(Return(1));
74+
7375
ASSERT_TRUE(RunCommand(FirebaseError()));
7476
}
7577

0 commit comments

Comments
 (0)