Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 5e142af

Browse files
authored
fix send serial message (#1356)
1 parent b8cb044 commit 5e142af

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/serialmonitor/serialportctrl.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,11 @@ export class SerialPortCtrl {
111111

112112
public sendMessage(text: string): Promise<void> {
113113
return new Promise((resolve, reject) => {
114-
if (!text || !this._currentSerialPort || !this.isActive) {
114+
if (!text || !this.isActive) {
115115
resolve();
116116
return;
117117
}
118-
119-
this._currentSerialPort.write(text + "\r\n", (error) => {
118+
this._child.stdin.write(`{"cmd": "write", "payload": "${text}"}\n`, (error) => {
120119
if (!error) {
121120
resolve();
122121
} else {

0 commit comments

Comments
 (0)