Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
taiga_parser.cpp
Go to the documentation of this file.
1#include "todo_list.h"
2#include "taiga_parser.h"
3
5static TAIGA_STATE key_state;
6
7static bool id_found = false;
8
12
17
19{
20 if (key.equals("auth_token"))
21 key_state = FOUND_TOKEN;
22
23 if (key_state == W_ID && key.equals("id")) {
24 DEBUG.println("Got id");
25 key_state = FOUND_ID;
26 }
27
29 if (id_found && key.equals("subject"))
30 key_state = FOUND_TASK;
31 }
32}
33
35{
36 if (key_state == FOUND_TOKEN) {
39 key_state = W_ID;
40 }
41
42 if (!id_found && key_state == FOUND_ID) {
43 id_found = true;
44 DEBUG.println(value);
46 key_state = NOT_FOUND;
47 }
48
49 if (id_found && key_state == FOUND_TASK) {
50 // TODO: Figure out a way to directly print to display
51 // Limit to TODO_LIST_MAX_TODO_STR_LENGTH to display properly on screen
52 // DEBUG.printf("TASK: %s\r\n", value.c_str());
56 key_state = NOT_FOUND;
57 }
58}
59
63
67
71
75
char tasks[TODO_LIST_MAX_TASKS][TODO_LIST_MAX_TODO_STR_LENGTH+1]
Definition todo_list.h:14
virtual void key(String key)
virtual void endDocument()
virtual void endArray()
virtual void startArray()
virtual void whitespace(char c)
virtual void endObject()
virtual void startObject()
virtual void startDocument()
virtual void value(String value)
@ NOT_FOUND
#define DEBUG
TAIGA_STATE
@ FOUND_ID
@ FOUND_WEATHER
@ FOUND_TIME
@ FOUND_TASK
@ FOUND_TOKEN
@ NOT_FOUND
@ FOUND_MAIN
@ W_ID
PaperdinkUITodoListTaigaClass Paperdink_TodoListTaiga
#define TODO_LIST_MAX_TODO_STR_LENGTH
Definition todo_list.h:9
#define TODO_LIST_MAX_TASKS
Definition todo_list.h:8