Commit Graph

6 Commits

Author SHA1 Message Date
Javier Viguera 85480c9f26 apix-can-examples: fix static analyzer warnings
* Initialize 'iface' and validate it before use to avoid undefined
  behavior.
* Move 'deffilter' to global static scope in can-recv-example to prevent
  stack address escape.
* Fix incorrect retry count in failure message in can-send-example.

No functional changes.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2025-06-18 18:03:49 +02:00
Javier Viguera 2e2aac99f1 can-recv-example: fix printf format for timeval with _TIME_BITS=64
With _TIME_BITS=64, tv_sec and tv_usec are long long integer types,
so update %ld to %llu and cast to (unsigned long long) to fix timestamp
formatting.

https://onedigi.atlassian.net/browse/DEL-9638

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
2025-06-18 14:47:35 +02:00
Mike Engel 81354f402f can: cosmetic change the data receive dump
This commit only will print the data received on the
CAN interface.

https://onedigi.atlassian.net/browse/DEL-8708

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2024-01-18 15:50:04 +01:00
Mike Engel ff6869f690 apix-can: remove CAN stop from cleanup()
This commit will remove the call to stop the CAN controller,
because freeing the CAN will stop the CAN interface already.
Calling stop twice will producing the following error message:

DIGIAPIX[824]: [ERROR] ldx_can_process_tx_socket: CAN network is down
DIGIAPIX[824]: [ERROR] ldx_can_stop: Unexpected state 0, in can0 interface
DIGIAPIX[824]: [ERROR] can0|ldx_can_thr: select error (-27|100)

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
2021-01-12 12:05:31 +01:00
Mike Engel 41289be92e apix_can_example: Add CANFD support to configure data bitrate
This commit adds CANFD support to configure the data bitrate and
to enable the CANFD feature.

Signed-off-by: Mike Engel <Mike.Engel@digi.com>

https://jira.digi.com/browse/DEL-6588
2019-06-05 11:50:05 +02:00
fgilmar caab8ae4bc can: add two examples for the can interface
Added two examples about how to configure and set a CAN
interface to establish a communication receiving and
sending frames.

Signed-off-by: fgilmar <francisco.gilmartinez@digi.com>
2018-11-26 08:18:01 +01:00