Make wifi curl callback a static member
This commit is contained in:
parent
f59ec8e67b
commit
c4b717abd3
@ -120,7 +120,7 @@ void wifi::update_texture(){
|
||||
CURLcode res;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, WIFI_PUBLIC_IP_URL);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
|
||||
dashboard::panel::curl_callback);
|
||||
dashboard::panel::wifi::curl_callback);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &public_ip);
|
||||
res = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
@ -156,7 +156,7 @@ void wifi::initTexture(){
|
||||
}
|
||||
}
|
||||
|
||||
size_t dashboard::panel::curl_callback(void* contents, size_t size,
|
||||
size_t dashboard::panel::wifi::curl_callback(void* contents, size_t size,
|
||||
size_t nmemb, void* userp){
|
||||
((std::string*)userp)->append((char*)contents, size * nmemb);
|
||||
return size * nmemb;
|
||||
|
@ -22,6 +22,8 @@ namespace dashboard::panel {
|
||||
wifi();
|
||||
~wifi();
|
||||
|
||||
static size_t curl_callback(void*, size_t, size_t, void*);
|
||||
|
||||
void draw();
|
||||
private:
|
||||
void update();
|
||||
@ -29,7 +31,6 @@ namespace dashboard::panel {
|
||||
void initTexture();
|
||||
};
|
||||
|
||||
size_t curl_callback(void*, size_t, size_t, void*);
|
||||
}
|
||||
|
||||
#include "../board.hpp"
|
||||
|
Loading…
Reference in New Issue
Block a user