mac-can / PCBUSB-Library

macOS® User-Space Driver for PCAN-USB Interfaces (Binaries only)
https://mac-can.com
Other
29 stars 0 forks source link

Unable to disable PCAN_LISTEN_ONLY after CAN_Initialize has been called #8

Open codeskin opened 2 years ago

codeskin commented 2 years ago

If PCAN_LISTEN_ONLY is enabled before CAN_Initialize has been called, then trying to disable it subsequently, as follows, has no effect.

int option = PCAN_PARAMETER_OFF;
status = CAN_SetValue(PCAN_CHANNEL, PCAN_LISTEN_ONLY, &option, sizeof(option));

Even though the parameter will be reported as OFF when CAN_GetValue is called, the PCAN_LISTEN_ONLY appears to be still active.

This problem is observed with "libPCBUSB.0.11.dylib" on macOS Catalina (Intel).

Test setup:

PCAN_LISTEN_ONLY mode being active can be observed, when messages are received, but the counter is no longer increasing, suggesting that the PCAN device is not acknowledging the message.