comparison Platforms/Wasm/Defaults.cpp @ 537:d785ee57bd95 dev

Merge from bgo-commands-codegen
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 19 Mar 2019 14:43:46 +0100
parents 79bb0a02d1cc
children 70992b38aa8a
comparison
equal deleted inserted replaced
533:1c5104a6f7e4 537:d785ee57bd95
355 } 355 }
356 printf("This Stone application does not have a Web Adapter"); 356 printf("This Stone application does not have a Web Adapter");
357 return NULL; 357 return NULL;
358 } 358 }
359 359
360 const char* EMSCRIPTEN_KEEPALIVE SendCommandToStoneApplication(const char* message)
361 {
362 static std::string output; // we don't want the string to be deallocated when we return to JS code so we always use the same string (this is fine since JS is single-thread)
363
364 printf("SendCommandToStoneApplication\n");
365 printf("%s", message);
366
367 if (applicationWasmAdapter.get() != NULL) {
368 applicationWasmAdapter->HandleCommandFromWeb(output, std::string(message));
369 return output.c_str();
370 }
371 printf("This Stone application does not have a Web Adapter");
372 return NULL;
373 }
374
375 #ifdef __cplusplus 360 #ifdef __cplusplus
376 } 361 }
377 #endif 362 #endif