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
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
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,
},
}