-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-parse-command.cpp
40 lines (31 loc) · 1.06 KB
/
example-parse-command.cpp
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
#if defined(PIO_EXAMPLE_PARSE_COMMAND)
#include "example-parse-command.h"
#include <easycomm-parser-types-ctors.h>
#include <easycomm-parser.h>
/**
* This example aims to show how the line-tokenizer is applied to receive data from rotctl
* and how to reply to each command that was received in the same line.
*/
// -------------------------------------------------------------------------------------------------
void setup() {}
// -------------------------------------------------------------------------------------------------
void loop()
{
EasycommData result;
easycommData(&result);
if(easycommParseCommand("AZ000.1 EL000.0 UP000000000 UUU DN000000000 DDD", &result, EasycommParserStandard1))
{
// standard 1 command was parsed
}
easycommData(&result);
if(easycommParseCommand("AZ100", &result, EasycommParserStandard2))
{
// standard 2 command was parsed
}
easycommData(&result);
if(easycommParseCommand("VU50", &result, EasycommParserStandard23))
{
// standard 3 command was parsed
}
}
#endif