ERIS CORE

◆ loadScript()

bool FASTRUN AppWren::loadScript ( const char *  script)
inline

runs the script in the VM

Parameters
script
Returns
true wrenInterpret result is ok
false wrenInterpret result is not ok

Definition at line 152 of file AppWren.h.

152  {
153  const char* module = "main";
154  bool res;
155  res = isWrenResultOK(wrenInterpret(vm, module, script));
156  if(res){
157  getWrenHandles();
158  wrenSetSlotHandle(vm, 0, h_slot0);//App
159  }
160 
162  sci->printf("M AppWren:loadScript: Loading script (size: %d bytes)\n",strlen(script));
163  if (res){
164  sci->println(F("M AppWren::loadScript: OK"));
165  }else sci->println(F("M AppWren::loadScript: NOT OK"));
166  sci->sendLZ4Message();
167  }
168  return res;
169  }
SvcSerialCommandInterface * sci
Definition: AppBaseClass.h:39
bool isWrenResultOK(WrenInterpretResult res)
Definition: AppWren.h:543
void getWrenHandles()
VM post module load support function creates/updates the Wren embedded call handles.
Definition: AppWren.cpp:1670
WrenVM * vm
Definition: AppWren.h:780
WrenHandle * h_slot0
Definition: AppWren.h:781
bool requestStartLZ4Message()
request to start a lz4 compressed message starts the message and returns true if available returns f...
void sendLZ4Message()
Calling this function signals the end of a compressed message. The txBuffer contents are lz4 compres...

References getWrenHandles(), h_slot0, isWrenResultOK(), SvcSerialCommandInterface::requestStartLZ4Message(), AppBaseClass::sci, SvcSerialCommandInterface::sendLZ4Message(), and vm.

Referenced by messageHandler(), render(), and vmConstructor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: