-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Wolfgang Grandegger schrieb:
> Luotao Fu wrote:
>> On Thu, Nov 26, 2009 at 01:09:55PM +0100, Wolfgang Grandegger wrote:
>>> Wolfgang Grandegger wrote:
>>>> Luotao Fu wrote:
>> <snip>
>>> Just looked to the code. scan_do_restart() just does the bus-off
>>> recovery if appropriate. But I realized that the scan_set_* functions do
>>> stop the device before setting the property. That's dangerous and error
>>> prune and therefore we did not allow it in the kernel. It's up to the
>>> user/application to handle up/down properly. Furthermore, these
>>> functions seem to start the device even if it was not up before.
>>>
>> I updated the GIT tree. Now we have
>> scan_do_start/stop/restart
>> callbacks to start/stop/restart the device. Also elimanated duplicated
>> code and remove the internal starting/stoping the device in _set calls.
>> canconfig is updated too. I will rename the library to simply
>> libsocketcan and the API prefix to can_. All good with these names?
>
> At a first glance, it looks good now. My favorite is libcan. Just one
I like libsocketcan as the systems is also known as socketcan, or do you
want to rename the project to CAN? ;-)
> final comment about:
>
> int scan_set_bitrate(const char *name, __u32 bitrate, __u32 sample_point)
> {
> struct can_bittiming bt;
>
> memset(&bt, 0, sizeof(bt));
> bt.bitrate = bitrate;
> bt.sample_point = sample_point;
>
> return scan_set_bittiming(name, &bt);
> }
>
> I would prefer two functions here:
>
> int scan_set_bitrate(const char *name, __u32 bitrate)
> int scan_set_bitrate_sample_point(const char *name, __u32 bitrate, __u32
> sample_point)
>
> Not sure if we need the latter, though. This would avoid non-expert users
> using non-standard sample-points.
Even if don't prefer to split it - as the sample point is an essential
parameter for the bitrate - I would call it scan_set_sample_point. It's
much shorter and anybody should know what is meant?
Sebastian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAksPoEYACgkQpqRB8PJG7Xx5WwCeN+78f9gRm808nMIGwxdTASco
g0gAn3EiYy+PwTW9i0bryJQL1LXK01wi
=HCtu
-----END PGP SIGNATURE-----
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Visit us at SPS/IPC/DRIVES Nuremberg
from 24 - 26 Nov 2009 at hall 6/422
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EMS Dr. Thomas Wuensche e.K.
Sonnenhang 3
85304 Ilmmuenster
HRA Neuburg a.d. Donau, HR-Nr. 70.106
Phone: +49-8441-490260
Fax : +49-8441-81860
http://www.ems-wuensche.com
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core