-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1003 from frogonwheels/poller-singleton
Move Poller isoto/vwtp infastructure to a singleton
- Loading branch information
Showing
43 changed files
with
4,378 additions
and
1,279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
set(srcs) | ||
set(include_dirs) | ||
|
||
if (CONFIG_OVMS_COMP_POLLER) | ||
|
||
list(APPEND srcs "src/vehicle_poller.cpp" "src/vehicle_poller_isotp.cpp" "src/vehicle_poller_vwtp.cpp") | ||
list(APPEND include_dirs "src") | ||
endif () | ||
|
||
# requirements can't depend on config | ||
idf_component_register(SRCS ${srcs} | ||
INCLUDE_DIRS ${include_dirs} | ||
PRIV_REQUIRES "main" | ||
WHOLE_ARCHIVE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# Main component makefile. | ||
# | ||
# This Makefile can be left empty. By default, it will take the sources in the | ||
# src/ directory, compile them and link them into lib(subdirectory_name).a | ||
# in the build directory. This behaviour is entirely configurable, | ||
# please read the ESP-IDF documents if you need to do this. | ||
# | ||
|
||
ifdef CONFIG_OVMS_COMP_POLLER | ||
COMPONENT_ADD_INCLUDEDIRS:=src | ||
COMPONENT_SRCDIRS:=src | ||
COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
ISOTP Poller API | ||
================ | ||
|
||
The Poller runs a single command thread (replacing the Vehicle RX thread) that | ||
handles transmitting of commands, receiving of responses and various control | ||
commands. This accessed through the global ``MyPollers`` instance. | ||
|
||
Within ``MyPollers`` is a ``OvmsPoller`` instance for each active Can Bus | ||
containing the ISOTP/VWTP protocol state as well as a named list of | ||
``PollSeriesEntry`` instances that provide which command to send. They are | ||
each dispatched to from the single command thread but it means that concurrent | ||
multi-frame queries can happen across different buses. | ||
|
||
A separate timer now means that the frequency of the poll can be adjusted from | ||
the default 1s provided by the timer.1 event. | ||
|
||
There is also the ability to set up a number Secondary ticks for each Primary | ||
tick. This means that failed commands can be retried more quickly and also that | ||
particular types of ``PollSeriesEntry`` can repeat commands (like fetching | ||
speed) without holding up the main Polling tick that provides periodic | ||
commands. | ||
|
||
Another feature that has been added to reduce latency is that when the response | ||
time between multiple frames is decreased via ``PollSetTimeBetweenSuccess``, a | ||
delay can be added between poller runs that gives more air-time to other | ||
packets on the Bus with ``PollSetResponseSeparationTime``. | ||
|
||
``PollSeriesEntry`` that are added with a "!v." prefix will be automatically removed | ||
on shutdown of the vehicle class. | ||
|
||
Legacy Support | ||
-------------- | ||
|
||
A single special ``PollSeriesEntry`` class called ``StandardVehiclePollSeries`` | ||
is used to provide the ``PollSetPidList`` functionality. | ||
|
||
The blocking poll requests are also implemented using a different internal | ||
``BlockingOnceOffPoll`` class. | ||
|
||
Additional Features | ||
------------------- | ||
|
||
The idea is that multiple ``PollSeriesEntry`` classes can be assigned to each | ||
BUS with one-shot classes taking priority. | ||
|
||
One-shot classes mean that you can easily perform once-off operations without | ||
blocking the main timer thread. They automatically remove themselves from the | ||
list once they are successful. | ||
The Ioniq 5 implementation has an example of this where the VIN is retrieved. | ||
|
||
Another feature is that the overall 'State' is not limited to 4. Each series | ||
entry can nominate the block of 4 states that they occupy and states outside | ||
that won't apply to it. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
ISOTP Poller Commands | ||
===================== | ||
|
||
.. highlight:: none | ||
|
||
Show status | ||
:: | ||
|
||
poller status | ||
|
||
Pause/Resume poller | ||
:: | ||
|
||
poller pause | ||
poller resume | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ISOTP Poller Basics | ||
=================== | ||
|
||
The Poller module has been lifted from the vehicle implementation. It supports periodic | ||
polling of OBD addresses, both older style (type 9 like those used for HUDs) and the newer | ||
ISOTP (and VWTP) multi-framed data protocol extensions. | ||
|
||
As it stands it is primarily a developer API with limited controls over the parameters. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ISOTP Poller | ||
============ | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
Intro | ||
Commands | ||
API | ||
|
Oops, something went wrong.