discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing a list via message


From: address@hidden
Subject: Re: Passing a list via message
Date: Sun, 07 Jan 2024 21:26:18 +0000

Well, it looks like I have to award myself the first nOOb medal in 2024....
The last two simple lines provide the explanation:
            sat_list = list(sats.keys())
            print (sat_list[:5])
            tag = pmt.string_to_symbol("sats")
            value = pmt.to_pmt(sat_list)
            sats_msg = pmt.cons(tag, value)
            self.message_port_pub(pmt.intern('sats'),sats_msg)

            dec_msg = pmt.to_python(value)
            print (dec_msg, type(dec_msg))

prints --> ['AO-07', 'UO-11', 'AO-16', 'LO-19', 'AO-27',.......] <class 'list'>

The Message Debug block, correctly, show the "values" and NOT the values format. My bad!
So, sorry for the noise, I'm going back to my dark cave to dig ....!!! XD
Best regards de Vittorio I3VFJ.

fingerprint: fb5f492a54e016c632c933d3ee4b7e38203c79ca

Inviato con l'email sicura Proton Mail.

Il venerdì 5 gennaio 2024 20:53, vittben@pm.me <vittben@pm.me> ha scritto:

Hello everybody and HNY !
I have almost finished writing (Gnuradio 3.10.1.1) an OOT block, at the moment an Embeeded block, that is able to produce the data needed for satellite tracking (azimuth / elevation / doppler / etc) without having to have an external application, in my case Gpredict.
The block is timed by a Message Strobe and the output is then passed to variables via "Message pair to Var."
Everything works as expected, except for passing a list, via message, that contains the names of the satellites.
This list will then be used in a QT Chooser to select the satellite to track.

This is the code snippet:

            sat_list = list(sats.keys())
            print (sat_list[:5])
            tag = pmt.string_to_symbol("sats")
            value = pmt.to_pmt(sat_list)
            sats_msg = pmt.cons(tag, value)
            self.message_port_pub(pmt.intern('sats'),sats_msg)

and this is the consolle output:

******* from print(sat_list[:5] ********
['AO-07', 'UO-11', 'AO-16', 'LO-19', 'AO-27']

******* MESSAGE DEBUG PRINT ********
(sats . #(AO-07 UO-11 AO-16 LO-19 AO-27 ...... and so on )

It is evident that the message payload "is" a list but all values are not separated by the commas or even superscripts ......Any hints? 
Looking at online documentation I'm not able to find so much examples about passing a list via pmt.
Find in attachment grc file screenshot.
Tnx for any info / suggestion ;-)

Best regards de      Vittorio, I3VFJ


fingerprint: fb5f492a54e016c632c933d3ee4b7e38203c79ca

Inviato con l'email sicura Proton Mail.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]