-
Notifications
You must be signed in to change notification settings - Fork 50
/
data_tot.go
35 lines (29 loc) · 913 Bytes
/
data_tot.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package astits
import (
"fmt"
"time"
"github.com/asticode/go-astikit"
)
// TOTData represents a TOT data
// Page: 39 | Chapter: 5.2.6 | Link: https://www.dvb.org/resources/public/standards/a38_dvb-si_specification.pdf
// (barbashov) the link above can be broken, alternative: https://dvb.org/wp-content/uploads/2019/12/a038_tm1217r37_en300468v1_17_1_-_rev-134_-_si_specification.pdf
type TOTData struct {
Descriptors []*Descriptor
UTCTime time.Time
}
// parseTOTSection parses a TOT section
func parseTOTSection(i *astikit.BytesIterator) (d *TOTData, err error) {
// Create data
d = &TOTData{}
// UTC time
if d.UTCTime, err = parseDVBTime(i); err != nil {
err = fmt.Errorf("astits: parsing DVB time failed: %w", err)
return
}
// Descriptors
if d.Descriptors, err = parseDescriptors(i); err != nil {
err = fmt.Errorf("astits: parsing descriptors failed: %w", err)
return
}
return
}