handles messages from other sw components
- Parameters
-
Reimplemented from AppBaseClass.
Definition at line 1467 of file AppWren.cpp.
1468 if(0 == strncmp(message,
"demo",strlen(
"demo"))){
1469 Serial.println(F(
"M AppWren::MessageHandler: Demo Mode Request"));
1474 if(sender->
isName(
"SCI")){
1475 if(0 == strncmp(message,
"WREN_SCRIPT_EXECUTE",strlen(
"WREN_SCRIPT_EXECUTE"))) {
1476 Serial.println(F(
"M AppWren::MessageHandler: WREN_SCRIPT_COMPILE -> compileOnly = false"));
1479 }
else if(0 == strncmp(message,
"WREN_SCRIPT_COMPILE",strlen(
"WREN_SCRIPT_COMPILE"))) {
1480 Serial.println(F(
"M AppWren::MessageHandler: WREN_SCRIPT_EXECUTE -> compileOnly = true"));
1483 }
else if(0 == strncmp(message,
"WREN_SCRIPT_SAVE",strlen(
"WREN_SCRIPT_SAVE"))){
1489 Serial.print(F(
"M AppWren::MessageHandler: WREN_SCRIPT_SAVE as: "));
1500 file.write(message,strlen(message));
1503 Serial.println(F(
"M AppWren::MessageHandler: WREN_SCRIPT_SAVE complete"));
1506 Serial.println(F(
"M AppWren::MessageHandler: Compiling the received script"));
1509 Serial.println(F(
"M ************************************************************************"));
1510 Serial.println(F(
"M AppWren::MessageHandler: Restarting the VM"));
1519 Serial.println(F(
"M AppWren::MessageHandler: Loading the received script"));
1525 Serial.println(F(
"M AppWren::MessageHandler: request complete"));
1526 Serial.println(F(
"M ************************************************************************"));
1533 wrenEnsureSlots(
vm, 4);
1535 wrenSetSlotString(
vm, 1, sender->
name);
1536 wrenSetSlotString(
vm, 2, message);
bool isName(const char *name_string)
Compares the name_string to the app class instance name (string)
char name[MAX_NAME_LENGTH]
char wren_module_name[MAX_TEXT_LENGTH]
void FLASHMEM rebootRequest(const char *script_name)
c callback support to allow wren scripts to request a VM reboot & script load
bool FASTRUN loadScript(const char *script)
runs the script in the VM
WrenHandle * h_messageHandler
bool isWrenResultOK(WrenInterpretResult res)
bool enable_call_forwarding
void getFocus()
Get the Focus object.
void FLASHMEM restartVM()
shutsdown then starts the VM
References compile_only, enable_call_forwarding, getFocus(), h_messageHandler, h_slot0, AppBaseClass::has_focus, AppBaseClass::isName(), isWrenResultOK(), loadScript(), AppBaseClass::name, rebootRequest(), restartVM(), returnFocus(), save_module, AppBaseClass::sd, vm, and wren_module_name.