Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSL packages without name #719

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/sources/SimplyLive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ export class SimplyLivePSource extends TallyInput {
this.server.bind(port);

this.server.on('message', (message) => {
if (message.length > 12) {
if (message.length >= 12) {
let tallyobj: any = TSL5DataParser.parseTSL5Data(message)
this.renameAddress(tallyobj.INDEX[0].toString(), tallyobj.INDEX[0].toString(), tallyobj.TEXT.toString().trim());

if (tallyobj.TEXT !== "") {
this.renameAddress(tallyobj.INDEX[0].toString(), tallyobj.INDEX[0].toString(), tallyobj.TEXT.toString().trim());
}

let inPreview: number = 0;
let inProgram: number = 0;
Expand Down
8 changes: 5 additions & 3 deletions src/sources/TSL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,19 @@ export class TSL5DataParser {
var LENGTH = jspack.Unpack("<H", data, cursor)
cursor += _LENGTH;

tallyobj.TEXT = jspack.Unpack("s".repeat(LENGTH), data, cursor)
tallyobj.TEXT = jspack.Unpack("s".repeat(LENGTH), data, cursor).join("")
return tallyobj;
}
}

class TSL5Base extends TallyInput {
protected processTSL5Tally(data) {
if (data.length > 12) {
if (data.length >= 12) {
let tallyobj: any = TSL5DataParser.parseTSL5Data(data)

this.renameAddress(tallyobj.INDEX[0].toString(), tallyobj.INDEX[0].toString(), tallyobj.TEXT.toString().trim());
if (tallyobj.TEXT !== "") {
this.renameAddress(tallyobj.INDEX[0].toString(), tallyobj.INDEX[0].toString(), tallyobj.TEXT.toString().trim());
}

let inPreview = 0;
let inProgram = 0;
Expand Down
Loading