MCPcopy Create free account
hub / github.com/BruceDevices/firmware / loadFromString

Method loadFromString

src/modules/ble/BLE_Suite.cpp:1673–1687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1671}
1672
1673bool DuckyScriptEngine::loadFromString(String script) {
1674 commands.clear();
1675 int start = 0, end = script.indexOf('\n');
1676 while (end != -1) {
1677 String line = script.substring(start, end);
1678 if (!parseLine(line)) return false;
1679 start = end + 1;
1680 end = script.indexOf('\n', start);
1681 }
1682 String line = script.substring(start);
1683 if (line.length() > 0)
1684 if (!parseLine(line)) return false;
1685 scriptLoaded = true;
1686 return true;
1687}
1688
1689std::vector<DuckyCommand> DuckyScriptEngine::getCommands() { return commands; }
1690bool DuckyScriptEngine::isLoaded() { return scriptLoaded; }

Callers 2

injectDuckyScriptMethod · 0.80

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected