tetra Digest, Vol 9, Issue 3

Sylvain Munaut 246tnt at gmail.com
Sat Sep 24 19:09:05 UTC 2011

On Sat, Sep 24, 2011 at 8:56 PM, Graham Palmer
<graham.palmer69 at yahoo.co.uk> wrote:
> Hi again.
> We have the etsi cdecoder and speech decoder which works fine with sample
> code
> what we need is to link it with real time bitstream from osmo tetra decode.
> I understood this had already been achieved with Dieter's proof of concept
> code. Any chance of  viewing this code even if incomplete ?.

It doesn't apply anymore because of a lot of change in the code since then.

This should save the data in the bursts :
 1) It's completely untested but that's where Dieters POC got the bits
 2) It saves the data as '0' and '1' in a text file, you may need to
change the etsi codec to read that
 3) It will only give out garbage is there is multiple voice channel
at once since it doesn't do any meta data interpretation to isolate
channels and just save anything that's traffic (that was a limitation
of dieter's POC as well)
 4) I'm pretty sure it saves 'packet data' as well which obviously
gives garbage.

diff --git a/src/lower_mac/tetra_lower_mac.c b/src/lower_mac/tetra_lower_mac.c
index 7b62bb4..8a41ccb 100644
--- a/src/lower_mac/tetra_lower_mac.c
+++ b/src/lower_mac/tetra_lower_mac.c
@@ -184,6 +184,15 @@ void tp_sap_udata_ind(enum tp_sap_data_type type,
const uint8_t *bits, unsigned
        DEBUGP("%s %s type4: %s\n", tbp->name, time_str,
                osmo_ubit_dump(type4, tbp->type345_bits));

+       if (tms->cur_burst.is_traffic) {
+               FILE *f = fopen("traffic.out", "ab");
+               for(i = 0; i < 216*2; i++)
+                       fprintf(f, "%d", bits[i]);
+               fclose(f);
+       }
        if (tbp->interleave_a) {
                /* Run block deinterleaving: type-3 bits */
tbp->interleave_a, type4, type3);

More information about the tetra mailing list