ulrikhagstrom / datalinkengineeringcanopen

CANopen SDK (API) for Windows developers. Supported adapters: Kvaser, Ixxat, CANUSB, CAN232, Peak PCAN, Copley Controls, USBTIN and more.
http://www.datalink.se
34 stars 13 forks source link

Units of timeouts #5

Open MechatronixX opened 3 years ago

MechatronixX commented 3 years ago

It is unclear what units are used for the timeouts in e.g. the SDO client: https://github.com/ulrikhagstrom/datalinkengineeringcanopen/blob/f612417dcd410c5d152c4fccb6ea5640c7e8913c/canopen_stack_visual_studio_2008-2012/visual_studio/canopenlib32_dll/inc/ClientSDOClass.h#L110-L112

The scaling of the default values give an indication it might be microseconds. https://github.com/ulrikhagstrom/datalinkengineeringcanopen/blob/f612417dcd410c5d152c4fccb6ea5640c7e8913c/canopen_stack_visual_studio_2008-2012/visual_studio/canopenlib32_dll/inc/ClientSDOClass.h#L32-L34

Having to assume the units is unsafe. A suggestion is to rename the function parameters to e.g. _timeoutmicroseconds, _timeoutmilliseconds etc and add suffixes to the default parameters.

lulu58 commented 1 year ago

Hello Ulrik, is it possible to update the project for newer release of Visual Studio? I tried to compile with VS2021 with many errors, broke down the project for just the PCAN adapter and only 64bit builds, resolved all errors and warnings - my last problem is a problem by linking the can_dispatcher_x64.lib in canopenlib64.dll: LNK2019 Verweis auf nicht aufgelöstes externes Symbol ""unsigned long cdecl canopenDispatcher(void *)" (?canopenDispatcher@@YAKPEAX@Z)" in Funktion ""private: static unsigned long cdecl CanInterface::canFrameDispatcherThread(void *)" (?canFrameDispatcherThread@CanInterface@@CAKPEAX@Z)". Any hints are welcome.