MCPcopy Create free account
hub / github.com/FastLED/FastLED / getUiUpdateData

Function getUiUpdateData

src/platforms/wasm/js_bindings.cpp.hpp:233–247  ·  view source on GitHub ↗

* Pure C++ UI Data Export Function * Exports UI changes as JSON for JavaScript processing */

Source from the content-addressed store, hash-verified

231 * Exports UI changes as JSON for JavaScript processing
232 */
233EMSCRIPTEN_KEEPALIVE void* getUiUpdateData(int* dataSize) {
234 // Export basic UI update structure
235 fl::json doc = fl::json::object();
236 doc.set("event", "ui_update");
237 doc.set("timestamp", static_cast<int>(fl::millis()));
238
239 fl::string jsonBuffer = doc.to_string();
240
241 // Allocate and return data pointer
242 char* buffer = (char*)fl::malloc(jsonBuffer.length() + 1);
243 fl::strcpy(buffer, jsonBuffer.c_str());
244 *dataSize = jsonBuffer.length();
245
246 return buffer;
247}
248
249/**
250 * Canvas Size Setting Function - Push-based notification to JavaScript

Callers

nothing calls this directly

Calls 7

strcpyFunction · 0.85
millisFunction · 0.70
mallocFunction · 0.50
setMethod · 0.45
to_stringMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected