NetDuino: Serial TX to board fails

classic Classic list List threaded Threaded
24 messages Options
12
sweetlilmre sweetlilmre
Reply | Threaded
Open this post in threaded view
|

Re: NetDuino: Serial TX to board fails

Mike King wrote
You might want to check out my patch.  Bogdan said he will revert back
to it for master.  It fixes the things listed below.

https://github.com/elua/elua/blob/1822ee1572e63ec033447d918b58466b36dba342/rfs_server_src/serial_win32.c

*The function ser_open could leak memory on failure.
*Forgot to initialize the DCBlength field of the DCB structure.
*Forgot to initialize the OVERLAPPED structure in the ser_read function.
*Initialized the OVERLAPPED structure in the ser_select_byte function
without regard to whether or not an asynchronous read operation is in
progress.
*I/O cancellation is done synchronously when it could be done asynchronously.
*The function ser_read will not update the dest buffer when the
fWaitingOnRead flag is set.  This also affects the ser_read_byte
function.
Hi,

I applied your patch and it seems to fix the issue! Brilliant stuff.
The only change necessary was moving the declaration of dwRes to the top of ser_select_byte() so that it compiles under VS2010.

Being a GIT noob I'm a little lost as to where your patch resides and the whole apply to master bit?
Do I just need to wait and git pull to get this when its applied?

Thanks
-(e)
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: NetDuino: Serial TX to board fails

Hi,

On Sat, May 7, 2011 at 6:50 AM, sweetlilmre <[hidden email]> wrote:

Mike King wrote:
>
> You might want to check out my patch.  Bogdan said he will revert back
> to it for master.  It fixes the things listed below.
>
> https://github.com/elua/elua/blob/1822ee1572e63ec033447d918b58466b36dba342/rfs_server_src/serial_win32.c
>
> *The function ser_open could leak memory on failure.
> *Forgot to initialize the DCBlength field of the DCB structure.
> *Forgot to initialize the OVERLAPPED structure in the ser_read function.
> *Initialized the OVERLAPPED structure in the ser_select_byte function
> without regard to whether or not an asynchronous read operation is in
> progress.
> *I/O cancellation is done synchronously when it could be done
> asynchronously.
> *The function ser_read will not update the dest buffer when the
> fWaitingOnRead flag is set.  This also affects the ser_read_byte
> function.
>

Hi,

I applied your patch and it seems to fix the issue! Brilliant stuff.
The only change necessary was moving the declaration of dwRes to the top of
ser_select_byte() so that it compiles under VS2010.

Being a GIT noob I'm a little lost as to where your patch resides and the
whole apply to master bit?
Do I just need to wait and git pull to get this when its applied?

I merged both Mike's patch and your patch. Please pull again and let me know if it still works for you, as I had to merge both manually and some errors might have occured in the process.

Best,
Bogdan


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Mike King Mike King
Reply | Threaded
Open this post in threaded view
|

Re: NetDuino: Serial TX to board fails

In reply to this post by sweetlilmre
> I applied your patch and it seems to fix the issue! Brilliant stuff.

Thanks

> Being a GIT noob I'm a little lost as to where your patch resides and the
> whole apply to master bit?

I'm still learning git as well.

> Do I just need to wait and git pull to get this when its applied?

Bogdan has done the merge
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
sweetlilmre sweetlilmre
Reply | Threaded
Open this post in threaded view
|

Re: NetDuino: Serial TX to board fails

In reply to this post by BogdanM
BogdanM wrote
I merged both Mike's patch and your patch. Please pull again and let me know
if it still works for you, as I had to merge both manually and some errors
might have occured in the process.

Best,
Bogdan
Hi,

It all seems to be working fine, I tested mux in both modes (compiling from scons and vs2010) and it all seems to work well.

-(e)
12