15 void parse(String cmd);
20 INFO(
"CLI started on Serial. Type 'help' for list of commands.\n");
23 while (Serial.available()) {
24 char inp = Serial.read();
25 if (inp ==
';' && serial_buffer ==
"10") {
31 tools::trim(serial_buffer);
32 if (serial_buffer !=
"") {
33 if (serial_buffer.startsWith(
"10;")) {
34 RFlinkParse(serial_buffer);
47 INFO(
"\nCLI: %s\n", cli_string.c_str());
50 tools::split(cli_string,
" ", cmd, args);
54 OOKwiz version %s Command Line Interpreter help.
58 help - prints this message
59 set - shows current configuration settings
60 set x - sets configuration flag x
61 set x y - sets configuration value x to y
62 unset x - unsets a flag or variable
63 load [<file>] - loads the default saved settings, or from a named file in flash
64 save - saves to a file named 'default', which is what is used at boot time.
65 save [<file>] - saves the settings to a named file in SPIFFS flash
66 ls - lists stored configuration files in SPIFFS flash
67 rm <file> - deletes a configuration file
68 reboot - reboot using the saved defaults
69 standby - set radio to standby mode
70 receive - set radio to receive mode
71 sim <string> - Takes a RawTimings, Pulsetrain or Meaning string representation and
72 acts like it just came in off the air.
73 transmit <string> - Takes a RawTimings, Pulsetrain or Meaning string representation and
76 rm default;reboot - restore factory settings
77 sr - shorthand for "save;reboot"
80 See the OOKwiz README.md on GitHub for a quick-start guide and full documentation
88 INFO(
"%s\n", Settings::list().c_str());
91 SPLIT(args,
" ", name, value);
94 tools::split(args,
"=", name, value);
96 if (Settings::set(name, value)) {
98 INFO(
"'%s' set to '%s'\n", name.c_str(), value.c_str());
100 INFO(
"'%s' set\n", name.c_str());
106 if (cmd ==
"unset") {
107 if (Settings::unset(args)) {
108 INFO(
"Setting '%s' removed.\n", args.c_str());
117 Settings::load(args);
125 Settings::save(args);
139 if (cmd ==
"reboot") {
144 if (cmd ==
"receive") {
146 INFO(
"Receiver active, waiting for pulses.\n");
151 if (cmd ==
"standby") {
153 INFO(
"Transceiver placed in standby mode.\n");
158 if (cmd ==
"transmit") {
159 OOKwiz::transmit(args);
164 OOKwiz::simulate(args);
169 if (Settings::save(
"default")) {
175 INFO(
"Unknown command '%s'. Enter 'help' for a list of commands.\n", cmd.c_str());
179 INFO(
"\nCLI: %s\n", cmd.c_str());
180 cmd = cmd.substring(3);
186 tools::split(cmd,
";", plugin_name, txString);
187 Device::transmit(plugin_name, txString);