<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Thanks for the tips.</p>
<p>For my first question, I initially copied the what the Ionic5 module did for VIN request, but it doesn't really fit with the framework of my vehicle module. I'm in the process of refactoring and figured there were other instances where I'll just want to send a one-time poll and let the framework process the response. Your response points me down the right path...</p>
<p>For my second question, I'm considering a command where I need to enter a UDS diagnostic session and will need to add a poll to keep the ECU in that session. I don't always need the poll, but once I do I need it every 2 seconds or so. Then, at the end of the session, I'll return the polling back to the 'standard'.</p>
<div id="signature"></div>
<p>Things are going well with my module, by the way. I'm having trouble where the communications gateway ECU goes to sleep when the vehicle is 'off' and I dont yet know how to wake it up. This might cause some charging sessions to be missed. I haven't decided if I care yet or not, as my initial use case is most important when the vehicle is on.</p>
<p>I'm going to do some reverse engineering of the Toyota TIS software communication today to see how they keep the communications gateway ECU awake.</p>
<p><br /></p>
<p id="reply-intro">On 2023-06-17 03:01, Michael Balzer wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div>Solterra,<br /><br />
<div class="v1moz-cite-prefix">Am 17.06.23 um 01:37 schrieb Solterra:</div>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">Is there a recommended method for adding a one-time CAN poll to the queue with the response to be processed by IncomingPollReply? </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" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">What is the recommended method for adding or modifying obdii_polls after initialization? </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</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</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="v1moz-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" target="_blank" rel="noopener noreferrer">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="v1moz-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" target="_blank" rel="noopener noreferrer">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="v1moz-signature">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26</pre>
</div>
</div>
<br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">_______________________________________________<br />OvmsDev mailing list<br /><a href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a><br /><a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank" rel="noopener noreferrer">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a></div>
</blockquote>
</body></html>