TOSUN-Shanghai / libTSCANDemos

libTSCAN APIs for TOSUN Hardware, which is suitable in windows and linux platform
MIT License
1 stars 4 forks source link

Retrieve hardware type/ capabilities #1

Closed davidkirchner closed 1 year ago

davidkirchner commented 1 year ago

Hi, I am trying to retrieve the hardware type of a TsCANFD mini through the C/C++ TSCAN API. With the tscan_get_device_info function it is possible to read out the product name, but this is not specific enough in my case. I try to get the specific hardware type e.g. TC1011 or TC1013

In my case a TC1011 has the following output:

u32 ret = tscan_get_device_info(0, &manufacturer, &product, &serial);
printf(%s\n, product);

// output: TOSUN HS CANFDMini

The problem here is that Tosun offers many different TsCANFD mini devices which all have different capabilities. Some support only CAN, some CAN-FD and some other CAN-FD + FLEXRAY like shown on your website https://www.tosunai.com/en/product-category/hardware/can-tools/

So is there a way to either retrieve the specific hardware type or to read out the hardware capabilities (CAN, CAN-FD, LIN, FLEXRAY) without connecting to the device and using the tscan_get_X_channel_count functions?

TSSkyhits commented 1 year ago

There is a new API named "tscan_get_device_info_detail" can meet your requirement. It is released in July, 2023. function tscan_get_device_info_detail( const ADeviceIndex: u32; AManufacturer: PpansiChar; AProduct: pPansiChar; ASerial: pPansiChar; ADeviceType: PInteger; ADeviceName: PPAnsiChar; ACANChannelCount: PInteger; AIsCANFD: PBoolean; ALINChannelCount: PInteger; AFRChannelCount: PInteger; AEthernetChannelCount: PInteger ): u32; stdcall;

davidkirchner commented 1 year ago

@TSSkyhits Thank you for your reply! Unfortunately, I could not find the DLL you mentioned. On the Tosun website I could only find a DLL from March 2022 in the libTSCan_sdk_cpp_api archive, in which the tscan_get_device_info_detail function is non-existent. I also could not find the tscan_get_device_info_detail function in the latest DLL from the libTSCANDemos repository (https://github.com/TOSUN-Shanghai/libTSCANDemos/tree/main/lib/windows/x64). Would it be possible to provide me with the DLL and the corresponding header file?

TSSkyhits commented 1 year ago

git@github.com:TOSUN-Shanghai/libTSCANDemos.git

TSSkyhits commented 1 year ago

@TSSkyhits Thank you for your reply! Unfortunately, I could not find the DLL you mentioned. On the Tosun website I could only find a DLL from March 2022 in the libTSCan_sdk_cpp_api archive, in which the tscan_get_device_info_detail function is non-existent. I also could not find the tscan_get_device_info_detail function in the latest DLL from the libTSCANDemos repository (https://github.com/TOSUN-Shanghai/libTSCANDemos/tree/main/lib/windows/x64). Would it be possible to provide me with the DLL and the corresponding header file?

you can get all latest file in repository: git@github.com:TOSUN-Shanghai/libTSCANDemos.git

davidkirchner commented 1 year ago

Thank you very much! The updated functions in the new DLL from your last commit solved the problem for me.