Retrieves the list of available devices.
Ret = CanQueryDeviceName ( Index , DeviceName , Device )
Index
[ C, C++: short ] [ Python: ctypes.c_short ]
This parameter should be zero for the first call and then be incremented
for subsequent calls.
DeviceName
[ C, C++: char
* ] [ Python: ctypes.c_char_p ]
Return the device name. (For example: "CAN000")
Device
[ C, C++: char * ] [ Python: ctypes.c_char_p ]
Return the board name. (For example: "CAN-4P-PE")
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
Definition |
Value |
Description |
CAN_ERR_SUCCESS |
0 |
Normality completion |
CAN_ERR_INFO_NOT_FIND_DEVICE |
10051 |
Not find
the available device. |
The others (See also: Details of Error Code)
None
This function can be used when you create
a general-purpose application that you can select a device you want to
use.
The Index is set to zero for the first call. And then it should be incremented
for subsequent calls until the function returns error.
For C, C++
for (int Index = 0; Ret CAN_ERR_SUCCESS;
Index++){
Ret = CanQueryDeviceName ( Index , DeviceName ,
Device );
}
Retrieves the information of the device by Index=0.
C, C++ |
long Ret; |
Python |
Ret = ctypes.c_long() DeviceName = ctypes.create_string_buffer(256) Device = ctypes.create_string_buffer(256) Ret.value = ccan.CanQueryDeviceName
( 0 , DeviceName , Device ) |
None