Skip to content

Commit 4b43f33

Browse files
authored
improve vector documentation (hardbyte#1420)
1 parent 0c82d2c commit 4b43f33

File tree

3 files changed

+66
-4
lines changed

3 files changed

+66
-4
lines changed

can/interfaces/vector/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
22
"""
33

4-
from .canlib import VectorBus, VectorChannelConfig
4+
from .canlib import VectorBus, VectorChannelConfig, get_channel_configs
55
from .exceptions import VectorError, VectorOperationError, VectorInitializationError

can/interfaces/vector/canlib.py

+3
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,8 @@ def set_timer_rate(self, timer_rate_ms: int) -> None:
876876

877877

878878
class VectorChannelConfig(NamedTuple):
879+
"""NamedTuple which contains the channel properties from Vector XL API."""
880+
879881
name: str
880882
hwType: xldefine.XL_HardwareType
881883
hwIndex: int
@@ -906,6 +908,7 @@ def _get_xl_driver_config() -> xlclass.XLdriverConfig:
906908

907909

908910
def get_channel_configs() -> List[VectorChannelConfig]:
911+
"""Read channel properties from Vector XL API."""
909912
try:
910913
driver_config = _get_xl_driver_config()
911914
except VectorError:

doc/interfaces/vector.rst

+62-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Vector
44
This interface adds support for CAN controllers by `Vector`_. Only Windows is supported.
55

66
By default this library uses the channel configuration for CANalyzer.
7-
To use a different application, open Vector Hardware Config program and create
7+
To use a different application, open **Vector Hardware Configuration** program and create
88
a new application and assign the channels you may want to use.
99
Specify the application name as ``app_name='Your app name'`` when constructing
1010
the bus or in a config file.
@@ -21,13 +21,72 @@ application named "python-can"::
2121

2222

2323

24-
Bus
25-
---
24+
VectorBus
25+
---------
2626

2727
.. autoclass:: can.interfaces.vector.VectorBus
28+
:show-inheritance:
29+
:member-order: bysource
30+
:members:
31+
set_filters,
32+
recv,
33+
send,
34+
send_periodic,
35+
stop_all_periodic_tasks,
36+
flush_tx_buffer,
37+
reset,
38+
shutdown,
39+
popup_vector_hw_configuration,
40+
get_application_config,
41+
set_application_config
42+
43+
Exceptions
44+
----------
2845

2946
.. autoexception:: can.interfaces.vector.VectorError
47+
:show-inheritance:
3048
.. autoexception:: can.interfaces.vector.VectorInitializationError
49+
:show-inheritance:
3150
.. autoexception:: can.interfaces.vector.VectorOperationError
51+
:show-inheritance:
52+
53+
Miscellaneous
54+
-------------
55+
56+
.. autofunction:: can.interfaces.vector.get_channel_configs
57+
58+
.. autoclass:: can.interfaces.vector.VectorChannelConfig
59+
:show-inheritance:
60+
:class-doc-from: class
61+
62+
.. autoclass:: can.interfaces.vector.xldefine.XL_HardwareType
63+
:show-inheritance:
64+
:member-order: bysource
65+
:members:
66+
:undoc-members:
67+
68+
.. autoclass:: can.interfaces.vector.xldefine.XL_ChannelCapabilities
69+
:show-inheritance:
70+
:member-order: bysource
71+
:members:
72+
:undoc-members:
73+
74+
.. autoclass:: can.interfaces.vector.xldefine.XL_BusCapabilities
75+
:show-inheritance:
76+
:member-order: bysource
77+
:members:
78+
:undoc-members:
79+
80+
.. autoclass:: can.interfaces.vector.xldefine.XL_BusTypes
81+
:show-inheritance:
82+
:member-order: bysource
83+
:members:
84+
:undoc-members:
85+
86+
.. autoclass:: can.interfaces.vector.xldefine.XL_Status
87+
:show-inheritance:
88+
:member-order: bysource
89+
:members:
90+
:undoc-members:
3291

3392
.. _Vector: https://vector.com/

0 commit comments

Comments
 (0)