intrepidcs / libicsneo

Intrepid Control Systems device communication library
Other
36 stars 32 forks source link

Request for IDeviceSettings::setCANFDMode( bool enabled, bool iso = true ) for setting CANFD_SETTINGS::FDMode method. #37

Open 3electrons opened 3 years ago

3electrons commented 3 years ago

I have only CanValue4 Industrial and standard CanValue4 on my desk.

So not really sure if all type of devices might use the same settings for FDMode in CANFD_SETTINGS. Possible values are:

NO_CANFD,
CANFD_ENABLED,           // Seems not to be used by IVneo Explorer for my devices
CANFD_BRS_ENABLED,
CANFD_ENABLED_ISO,    // Seems not be  used by IVneo Explorer for my devices
CANFD_BRS_ENABLED_ISO

Question is if CANFD_ENABLED can be used in some older or different devices? Hence possibly having nice method for setting FDMode might be good idea.

Maybe something like: bool IDeviceSettings::setCANFDMode( bool enabled, bool iso = true) void IDeviceSettings::getCANFDMode( bool & enabled, bool & iso)

As currently the only way I found to switch CANFD mode is by:

dev->settings->getMutableCANFDSettingsFor(myNetwork)->FDMode = myMode; setting one of { NO_CANFD, CANFD_BRS_ENABLED, CANFD_BRS_ENABLED_ISO}

Adding use case to interactive example might be an good idea too.

hollinsky-intrepid commented 3 years ago

All of this is correct. 99% of customers will never need to change this setting from the default CANFD_BRS_ENABLED_ISO as

  1. BRS can be controlled on a per-message basis instead (I'm not positive how this setting affects reception of BRS messages)
  2. Non-ISO CAN FD does not see much use (if any at all) now that everyone has ISO compliant silicon

But we can have a getter/setter for this if you have some use for it.

3electrons commented 3 years ago

My concern was, what If somebody use the code against some older interpidcs hardware that actually does not support ISO or BRS for example.

What I checked is that whatever you set to FDMode (0xf0 for example) it is:

Hence the only reasonable concern left is: