btclock_v3/src/lib/price_notify.hpp

29 lines
666 B
C++
Raw Normal View History

2023-11-07 01:11:12 +01:00
#pragma once
#include <Arduino.h>
#include <ArduinoJson.h>
#include <WebSocketsClient.h>
2023-11-30 22:38:01 +01:00
#include <string>
2023-11-07 01:11:12 +01:00
2023-11-30 22:38:01 +01:00
#include "lib/screen_handler.hpp"
2023-11-07 01:11:12 +01:00
extern TaskHandle_t priceNotifyTaskHandle;
2023-11-07 01:11:12 +01:00
void setupPriceNotify();
void setupPriceNotifyTask();
void taskPriceNotify(void *pvParameters);
void onWebsocketPriceEvent(WStype_t type, uint8_t * payload, size_t length);
2023-11-07 01:11:12 +01:00
uint getPrice(char currency);
void setPrice(uint newPrice, char currency);
void processNewPrice(uint newPrice, char currency);
2024-07-11 22:08:42 +02:00
bool isPriceNotifyConnected();
2024-01-31 23:45:26 +01:00
void stopPriceNotify();
void restartPriceNotify();
bool getPriceNotifyInit();
uint getLastPriceUpdate(char currency);
void loadStoredPrices();