[PATCH] libdivecomputer - custom implementation for serial communication

Claudiu Olteanu olteanu.vasilica.claudiu at gmail.com
Sat Jun 27 06:01:05 PDT 2015


Hi there,

I did the modifications we discussed. You can find attached some new
patches. I hope that now they are grouped correctly.

For the moment I updated only the HW_OSTC3 family to use the custom
serial implementation.

These patches can be applied on the origin/Subsurface-testing branch.
Please let me know if the old native serial communication doesn't work
after you apply them.

I will send you a new patch for the Subsurface project to work with the
new design of the *dc_serial_t* structure.

Claudiu

On Fri, Jun 26, 2015 at 11:29 PM, Claudiu Olteanu <
olteanu.vasilica.claudiu at gmail.com> wrote:

>
>
>> One way to do this would be to copy Jef's copyright line and add yours
>> below:
>>
>>  * Copyright (C) 2008 Jef Driesen
>>  * Copyright (C) 2015 Claudiu Olteanu
>>
>
> Thanks for the information. Now it is more clear for me.
>
>
>> > I think that I should remove the fd, timeout and context fields and
>> > to add a serial_t *port member
>>
>> See what I wrote above. I'm fine with other. I seem to remember that Jef
>> in general prefers the structures with common parts in front that can
>> simply be passed around and then work as expected...
>>
>
> This is good to know. I believe that it would be easier to use a pointer
> to
> a *serial_t* structure since all the functions expect to receive a
> pointer.
> In the old implementation, all structures which are used to represent
> a device contain a member which is a pointer to a *serial_t* structure.
> Therefore I believe that this is more in line with the old design.
>
>
>> > > This feels like it should have been squashed into the first patch...
>> >
>> > Yes, you are right. I forgot to add it in the beginning.
>>
>> As a general rule I do NOT enforce this. I am MUCH happier when people do
>> small patches and commit often. But since you were reworking the patches
>> anyway (and will be reworking them to address the data structure issues)
>> it would be nice to turn commits that clearly are nothing but fixups into
>> just that (git even has the cool "--fixup" feature in newer versions...
>
>
> I didn't know about the --fixup feature. I will take it into consideration
> on the
> future, when I will create my final patches. Also I intend to submit new
> ones,
> which doesn't contain fixup commits.
>
>
>
>> Right now I can't merge this into the Subsurface-testing branch because
>> most of our testers have USB (or more correctly, serial) based devices.
>> But once this becomes transparent I can add this and we can get much more
>> testing.
>
>
> I totally understand that. I created the patches only to receive some
> feedback
> from you and to decide on the architecture.
>
> Claudiu
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150627/dd230e02/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Extend-the-transport-enum-descriptor-for-serial-comm.patch
Type: text/x-patch
Size: 952 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150627/dd230e02/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Create-a-generic-way-to-represent-any-type-of-serial.patch
Type: text/x-patch
Size: 6768 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150627/dd230e02/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Use-the-dc_serial_t-structure-in-HW-OSTC-family-3.patch
Type: text/x-patch
Size: 7240 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150627/dd230e02/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Implement-custom-open-method-for-HW-OSTC-3-family.patch
Type: text/x-patch
Size: 3638 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150627/dd230e02/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Implement-custom-device-open-method.patch
Type: text/x-patch
Size: 2661 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150627/dd230e02/attachment-0009.bin>


More information about the subsurface mailing list