-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProbe.h
More file actions
46 lines (35 loc) · 834 Bytes
/
Probe.h
File metadata and controls
46 lines (35 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Probe API,
Library that structures Arduino programs as probe-able functions
via Serial communication.
Created by Cesar Torres, 25 April 2018
Header File Name: probe.h
Implementation File Name: probe.cpp
*/
#ifndef Probe_h
#define Probe_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
typedef void (*functype)(void);
class Probe {
public:
Probe (char* name, Stream & port, int baud) : port_ (port), name_(name), baud_(baud){ }
void begin();
void enable_api();
void add_api(char, functype);
private:
Stream & port_;
char* myPrefixes;
functype *myFuncs;
char* name_;
int baud_;
int pos_= 0;
char prefix = 0;
char buffer = ' ';
void findCommandEnd();
void api_call(char);
};
#endif