Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
WeatherJsonListener Class Reference

#include <weather_parser.h>

Inheritance diagram for WeatherJsonListener:

Public Member Functions

virtual void whitespace (char c)
 
virtual void startDocument ()
 
virtual void key (String key)
 
virtual void value (String value)
 
virtual void endArray ()
 
virtual void endObject ()
 
virtual void endDocument ()
 
virtual void startArray ()
 
virtual void startObject ()
 

Detailed Description

Definition at line 6 of file weather_parser.h.

Member Function Documentation

◆ endArray()

void WeatherJsonListener::endArray ( )
virtual

Definition at line 49 of file weather_parser.cpp.

50{
51}

◆ endDocument()

void WeatherJsonListener::endDocument ( )
virtual

Definition at line 57 of file weather_parser.cpp.

58{
59}

◆ endObject()

void WeatherJsonListener::endObject ( )
virtual

Definition at line 53 of file weather_parser.cpp.

54{
55}

◆ key()

void WeatherJsonListener::key ( String key)
virtual

Definition at line 17 of file weather_parser.cpp.

18{
19 switch (key_state) {
20 case NOT_FOUND:
21 if (key.equals("dt")) {
22 //if(weather_count == (FORECAST_HOURS/3)){
23 key_state = FOUND_TIME;
24 //}
25 //weather_count++;
26 }
27 break;
28 case FOUND_TIME:
29 if (key.equals("weather"))
30 key_state = FOUND_WEATHER;
31 break;
32 case FOUND_WEATHER:
33 if (key.equals("main"))
34 key_state = FOUND_MAIN;
35 break;
36 }
37}
virtual void key(String key)
@ NOT_FOUND
@ FOUND_WEATHER
@ FOUND_TIME
@ FOUND_MAIN

◆ startArray()

void WeatherJsonListener::startArray ( )
virtual

Definition at line 61 of file weather_parser.cpp.

62{
63}

◆ startDocument()

void WeatherJsonListener::startDocument ( )
virtual

Definition at line 11 of file weather_parser.cpp.

12{
13 //weather_count = 0;
14 key_state = NOT_FOUND;
15}

◆ startObject()

void WeatherJsonListener::startObject ( )
virtual

Definition at line 65 of file weather_parser.cpp.

66{
67}

◆ value()

void WeatherJsonListener::value ( String value)
virtual

Definition at line 39 of file weather_parser.cpp.

40{
41 if (key_state == FOUND_MAIN) {
42 DEBUG.printf("Got weather: %s\r\n", value);
43 strncpy(Paperdink_Weather.weather_string, (char *)value.c_str(), 10);
44 //key_state = NOT_FOUND;
45 key_state = COMPLETED;
46 }
47}
char weather_string[10]
Definition weather.h:13
virtual void value(String value)
#define DEBUG
PaperdinkUIWeatherClass Paperdink_Weather
Definition weather.cpp:195
@ COMPLETED

◆ whitespace()

void WeatherJsonListener::whitespace ( char c)
virtual

Definition at line 7 of file weather_parser.cpp.

8{
9}

The documentation for this class was generated from the following files: