sensor_console.h 806 Bytes
Newer Older
Eric Duminil's avatar
Eric Duminil committed
1
2
#ifndef SENSOR_CONSOLE_H_INCLUDED
#define SENSOR_CONSOLE_H_INCLUDED
3
4
#include <Arduino.h>

Eric Duminil's avatar
Eric Duminil committed
5
/** Other scripts can use this namespace, in order to define commands, via callbacks.
Eric Duminil's avatar
Eric Duminil committed
6
 * Those callbacks can then be used to send commands to the sensor (reset, calibrate, led on/off, ...)
Eric Duminil's avatar
Eric Duminil committed
7
 * The callbacks can either have no parameter, or one int32_t parameter.
8
9
 */

Eric Duminil's avatar
Eric Duminil committed
10
namespace sensor_console {
11
12
13
  void defineCommand(const char *name, void (*function)(), const __FlashStringHelper *doc_fstring);
  void defineIntCommand(const char *name, void (*function)(int32_t), const __FlashStringHelper *doc_fstring);
  void defineStringCommand(const char *name, void (*function)(char*), const __FlashStringHelper *doc_fstring);
Eric Duminil's avatar
Eric Duminil committed
14

Eric Duminil's avatar
Eric Duminil committed
15
  void processSerialInput(const byte in_byte);
16
17

  void execute(const char *command_line);
18
}
Eric Duminil's avatar
Eric Duminil committed
19
20

#endif