psi: added a std template PSI struct for pmt with time and gps descriptors to make things easier

This commit is contained in:
saxon 2018-12-12 17:13:43 +10:30
parent 41d98b4dcd
commit 283689ea6c
1 changed files with 39 additions and 1 deletions

View File

@ -26,8 +26,9 @@ LICENSE
package psi package psi
// Std PSI in struct form without descriptor // Some common manifestations of PSI
var ( var (
// PSI struct to represent basic pat
stdPat = PSI{ stdPat = PSI{
Pf: 0x00, Pf: 0x00,
Tid: 0x00, Tid: 0x00,
@ -47,6 +48,7 @@ var (
}, },
} }
// PSI struct to represent basic pmt without descriptors for time and gps
stdPmt = PSI{ stdPmt = PSI{
Pf: 0x00, Pf: 0x00,
Tid: 0x02, Tid: 0x02,
@ -69,6 +71,42 @@ var (
}, },
}, },
} }
// Std pmt with time and gps descriptors, time and gps fields are zerod out
stdPmtTimeGps = PSI{
Pf: 0x00,
Tid: 0x02,
Ssi: true,
Sl: uint16(0x12),
Tss: &TSS{
Tide: uint16(0x01),
V: 0,
Cni: true,
Sn: 0,
Lsn: 0,
Sd: &PMT{
Pcrpid: 0x0100, // wrong
Pil: 10,
Pd: []Desc{
Desc{
Dt: byte(timeDescTag),
Dl: byte(timeDataSize),
Dd: make([]byte, timeDataSize),
},
Desc{
Dt: byte(gpsDescTag),
Dl: byte(gpsDataSize),
Dd: make([]byte, gpsDataSize),
},
},
Essd: &ESSD{
St: 0x1b,
Epid: 0x0100,
Esil: 0x00,
},
},
},
}
) )
// Std PSI in bytes form // Std PSI in bytes form