[Mono-dev] Question on SerialPort - Serial.c

Daniel Lo Nigro lists at dan.cx
Sun Jan 13 21:59:39 UTC 2013


>
> What would be the best way to offer this version to my users so they get
> and install the 2.11.4.xxx?

Generally these would be distributed as patch files. People would download
the Mono source from the Mono site, then apply your patch, and then compile
it. Having said that...

Just for reference, the standard Windows SerialPort driver accepts
> 500,000bauds, so probably Mono should do as well.

Any difference between Microsoft's .NET implementation and Mono is
considered a bug in Mono. If Mono doesn't support it but Microsoft's does,
you should submit it to Mono's official code base. Create a bug in
Xamarin's Bugzilla, and then send a pull request on Github referencing the
bug number. Does Microsoft's implementation accept *any* baud rate, or are
there only some that it accepts that Mono doesn't? If Microsoft's accepts
any then maybe the baud rate validation should be moved from Mono.

Another (albeit generic) question is from a build perspective. When I
> update the Serial.c and do a <make>, I need to do a <make install> for the
> library to be installed. All that is very time consuming, is there any
> recommended way to update on the serial library update on the system only,
> rather than having to make and install everything again and again with
> every change?

You should be able to run "make" and "make install" in the directory of the
file you're modifying, and that should compile and install just that
component.



On Mon, Jan 14, 2013 at 5:21 AM, <foros at arocholl.com> wrote:

> **
>
> Hi,
>
> My first post here. Let me introduce myself: I am a 25+ experienced
> C/C++/C# DOS/Windows developer so more than willing to help on this
> outstanding project with my 2 cents. Some experience on Linux and getting
> some in Mac OS as well, but my real skills are on Windows. Please forgive
> me by asking perhaps something obvious to an experienced Linux developer, I
> am happy to be pointed to a specific How-to or whatever knowledge base
> that can describe my question. As a long time user of distribution lists, I
> always do my homework before posting a question.
>
> I have been using Mono for some time, but never had the need or time to do
> changes to the foundation myself.
>
> I am using Mono 2.11.4 on Ubuntu 12.04, that is my setup for questions
> below. My serial device is a Silabs USB-COM driver CP2102.
>
> My specific question is about SerialPort class as well as some basic
> rules about how to deal with custom changes:
>
> ·       I found SerialPort class rejects a custom baudrate I need
> (500,000 bauds – 500Kbaud). Looking into the source code I found the
> limitation to be in Serial.c file, so I added the B500000 and works fine.
> So I have now a 2.11.4.xxxx that is my specific version that resolves a
> problem I have. What would be the best way to offer this version to my
> users so they get and install the 2.11.4.xxx? My first thought was to
> deliver a .tar source code file structure as the official website does, so
> every user compiles and install this updated version. On the other hand, it
> would be easier for users to get the baseline 2.11.4 and update the
> specific library only. I am not sure either if distributing my own source
> code file structure is against any of the Mono development recommendations.
> Any general suggestion on how to distribute these changes so they are
> available to users of my software are welcome.
>
> ·       Should I submit this fix/enhancement to the GIT source code base
> or is this kind of too custom for baseline branch? Just for reference, the
> standard Windows SerialPort driver accepts 500,000bauds, so probably Mono should
> do as well. Furthermore, the underlying Linux serial COM driver has no
> problem with this custom baudrate as long as the device supports it.
>
> ·       Another (albeit generic) question is from a build perspective.
> When I update the Serial.c and do a <make>, I need to do a <make install>
> for the library to be installed. All that is very time consuming, is there
> any recommended way to update on the serial library update on the system
> only, rather than having to make and install everything again and again
> with every change? I am probably missing something obvious…
>
> ·       A second problem I have on SerialPort class is apparently the
> timeout parameter is not being honored. The SerialPort class changes the
> timeout to the value I set, but the underlying Linux driver shows <dmesg>
> with no changes in timeout. For instance if I set timeout=5000 for a 5sec
> timeout, the software goes back immediately (as it apparently uses the
> 100ms default) rather than waiting up to 5sec to get back with a timeout
> error. So my question is if this is a known limitation and anyone has a fix
> I could use. I saw nothing on the archive devel list nor the bugzilla. Any
> help appreciated.
>
> Best regards,
>
> Ariel Rocholl
>
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130114/a8861e05/attachment-0001.html>


More information about the Mono-devel-list mailing list