Kekatsu-DS/source/networking.h
2025-03-13 03:12:51 +01:00

22 lines
649 B
C

#pragma once
#include <curl/curl.h>
typedef enum {
NETWORKING_INIT_SUCCESS,
NETWORKING_INIT_ERR_WIFI_CONNECT
} NetworkingInitStatus;
typedef enum {
DOWNLOAD_SUCCESS,
DOWNLOAD_STOPPED,
DOWNLOAD_ERR_NOT_OK,
DOWNLOAD_ERR_INIT_FAILED,
DOWNLOAD_ERR_FILE_OPEN_FAILED,
DOWNLOAD_ERR_PERFORM_FAILED
} DownloadStatus;
NetworkingInitStatus initNetworking(void);
DownloadStatus downloadFile(const char* path, const char* url, size_t (*downloadProgressCallback)(void*, curl_off_t, curl_off_t, curl_off_t, curl_off_t));
void stopDownload(void);
DownloadStatus downloadToString(char* result, size_t bufferSize, const char* url);