File tree Expand file tree Collapse file tree
3rd_party_adapters/Arduino
application_business_rules/serial_interface Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,12 +44,7 @@ void setCallbackForLineReception(const StringHandler &callback)
4444
4545} // namespace serial_port
4646
47- /*
48- SerialEvent occurs whenever a new data comes in the hardware serial RX. This
49- routine is run between each time loop() runs, so using delay inside loop can
50- delay response. Multiple bytes of data may be available.
51- */
52- void serialEvent ()
47+ void serial_port::readAndHandleInput ()
5348{
5449 while (Serial.available () > 0 )
5550 {
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ void initialize();
3333/* *
3434 * Reads a line from serial port.
3535 *
36- * Interprets the end of line as `\n`.
36+ * Expects the end of line to be `\n`.
3737 * It will wait for data for the duration of the timeout.
3838 * \returns an empty string in case no data is read
3939 */
@@ -42,7 +42,7 @@ String readLine();
4242/* *
4343 * Gets a line from serial port.
4444 *
45- * Interprets the end of line as `\n`.
45+ * Expects the end of line to be `\n`.
4646 * \returns an object that does not contain a value in case no data is already available.
4747 */
4848std::optional<String> getLine ();
@@ -58,6 +58,8 @@ typedef std::function<void(const String &)> StringHandler;
5858 */
5959void setCallbackForLineReception (const StringHandler &callback);
6060
61+ void readAndHandleInput ();
62+
6163} // namespace serial_port
6264
6365/* *
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ void loop()
3232 static Presenter presenter (singleMenu, board::getStatusIndicators ());
3333 static ProcessHmiInputs processHmiInputs (presenter, board::getKeypad ());
3434
35+ serial_port::readAndHandleInput ();
36+
3537 for (auto task : device::tasks)
3638 {
3739 serial_port::cout << task.second .getLabel () << " : " << std::boolalpha << task.second .isRunning ()
You can’t perform that action at this time.
0 commit comments