btclock_v3/src/lib/price_notify.hpp

30 lines
804 B
C++
Raw Normal View History

2023-11-07 00:11:12 +00:00
#pragma once
#include <Arduino.h>
#include <ArduinoJson.h>
2023-11-30 21:56:50 +00:00
#include <esp_websocket_client.h>
#include "block_notify.hpp"
2023-11-30 21:38:01 +00:00
#include <string>
2023-11-07 00:11:12 +00:00
2023-11-30 21:38:01 +00:00
#include "lib/screen_handler.hpp"
2023-11-07 00:11:12 +00:00
void setupPriceNotify();
2023-11-30 21:38:01 +00:00
void onWebsocketPriceEvent(void *handler_args, esp_event_base_t base,
int32_t event_id, void *event_data);
//void onWebsocketPriceEvent(WStype_t type, uint8_t * payload, size_t length);
2023-11-30 21:38:01 +00:00
void onWebsocketPriceMessage(esp_websocket_event_data_t *event_data);
2023-11-07 00:11:12 +00:00
uint getPrice(char currency);
void setPrice(uint newPrice, char currency);
//void processNewPrice(uint newPrice);
void processNewPrice(uint newPrice, char currency);
2024-07-11 20:08:42 +00:00
bool isPriceNotifyConnected();
2024-01-31 22:45:26 +00:00
void stopPriceNotify();
void restartPriceNotify();
bool getPriceNotifyInit();
uint getLastPriceUpdate(char currency);