Commit 74ba9630 authored by Michael Bonani's avatar Michael Bonani
Browse files

add flash to js API

parent d53b1f52
......@@ -600,6 +600,14 @@ export interface INode extends IBasicNode {
*/
runProgram() : Promise<any> ;
/** Flash the code currently loaded on the vm to the flash memory
* The device must be locked & ready before calling this function
*
* @throws [[mobsya.fb.Error]]
* @see [[lock]]
*/
flashProgram() : Promise<any> ;
/**
* Set the values of the specified variables.
* Unlike [[setSharedVariables]], existing variables
......@@ -774,6 +782,11 @@ export class Node extends BasicNode implements INode {
return this._client._set_vm_execution_state(this._id, mobsya.fb.VMExecutionStateCommand.Run);
}
flashProgram() {
return this._client._set_vm_execution_state(this._id,
mobsya.fb.VMExecutionStateCommand.WriteProgramToDeviceMemory);
}
setVariables(map) {
return this._client._set_variables(this._id, map);
}
......@@ -1410,4 +1423,4 @@ class Client implements IClient {
*/
export function createClient(url : string) : IClient {
return new Client(url)
}
\ No newline at end of file
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment