Skip to content

Commit

Permalink
Fixed #37, Wrong char encoding in 'run current file' operation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulober committed Dec 20, 2022
1 parent 40b4131 commit 4d31c22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/connections/pyserial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default class PySerial implements ConnectionTarget {
}

public async send(mssg: string, drain: boolean = true): Promise<void> {
let data = Buffer.from(mssg, 'binary');
let data = Buffer.from(mssg, 'utf8');

await this.streamWrite(data);

Expand Down
4 changes: 2 additions & 2 deletions src/rp2/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ export default class Sync {
await this.startSync(oncomplete, 'send', files);
}

public async startReceive(oncomplete: Function, files: string) {
public async startReceive(oncomplete: Function, files?: string) {
await this.settings.refresh();
await this.startSync(oncomplete, 'receive', files);
}

private async startSync(oncomplete: Function, method: string, files: string) {
private async startSync(oncomplete: Function, method: string, files?: string) {
this.logger.info('Start sync method ' + method);
this.fails = 0;
this.method = method;
Expand Down
8 changes: 4 additions & 4 deletions src/serialDolmatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class SerialDolmatcher extends EventEmitter {
private outputHidden: boolean;
private status: number;
private _fileSystems: any;
private syncObj: any;
private syncObj?: Sync;
private ftpServer?: FtpSrv;
private _fs?: FtpFileSystem;
private firstTimeStart?: boolean;
Expand Down Expand Up @@ -479,7 +479,7 @@ export default class SerialDolmatcher extends EventEmitter {
if (this.isSynchronizing()) {
this.terminal?.writeln('An error occurred: ' + message);
this.logger.warning('Synchronizing, stopping sync');
await this.syncObj.stop();
await this.syncObj?.stop();
}
} else {
this.terminal?.writeln(
Expand Down Expand Up @@ -712,7 +712,7 @@ export default class SerialDolmatcher extends EventEmitter {
await this.syncObj.startReceive(cb);
} else {
try {
await this.syncObj.startSend(cb, files);
await this.syncObj?.startSend(cb, files);
} catch (e) {
console.log(e);
}
Expand Down Expand Up @@ -753,7 +753,7 @@ export default class SerialDolmatcher extends EventEmitter {
let type = this.synchronizeType === 'receive' ? 'download' : 'upload';
this.terminal?.writeln('Stopping ' + type + '....');

await this.syncObj.stop();
await this.syncObj?.stop();
this.stopOperation();
}
}
Expand Down

0 comments on commit 4d31c22

Please sign in to comment.