On Mon, Aug 31, 2015 at 11:28 AM, Washbourne, Logan <
lwas...@ostatemail.okstate.edu> wrote:

> Tom,
>
> Thanks for the reply!
>
> So unfortunately I started using git after I found out that the code
> wasn't entering general_work. It was actually the reason I started using
> git, so this wouldn't happen again haha. Thanks for the temp files tip,
> I'll try to fix that today.
>
> For the blocks, I think I just want them to pass messages. I'm trying to
> model it directly after the ChatApp tutorial, and I'm pretty sure that's
> what the send and receive blocks in that project were doing.
>
> Is this not a good practice or infeasible?
>
> Logan Washbourne
> Electrical Engineering Graduate Student
> (Electromagnetics)
>


Hi Logan,

Have another look at the Python code you were copying from. The
chat_sanitizer just creates a message output port and we call it's
post_message from the main app when a user is ready to post. There's
nothing automatic about it, so no work function to be called. The
chat_receiver code just waits until a message is posted to it, at which
point it wakes up and fires off its handle_msg function to process the
message.

What you're trying to do is feasible, but I think you'll need to understand
the message passing system in the scheduler instead of the data streaming
model to get a better handle on it.

Tom




> On Mon, Aug 31, 2015 at 8:44 AM, Tom Rondeau <t...@trondeau.com> wrote:
>
>> On Fri, Aug 28, 2015 at 12:49 PM, Washbourne, Logan <
>> lwas...@ostatemail.okstate.edu> wrote:
>>
>>> Hello All,
>>>
>>> I recently rewrote the Chat Sanitize and Chat Receiver blocks from the
>>> Tutorial module(Example 5) in C++. I did this because I wanted to add an
>>> acknowledgment feature into the blocks in order to add some robustness to
>>> it(I'm not sure yet if the chat example will lend itself to being robust
>>> but it was the starting point I chose). The problem arose when I added an
>>> input port to the Text Sanitize block and added an output to the Chat
>>> Receiver block and connected them together. Instead of a linear program I
>>> now had a loop of a program. I did something wrong because now the Text
>>> Sanitize block wasn't outputting anything, so I commented out the input
>>> code for Text Sanitize and the output code for Chat Receiver. I went to
>>> retest the program to see if it behaved just like Example 5(which it was
>>> before I started adding on the acknowledgment bits) but now Text Sanitize
>>> wasn't outputting anything still.
>>>
>>> I tried putting some cout's in the general _work function where the
>>> message publishing code is and I have determined that it's not even
>>> entering the general_work function.
>>>
>>> Does anyone have any thoughts on the matter? I must have changed
>>> something when I commented out the input portion of the Text_Sanitize code
>>> but for the life of me I can't figure out what it is. I have even since
>>> made two new blocks to try and redo the functionality of Text Sanitize but
>>> the same problem still persists.
>>>
>>
>>
>> So this will be a good lesson in using git! It's good to keep small,
>> quantified changes in git so that you know where you are versus where you
>> started when making a change. "git diff" is your friend here. Lots of ways
>> to use this tool to help in your development cycle.
>>
>> (Also, looking at your git repo, you've checked in the '~' temp files
>> from your editor [emacs I assume]. You don't want any temp or
>> auto-generated files in a git repository; just stuff that you've created
>> that needs to be tracked.)
>>
>> The problem is that this block is designed only to output messages, not a
>> data stream. You can see in the constructor that the io_signature is using
>> (0, 0, 0) for both inputs and outputs. The scheduler doesn't recognize this
>> block in the stream and so never things to call the general_work. The
>> original blocks you are referring to only have message interfaces.
>>
>> Hope this helps get you in the right direction.
>>
>>
>> Tom
>>
>>
>>
>>
>>> My code can be found at: https://github.com/loganwashbourne/Thesis.git
>>>
>>> The juicy files are in the Thesis/OOT/gr-ACK/lib folder.
>>>
>>> There might be some profanity in the commit messages, it was a stressful
>>> day.
>>>
>>> I appreciate your time,
>>>
>>> Logan Washbourne
>>> Electrical Engineering Graduate Student
>>> (Electromagnetics)
>>>
>>>
>>> _______________________________________________
>>> Discuss-gnuradio mailing list
>>> Discuss-gnuradio@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>>
>>>
>>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to