From 3ab818306b52d037afd271b237584350d6e3570c Mon Sep 17 00:00:00 2001 From: Nick Piggott Date: Wed, 21 Apr 2021 12:04:27 +0100 Subject: [PATCH 1/3] Reminder to check python2 branch You need to use the python2 branch if you want to use under Python 2 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 46fa626..14fce7f 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ A Python implementation of ETSI TS 102 818 v3.1 Hybrid Radio SPI, including an X This can be used by broadcasters for producing or parsing Hybrid Radio SPI documents over IP and/or DAB, or for general service and programme information interfacing. +Please make sure you select the Python2 branch if you want to use on Python 2. + # TODO * GI Files From ce4bc4685391cdf16c75f89b97462274689f952a Mon Sep 17 00:00:00 2001 From: Nick Piggott Date: Mon, 7 Mar 2022 12:43:44 +0000 Subject: [PATCH 2/3] Update __init__.py Added IntendecAudienceCS to the genre_map Made the first 4 bits of the encoded_genre = 0 --- src/spi/binary/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/spi/binary/__init__.py b/src/spi/binary/__init__.py index 577e932..0c27bf1 100644 --- a/src/spi/binary/__init__.py +++ b/src/spi/binary/__init__.py @@ -361,7 +361,8 @@ def __repr__(self): genre_map = dict( IntentionCS=1, FormatCS=2, - ContentCS=3, # what happened to 4?! + ContentCS=3, + IntendedAudienceCS=4, OriginationCS=5, ContentAlertCS=6, MediaTypeCS=7, @@ -377,6 +378,7 @@ def encode_genre(genre): bits.setall(False) # b0-3: RFU(0) + bits += encode_number(0,4) # b4-7: CS cs = segments[4] if cs in genre_map.keys(): cs_val = genre_map[cs] From 3f82de2fe1b9081853842d288ac4282c9e7a9588 Mon Sep 17 00:00:00 2001 From: Nick Piggott Date: Mon, 7 Mar 2022 14:48:02 +0000 Subject: [PATCH 3/3] Update __init__.py Comment out forced "print" of CData fields --- src/spi/binary/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spi/binary/__init__.py b/src/spi/binary/__init__.py index 0c27bf1..48acd79 100644 --- a/src/spi/binary/__init__.py +++ b/src/spi/binary/__init__.py @@ -92,7 +92,7 @@ def tobytes(self): # encode CData if self.cdata is not None: - print 'rendering cdata: %s' % self.cdata + # print 'rendering cdata: %s' % self.cdata logger.debug('rendering cdata: %s', self.cdata) data += self.cdata.tobytes()