Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2021-03

SocketCAN implementation

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to Zeljko Avramovic
Zeljko Avramovic wrote 15 lines
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.

Reply by email

Zeljko Avramovic
to Michael Van Canneyt
I had a look.

Thanks, I really appreciate it.

Show quoted text 8 lines
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

Understood.

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.

A while ago have tried to force myself to use objfpc mode, and even published one package with it (https://bitbucket.org/avra/pasettimino/src/master/), but it simply did not stick and I am back to delphi mode. While I shall leave examples in delphi mode, I might try to get rid of delphi mode in translated headers.

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.

I'll try.

Btw, should I prohibit non-linuxes in source code by using $FATAL, or some other way is preferred?

Reply by email

Michael Van Canneyt
to Zeljko Avramovic
Zeljko Avramovic wrote 25 lines
> I had a look. Thanks, I really appreciate it. > 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 Understood. > 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. A while ago have tried to force myself to use objfpc mode, and even published one package with it (https://bitbucket.org/avra/pasettimino/src/master/), but it simply did not stick and I am back to delphi mode. While I shall leave examples in delphi mode, I might try to get rid of delphi mode in translated headers.

That would be appreciated.

Show quoted text 8 lines
> 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. I'll try. Btw, should I prohibit non-linuxes in source code by using $FATAL, or some other way is preferred?

Not needed. fpmake will take care of this.

Michael.

Reply by email