Hi,
I'm trying to create a simple and effective way of communicating between my mbed and my computer. To accomplish this, I'm using a lightweight version of googles protobuf library (which if you haven't heard of before is a library that in short words can serialize and deserialize structs). This lightweight version is called nanopb, basically protobuf made for microcontrollers with limited capacity in both speed and capacity.
I seem to have some problems which I think I can blame on me not fully understanding how streams work, or even what streams are.
Here is what I've made so far:
http://mbed.org/users/Tomas/code/nanopb_test/
The mbed program starts and it runs the loop successfully one time, and I can see and decode the data in my c# application on my computer. The problem occurs from the second time the loop runs. The data it sends out does not change, even if my code has specified all the variables to increase each time the loop is run. Also, after running the loop a few times, the program stops with the error message "Stream full", which is defined in pb_encode.c line 92.
Do any of you nice people here have any clue what I am doing wrong, or what I'm missing? I'm guessing I need to delete what I've written in my buffer or stream or something in that direction. You can also see I've tested different solutions in my code (they are commented out now, as they did not work). I'm kind of clueless where to go next!
Thanks for reading!
Hi,
I'm trying to create a simple and effective way of communicating between my mbed and my computer. To accomplish this, I'm using a lightweight version of googles protobuf library (which if you haven't heard of before is a library that in short words can serialize and deserialize structs). This lightweight version is called nanopb, basically protobuf made for microcontrollers with limited capacity in both speed and capacity.
I seem to have some problems which I think I can blame on me not fully understanding how streams work, or even what streams are.
Here is what I've made so far: http://mbed.org/users/Tomas/code/nanopb_test/
The mbed program starts and it runs the loop successfully one time, and I can see and decode the data in my c# application on my computer. The problem occurs from the second time the loop runs. The data it sends out does not change, even if my code has specified all the variables to increase each time the loop is run. Also, after running the loop a few times, the program stops with the error message "Stream full", which is defined in pb_encode.c line 92.
Do any of you nice people here have any clue what I am doing wrong, or what I'm missing? I'm guessing I need to delete what I've written in my buffer or stream or something in that direction. You can also see I've tested different solutions in my code (they are commented out now, as they did not work). I'm kind of clueless where to go next!
Thanks for reading!