Description

utils/consoleRS232.h for dice-RS232 provides the following function (for Uart) to your console application:

  • s_console_RS232_1() & s_console_RS232_2() : which delivers the following commands
    • RS232_1 send <text> – sends on serial interface PIN1/3
    • RS232_1 dump – receives data on RS232_1 (stop stops it)
    • RS232_2 send <text> – sends on serial interface PIN7/9
    • RS232_2 dump – receives data on RS232_2 (stop stops it)

Parameters

String s_console_string – String that holds the user command. Normally returned by s_console_routine() or a previous console function.

Returns

String : the user command or an empty String “” if the user command was recognised and processed by this function. (see of commands above)

Example Code:

#include "consoleLogin.h"
#include "utils/consoleRS232.h"

void setup() {
  console_init(&Serial);
}
void loop() {
  String s_console_string = s_console_routine();  
  s_console_string = s_console_RS232_1(s_console_string);
  s_console_RS232_2(s_console_string);
}

Notes and Warnings

This console-function and its commands are helpful to test and learn to work with the RS232 ports and the Uart library. See the source code as example code for your own application:

C:\Users\yourName\AppData\Local\Arduino15\packages\dice\hardware\samc\1.0.0\libraries\Console\src\...

In a ‘real world’ application, the s_console_RS232_x() functions should not be required but during development it could be helpful.

Please keep in mind that each included file and its used function increase the size of the resulting application. So in order to keep the application binaries as small as possible, include only functions that are really necessary for the final application.

An example can be found in the Arduino IDE menu:
File -> Examples -> Consoles -> Dev_Console

See also

Uart library