[fpc-devel] SocketCAN implementation

Michael Van Canneyt michael at freepascal.org
Sun Mar 14 10:21:24 CET 2021



On Sun, 14 Mar 2021, Zeljko Avramovic via fpc-devel wrote:

> Hello everyone,
>  
> I have implemented SocketCAN wrappers for FreePascal which I would like to contribute. Before creating a patch for Mantis, could
> someone please take a look at it's current form and advise me on further steps, changes and improvements that I should
> eventually do? I would like it to be available right out of the box with FreePascal (as it is now the case with Python and C),
> so I guess that it should end up as a FreePascal package.
>  
> Maybe it is important to mention that SocketCAN is linux only, but seeing how popular it is I do not think it will stay that for
> long.
>  
> I have already prepared sockets for CAN changes earlier with this patch: https://bugs.freepascal.org/view.php?id=38566.
>  
> There is still some work waiting for me with SAE J1939 high level protocol and writing docs and more demos, but I would
> appreciate if you could take a look at it's current state and give comments. Just download can.zip file from this message:
> https://forum.lazarus.freepascal.org/index.php/topic,39858.msg397239.html#msg397239.

I had a look.

Since this is currently linux-only, and there are several units, I would opt to make this a separate
package.

The directory structure to use should be clear, I suppose:

can
can/src
can/examples

Is there any reason you used mode Delphi ? If possible, I would prefer it if
you used mode objfpc. It's a little more strict than Delphi mode.

If you can make a fpmake.pp file, that would be appreciated, but if you
don't feel up to that I can do it when you submit the sources, that's not a
problem.

Michael.


More information about the fpc-devel mailing list