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

#include <crypto_parser.h>

Inheritance diagram for CryptoJsonListener:

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 crypto_parser.h.

Member Function Documentation

◆ endArray()

void CryptoJsonListener::endArray ( )
virtual

Definition at line 39 of file crypto_parser.cpp.

40{
41}

◆ endDocument()

void CryptoJsonListener::endDocument ( )
virtual

Definition at line 47 of file crypto_parser.cpp.

48{
49}

◆ endObject()

void CryptoJsonListener::endObject ( )
virtual

Definition at line 43 of file crypto_parser.cpp.

44{
45}

◆ key()

void CryptoJsonListener::key ( String key)
virtual

Definition at line 16 of file crypto_parser.cpp.

17{
18 if (key.equals("usd"))
19 key_state = FOUND_PRICE;
20 else if (key.equals("usd_24h_change"))
21 key_state = FOUND_CHANGE;
22}
virtual void key(String key)
@ FOUND_CHANGE
@ FOUND_PRICE

◆ startArray()

void CryptoJsonListener::startArray ( )
virtual

Definition at line 51 of file crypto_parser.cpp.

52{
53}

◆ startDocument()

void CryptoJsonListener::startDocument ( )
virtual

Definition at line 11 of file crypto_parser.cpp.

12{
13 key_state = NOT_FOUND;
14}
@ NOT_FOUND

◆ startObject()

void CryptoJsonListener::startObject ( )
virtual

Definition at line 55 of file crypto_parser.cpp.

56{
57}

◆ value()

void CryptoJsonListener::value ( String value)
virtual

Definition at line 24 of file crypto_parser.cpp.

25{
26 if (key_state == FOUND_PRICE) {
28 //price[CRYPTO_MAX_CHANGE_LENGTH_STR] = '\0';
29 Serial.printf("Price: %s\r\n", Paperdink_Crypto.price);
30 key_state = NOT_FOUND;
31 } else if (key_state == FOUND_CHANGE) {
33 //change[CRYPTO_MAX_CHANGE_LENGTH_STR] = '\0';
34 Serial.printf("Change: %s\r\n", Paperdink_Crypto.change);
35 key_state = NOT_FOUND;
36 }
37}
virtual void value(String value)
char change[CRYPTO_MAX_CHANGE_LENGTH_STR]
Definition crypto.h:23
char price[CRYPTO_MAX_PRICE_LENGTH_STR]
Definition crypto.h:22
PaperdinkUICryptoClass Paperdink_Crypto
Definition crypto.cpp:124
#define CRYPTO_MAX_PRICE_LENGTH
Definition crypto.h:9
#define CRYPTO_MAX_CHANGE_LENGTH
Definition crypto.h:13

◆ whitespace()

void CryptoJsonListener::whitespace ( char c)
virtual

Definition at line 7 of file crypto_parser.cpp.

8{
9}

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