btclock_v3/src/lib/price_notify.hpp

29 lines
No EOL
666 B
C++

#pragma once
#include <Arduino.h>
#include <ArduinoJson.h>
#include <WebSocketsClient.h>
#include <string>
#include "lib/screen_handler.hpp"
extern TaskHandle_t priceNotifyTaskHandle;
void setupPriceNotify();
void setupPriceNotifyTask();
void taskPriceNotify(void *pvParameters);
void onWebsocketPriceEvent(WStype_t type, uint8_t * payload, size_t length);
uint getPrice(char currency);
void setPrice(uint newPrice, char currency);
void processNewPrice(uint newPrice, char currency);
bool isPriceNotifyConnected();
void stopPriceNotify();
void restartPriceNotify();
bool getPriceNotifyInit();
uint getLastPriceUpdate(char currency);
void loadStoredPrices();