serial: slow feed mode - fixes #4901

This commit is contained in:
Eugene Pankov
2021-12-12 12:23:15 +01:00
parent 5f94e84542
commit 08a38bbf61
3 changed files with 15 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ export interface SerialProfileOptions extends StreamProcessingOptions, LoginScri
xon?: boolean
xoff?: boolean
xany?: boolean
slowSend?: boolean
}
export const BAUD_RATES = [
@@ -123,7 +124,13 @@ export class SerialSession extends BaseSession {
}
write (data: Buffer): void {
this.streamProcessor.feedFromTerminal(data)
if (!this.profile.options.slowSend) {
this.streamProcessor.feedFromTerminal(data)
} else {
for (const byte of data) {
this.streamProcessor.feedFromTerminal(Buffer.from([byte]))
}
}
}
async destroy (): Promise<void> {

View File

@@ -77,6 +77,12 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
.title Xany
toggle([(ngModel)]='profile.options.xany')
.form-line
.header
.title Slow feed
.description Sends data one byte at a time
toggle([(ngModel)]='profile.options.slowFeed')
li(ngbNavItem)
a(ngbNavLink) Login scripts
ng-template(ngbNavContent)

View File

@@ -30,6 +30,7 @@ export class SerialProfilesService extends ProfileProvider<SerialProfile> {
inputNewlines: null,
outputNewlines: null,
scripts: [],
slowSend: false,
},
}