<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Solterra,<br>
<br>
<div class="moz-cite-prefix">Am 17.06.23 um 01:37 schrieb Solterra:<br>
</div>
<blockquote type="cite"
cite="mid:4279e043398e906f374362dc404b80c8@kezarnet.com">Is there
a recommended method for adding a one-time CAN poll to the queue
with the response to be processed by IncomingPollReply?
<br>
</blockquote>
<br>
For single-shot requests you can either use the synchronous
`OvmsVehicle::PollSingleRequest()` method(s) or temporarily replace
the PID list via `OvmsVehicle::PollSetPidList()`.<br>
<br>
For the latter, you'd reinstall your standard PID list in the
incoming handler once you've received the response.<br>
<br>
<blockquote type="cite"
cite="mid:4279e043398e906f374362dc404b80c8@kezarnet.com">What is
the recommended method for adding or modifying obdii_polls after
initialization?
<br>
</blockquote>
<br>
In most situations you only need to switch polls partially or change
the poll frequency. For this, use the up to four poll state timings
per list entry, and call `OvmsVehicle::PollSetState()` to switch the
current state.<br>
<br>
If you need to fully replace a poll list:<br>
<ol>
<li>Lock the poller mutex<br>
</li>
<li>Remove the current PID list</li>
<li>Create / modify your PID list</li>
<li>Install the new / modified PID list</li>
<li>Unlock the poller mutex<br>
</li>
</ol>
For dynamically created PID lists and/or combining predefined with
dynamic entries, use a C++ std::vector & std::initializer_list.<br>
<br>
For a full example of this and also an example for how to do the PID
list update, see the `vehicle_vweup` OBD module:<br>
<ul>
<li><a class="moz-txt-link-freetext" href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/blob/master/vehicle/OVMS.V3/components/vehicle_vweup/src/vehicle_vweup.h#L83">https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/blob/master/vehicle/OVMS.V3/components/vehicle_vweup/src/vehicle_vweup.h#L83</a></li>
<li><a class="moz-txt-link-freetext" href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/blob/master/vehicle/OVMS.V3/components/vehicle_vweup/src/vweup_obd.cpp#L217">https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/blob/master/vehicle/OVMS.V3/components/vehicle_vweup/src/vweup_obd.cpp#L217</a></li>
</ul>
Regards,<br>
Michael<br>
<br>
<pre class="moz-signature" cols="72">--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26</pre>
</body>
</html>