|
297 | 297 |
|
298 | 298 | # PCAN parameter values |
299 | 299 | # |
300 | | -PCAN_PARAMETER_OFF = int(0x00) # The PCAN parameter is not set (inactive) |
301 | | -PCAN_PARAMETER_ON = int(0x01) # The PCAN parameter is set (active) |
302 | | -PCAN_FILTER_CLOSE = int(0x00) # The PCAN filter is closed. No messages will be received |
303 | | -PCAN_FILTER_OPEN = int( |
304 | | - 0x01 |
305 | | -) # The PCAN filter is fully opened. All messages will be received |
306 | | -PCAN_FILTER_CUSTOM = int( |
307 | | - 0x02 |
308 | | -) # The PCAN filter is custom configured. Only registered messages will be received |
309 | | -PCAN_CHANNEL_UNAVAILABLE = int( |
310 | | - 0x00 |
311 | | -) # The PCAN-Channel handle is illegal, or its associated hardware is not available |
312 | | -PCAN_CHANNEL_AVAILABLE = int( |
313 | | - 0x01 |
314 | | -) # The PCAN-Channel handle is available to be connected (PnP Hardware: it means furthermore that the hardware is plugged-in) |
315 | | -PCAN_CHANNEL_OCCUPIED = int( |
316 | | - 0x02 |
317 | | -) # The PCAN-Channel handle is valid, and is already being used |
| 300 | +PCAN_PARAMETER_OFF = 0x00 # The PCAN parameter is not set (inactive) |
| 301 | +PCAN_PARAMETER_ON = 0x01 # The PCAN parameter is set (active) |
| 302 | +PCAN_FILTER_CLOSE = 0x00 # The PCAN filter is closed. No messages will be received |
| 303 | +PCAN_FILTER_OPEN = ( |
| 304 | + 0x01 # The PCAN filter is fully opened. All messages will be received |
| 305 | +) |
| 306 | +PCAN_FILTER_CUSTOM = 0x02 # The PCAN filter is custom configured. Only registered messages will be received |
| 307 | +PCAN_CHANNEL_UNAVAILABLE = 0x00 # The PCAN-Channel handle is illegal, or its associated hardware is not available |
| 308 | +PCAN_CHANNEL_AVAILABLE = 0x01 # The PCAN-Channel handle is available to be connected (PnP Hardware: it means furthermore that the hardware is plugged-in) |
| 309 | +PCAN_CHANNEL_OCCUPIED = ( |
| 310 | + 0x02 # The PCAN-Channel handle is valid, and is already being used |
| 311 | +) |
318 | 312 | PCAN_CHANNEL_PCANVIEW = ( |
319 | 313 | PCAN_CHANNEL_AVAILABLE | PCAN_CHANNEL_OCCUPIED |
320 | 314 | ) # The PCAN-Channel handle is already being used by a PCAN-View application, but is available to connect |
321 | 315 |
|
322 | | -LOG_FUNCTION_DEFAULT = int(0x00) # Logs system exceptions / errors |
323 | | -LOG_FUNCTION_ENTRY = int(0x01) # Logs the entries to the PCAN-Basic API functions |
324 | | -LOG_FUNCTION_PARAMETERS = int( |
325 | | - 0x02 |
326 | | -) # Logs the parameters passed to the PCAN-Basic API functions |
327 | | -LOG_FUNCTION_LEAVE = int(0x04) # Logs the exits from the PCAN-Basic API functions |
328 | | -LOG_FUNCTION_WRITE = int(0x08) # Logs the CAN messages passed to the CAN_Write function |
329 | | -LOG_FUNCTION_READ = int( |
330 | | - 0x10 |
331 | | -) # Logs the CAN messages received within the CAN_Read function |
332 | | -LOG_FUNCTION_ALL = int( |
333 | | - 0xFFFF |
334 | | -) # Logs all possible information within the PCAN-Basic API functions |
| 316 | +LOG_FUNCTION_DEFAULT = 0x00 # Logs system exceptions / errors |
| 317 | +LOG_FUNCTION_ENTRY = 0x01 # Logs the entries to the PCAN-Basic API functions |
| 318 | +LOG_FUNCTION_PARAMETERS = ( |
| 319 | + 0x02 # Logs the parameters passed to the PCAN-Basic API functions |
| 320 | +) |
| 321 | +LOG_FUNCTION_LEAVE = 0x04 # Logs the exits from the PCAN-Basic API functions |
| 322 | +LOG_FUNCTION_WRITE = 0x08 # Logs the CAN messages passed to the CAN_Write function |
| 323 | +LOG_FUNCTION_READ = 0x10 # Logs the CAN messages received within the CAN_Read function |
| 324 | +LOG_FUNCTION_ALL = ( |
| 325 | + 0xFFFF # Logs all possible information within the PCAN-Basic API functions |
| 326 | +) |
335 | 327 |
|
336 | | -TRACE_FILE_SINGLE = int( |
337 | | - 0x00 |
338 | | -) # A single file is written until it size reaches PAN_TRACE_SIZE |
339 | | -TRACE_FILE_SEGMENTED = int( |
340 | | - 0x01 |
341 | | -) # Traced data is distributed in several files with size PAN_TRACE_SIZE |
342 | | -TRACE_FILE_DATE = int(0x02) # Includes the date into the name of the trace file |
343 | | -TRACE_FILE_TIME = int(0x04) # Includes the start time into the name of the trace file |
344 | | -TRACE_FILE_OVERWRITE = int( |
345 | | - 0x80 |
346 | | -) # Causes the overwriting of available traces (same name) |
| 328 | +TRACE_FILE_SINGLE = ( |
| 329 | + 0x00 # A single file is written until it size reaches PAN_TRACE_SIZE |
| 330 | +) |
| 331 | +TRACE_FILE_SEGMENTED = ( |
| 332 | + 0x01 # Traced data is distributed in several files with size PAN_TRACE_SIZE |
| 333 | +) |
| 334 | +TRACE_FILE_DATE = 0x02 # Includes the date into the name of the trace file |
| 335 | +TRACE_FILE_TIME = 0x04 # Includes the start time into the name of the trace file |
| 336 | +TRACE_FILE_OVERWRITE = 0x80 # Causes the overwriting of available traces (same name) |
347 | 337 |
|
348 | | -FEATURE_FD_CAPABLE = int(0x01) # Device supports flexible data-rate (CAN-FD) |
349 | | -FEATURE_DELAY_CAPABLE = int( |
350 | | - 0x02 |
351 | | -) # Device supports a delay between sending frames (FPGA based USB devices) |
352 | | -FEATURE_IO_CAPABLE = int( |
353 | | - 0x04 |
354 | | -) # Device supports I/O functionality for electronic circuits (USB-Chip devices) |
| 338 | +FEATURE_FD_CAPABLE = 0x01 # Device supports flexible data-rate (CAN-FD) |
| 339 | +FEATURE_DELAY_CAPABLE = ( |
| 340 | + 0x02 # Device supports a delay between sending frames (FPGA based USB devices) |
| 341 | +) |
| 342 | +FEATURE_IO_CAPABLE = ( |
| 343 | + 0x04 # Device supports I/O functionality for electronic circuits (USB-Chip devices) |
| 344 | +) |
355 | 345 |
|
356 | | -SERVICE_STATUS_STOPPED = int(0x01) # The service is not running |
357 | | -SERVICE_STATUS_RUNNING = int(0x04) # The service is running |
| 346 | +SERVICE_STATUS_STOPPED = 0x01 # The service is not running |
| 347 | +SERVICE_STATUS_RUNNING = 0x04 # The service is running |
358 | 348 |
|
359 | 349 | # Other constants |
360 | 350 | # |
361 | | -MAX_LENGTH_HARDWARE_NAME = int( |
362 | | - 33 |
363 | | -) # Maximum length of the name of a device: 32 characters + terminator |
364 | | -MAX_LENGTH_VERSION_STRING = int( |
365 | | - 256 |
366 | | -) # Maximum length of a version string: 255 characters + terminator |
| 351 | +MAX_LENGTH_HARDWARE_NAME = ( |
| 352 | + 33 # Maximum length of the name of a device: 32 characters + terminator |
| 353 | +) |
| 354 | +MAX_LENGTH_VERSION_STRING = ( |
| 355 | + 256 # Maximum length of a version string: 255 characters + terminator |
| 356 | +) |
367 | 357 |
|
368 | 358 | # PCAN message types |
369 | 359 | # |
|
0 commit comments