Commit 6d0abebb authored by Nelso Jost's avatar Nelso Jost
Browse files

NEW: major refactor of esplogger firmware; NEW: created REPL functionality

parent 52f47943
/*-----------------------------------------------------------------------------
* Author: Nelso G. Jost (nelsojost@gmail.com)
* License: GPLv2
* Purpose: Read-Eval-Print-Loop functionality
*---------------------------------------------------------------------------*/
#ifndef REPL_H
#define REPL_H
typedef struct
{
const char *name;
void (*func)(String);
const char *prototype;
const char *help;
} REPL_COMMAND;
class REPL
{
public:
REPL(REPL_COMMAND command_map[]);
String prompt=">";
void run(void);
void print_help(void);
void log(String msg);
private:
REPL_COMMAND * _fp_map;
String _command="";
void _backspace(void);
void _clear_line(void);
void _history_previous(void);
void _history_next(void);
int _execute_command(void);
};
String get_arg(String command, int index);
#endif
/*
* CREDITS: https://github.com/platformio/platform-espressif8266
*
* This sketch demonstrates how to scan WiFi networks.
* The API is almost the same as with the WiFi Shield library,
* the most obvious difference being the different file you need to include:
*/
/*-----------------------------------------------------------------------------
* Author: Nelso G. Jost (nelsojost@gmail.com)
* License: GPLv2
* Purpose: Provide wifi-related utilities.
*---------------------------------------------------------------------------*/
#include <Arduino.h>
#include "ESP8266WiFi.h"
/*
* CREDITS: https://github.com/platformio/platform-espressif8266
*/
void wifiscan(void)
{
Serial.println();
......
/*-----------------------------------------------------------------------------
* Author: Nelso G. Jost (nelsojost@gmail.com)
* License: GPLv2
* Purpose: Provide wifi-related utilities.
*---------------------------------------------------------------------------*/
#ifndef WIFI_H
#define WIFI_H
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment