discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Getting values from external program.


From: Jeon
Subject: Re: [Discuss-gnuradio] Getting values from external program.
Date: Mon, 17 Oct 2016 23:45:54 +0900

Not a problem, just an idea came into my head.

Since MAC address (48 bits) can be contained in one long long-type variable, and BT clock (28 bits) can be contained in one integer-type variable in C++, I can just send those values along a stream. If an offset is considered, a smaller data type can be used.

Regards,
Jeon.

On Wed, Oct 12, 2016 at 9:36 PM, Marcus Müller <address@hidden> wrote:

Hi Jeon,

Your use case is not what you'd use controlport for; I think you've got it right: use modtool to create a sync block, but set its number of in- and outputs to zero; override the start() method to spawn a new thread that contains a function which has a loop that executes the external command, publishes a message, and repeat.

Anyway, your requirement:

> One condition is, I need to retrieve contents from "hcitool clock" as fast as the system (GNU Radio) can.

conflicts with the idea of message passing – message passing doesn't allow backpressure, so you'll just flood the message receiver's message input, and that would be useless.

What do you want to do with that data? If it's something that makes sense to be understood as stream of samples, go for the classical GNU Radio source block and write the data to the output stream.


Best regards,

Marcus

On 12.10.2016 14:16, Jeon wrote:
Just get to the point.

I have a Bluetooth dongle connected to my PC. I can read a MAC address and internal clock value by typing `hcitool dev` and `hcitool clock` in command line. You can see demo in link below:


What I want is to make GNU Radio get those values/contents.

Currently, I've planned to make a source block expressed in pseudocode:

    work(args) {
        file_pointer = popen("hcitool dev"); // or "hcitool clock"
        buf = read(fp);
        val = some_char_array_manipulation(buf);
        publish_message(val);
        pclose(file_pointer);
    }

Recently, I found that ControlPort can bridge GNU Radio and other programs. Well, however, I am new to ControlPort (just used for PerfMonitor) and seems more complicated than the pseudocode above.

Which would you recommend? One condition is, I need to retrieve contents from "hcitool clock" as fast as the system (GNU Radio) can.

Regards,
Jeon.


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio



reply via email to

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