mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-10 21:47:04 +03:00
make it fit in allocated space
This commit is contained in:
@@ -18,6 +18,13 @@ std::string ApResolve::fetchFirstApAddress()
|
||||
std::string_view responseStr = request->body();
|
||||
|
||||
// parse json with nlohmann
|
||||
#if BELL_ONLY_CJSON
|
||||
cJSON* json = cJSON_Parse(responseStr.data());
|
||||
auto ap_string = std::string(cJSON_GetArrayItem(cJSON_GetObjectItem(json, "ap_list"), 0)->valuestring);
|
||||
cJSON_Delete(json);
|
||||
return ap_string;
|
||||
#else
|
||||
auto json = nlohmann::json::parse(responseStr);
|
||||
return json["ap_list"][0];
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user