Skip to content

Commit

Permalink
improve vector documentation (hardbyte#1420)
Browse files Browse the repository at this point in the history
  • Loading branch information
zariiii9003 authored Oct 28, 2022
1 parent 0c82d2c commit 4b43f33
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 4 deletions.
2 changes: 1 addition & 1 deletion can/interfaces/vector/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
"""

from .canlib import VectorBus, VectorChannelConfig
from .canlib import VectorBus, VectorChannelConfig, get_channel_configs
from .exceptions import VectorError, VectorOperationError, VectorInitializationError
3 changes: 3 additions & 0 deletions can/interfaces/vector/canlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,8 @@ def set_timer_rate(self, timer_rate_ms: int) -> None:


class VectorChannelConfig(NamedTuple):
"""NamedTuple which contains the channel properties from Vector XL API."""

name: str
hwType: xldefine.XL_HardwareType
hwIndex: int
Expand Down Expand Up @@ -906,6 +908,7 @@ def _get_xl_driver_config() -> xlclass.XLdriverConfig:


def get_channel_configs() -> List[VectorChannelConfig]:
"""Read channel properties from Vector XL API."""
try:
driver_config = _get_xl_driver_config()
except VectorError:
Expand Down
65 changes: 62 additions & 3 deletions doc/interfaces/vector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Vector
This interface adds support for CAN controllers by `Vector`_. Only Windows is supported.

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



Bus
---
VectorBus
---------

.. autoclass:: can.interfaces.vector.VectorBus
:show-inheritance:
:member-order: bysource
:members:
set_filters,
recv,
send,
send_periodic,
stop_all_periodic_tasks,
flush_tx_buffer,
reset,
shutdown,
popup_vector_hw_configuration,
get_application_config,
set_application_config

Exceptions
----------

.. autoexception:: can.interfaces.vector.VectorError
:show-inheritance:
.. autoexception:: can.interfaces.vector.VectorInitializationError
:show-inheritance:
.. autoexception:: can.interfaces.vector.VectorOperationError
:show-inheritance:

Miscellaneous
-------------

.. autofunction:: can.interfaces.vector.get_channel_configs

.. autoclass:: can.interfaces.vector.VectorChannelConfig
:show-inheritance:
:class-doc-from: class

.. autoclass:: can.interfaces.vector.xldefine.XL_HardwareType
:show-inheritance:
:member-order: bysource
:members:
:undoc-members:

.. autoclass:: can.interfaces.vector.xldefine.XL_ChannelCapabilities
:show-inheritance:
:member-order: bysource
:members:
:undoc-members:

.. autoclass:: can.interfaces.vector.xldefine.XL_BusCapabilities
:show-inheritance:
:member-order: bysource
:members:
:undoc-members:

.. autoclass:: can.interfaces.vector.xldefine.XL_BusTypes
:show-inheritance:
:member-order: bysource
:members:
:undoc-members:

.. autoclass:: can.interfaces.vector.xldefine.XL_Status
:show-inheritance:
:member-order: bysource
:members:
:undoc-members:

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

0 comments on commit 4b43f33

Please sign in to comment.