DLC as int vs byte TPCANMsgFD

Forum for the PCANBasic .NET Assembly Beta-Package containing
the PCANBasic-Assembly developed in .NET-Standard.
Post Reply
ChololateIT
Posts: 7
Joined: Mon 13. Nov 2017, 15:42

DLC as int vs byte TPCANMsgFD

Post by ChololateIT » Thu 7. Jan 2021, 14:49

Hi,

I just saw that

Code: Select all

TPCANMsgFD.DLC
is defined as int while in the "classic" library it's a byte. Is this a bug and will be changed to byte?

Best regards

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

Re: DLC as int vs byte TPCANMsgFD

Post by K.Wagner » Fri 8. Jan 2021, 08:55

Hello,

no it is not a bug, it was intended so. As you can see the classic TPCANMsg structure has also a member LEN of type byte, and in the assembly is defined as int too.

Assembly:

Code: Select all

TPCANMsg.Length
Classic:

Code: Select all

TPCANMsg.LEN
The idea is to prevent the user for making castings by himself when working with the assembly. The assembly checks and sends the real data size to the underlying driver. This assembly is thought to do more than the classic library you know; even when it looks most same as the classic API, it could be extended to have other help functions and classes.
Best regards,
Keneth

Post Reply