* Pure C++ Strip Update Data Export Function * Exports strip update data as JSON for specific strip */
| 201 | * Exports strip update data as JSON for specific strip |
| 202 | */ |
| 203 | EMSCRIPTEN_KEEPALIVE void* getStripUpdateData(int stripId, int* dataSize) { |
| 204 | // Generate basic strip update JSON |
| 205 | fl::json doc = fl::json::object(); |
| 206 | doc.set("strip_id", stripId); |
| 207 | doc.set("event", "strip_update"); |
| 208 | doc.set("timestamp", static_cast<int>(fl::millis())); |
| 209 | |
| 210 | fl::string jsonBuffer = doc.to_string(); |
| 211 | |
| 212 | // Allocate and return data pointer |
| 213 | char* buffer = (char*)fl::malloc(jsonBuffer.length() + 1); |
| 214 | fl::strcpy(buffer, jsonBuffer.c_str()); |
| 215 | *dataSize = jsonBuffer.length(); |
| 216 | |
| 217 | return buffer; |
| 218 | } |
| 219 | |
| 220 | /** |
| 221 | * Pure C++ Strip Addition Notification |