MCPcopy Create free account
hub / github.com/Marus/cortex-debug / tclCommand

Method tclCommand

src/openocd.ts:390–413  ·  view source on GitHub ↗
(cmd: string)

Source from the content-addressed store, hash-verified

388 private tclCommandQueue: TclCommandQueue[] = [];
389 private tclCommandId: number = 1;
390 private tclCommand(cmd: string): Promise<string> {
391 return new Promise<string>((resolve, reject) => {
392 this.tclStartSocket().then(() => {
393 if (!cmd) {
394 resolve('');
395 return;
396 }
397 const newCmd: TclCommandQueue = {
398 cmd: cmd,
399 id: this.tclCommandId++,
400 resolve: resolve,
401 reject: reject
402 };
403 if (this.args.showDevDebugOutput) {
404 this.session.handleMsg('log', `openocd <- ${newCmd.id}-${cmd}\n`);
405 }
406 this.tclCommandQueue.push(newCmd);
407 this.tclSendData(cmd);
408 }, (e) => {
409 reject(e);
410 return null;
411 });
412 });
413 }
414
415 public tclStartSocket(): Promise<void> {
416 if (this.tclSocket) {

Callers 3

startRttMonitorMethod · 0.95
rttPollStartMethod · 0.95
ctiStopResumeMethod · 0.95

Calls 3

tclStartSocketMethod · 0.95
tclSendDataMethod · 0.95
handleMsgMethod · 0.45

Tested by

no test coverage detected