<div dir="ltr">The one that matters most is OvmsPoller::m_poll_state - as that is the one used in processing. It is possible to set this separately per bus.<div><br><div>The one at OvmsPollers level is there if you choose to keep one 'poll-state' and so set the values on all busses together... which is normally the case. It's mostly there so multiple calls to setting poll-state without actually changing the poll-state will not actually have to queue calls.</div><div><br></div><div>The one at OvmsVehicle is there because that used to be where it sat. It's still there for reading convenience and for non-blocking access to the value.. but it really should always just be a reference copy of the m_poll_state on OvmsPollers.</div><div><br></div><div>This (on OvmsVehicle) is probably one the one that could easily go.</div><div><br></div><div>//.ichael</div></div></div><div dir="auto"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 23 Feb 2025, 21:25 Chris Box via OvmsDev, <<a href="mailto:ovmsdev@lists.openvehicles.com" target="_blank">ovmsdev@lists.openvehicles.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<p>Hi everyone</p>
<p>While trying to resolve the Leaf's poll state management, I find myself needing to understand the different levels of poller state that exist in the main (non-vehicle-specific) code.</p>
<p>What is the semantic difference between these?</p>
<p>OvmsVehicle::m_poll_state</p>
<p>OvmsPollers::m_poll_state</p>
<p>OvmsPoller::m_poll_state</p>
<p>To me it appears the first two duplicate each other, and I'm not sure why.</p>
<p>The third one is a little different as it's per poller (i.e. per bus).</p>
<p><br></p>
<p>If I follow how changes are propagated to these for my car, I see:</p>
<p>OvmsVehicle::PollSetState(state)</p>
<p>This immediately sets OvmsVehicle::m_poll_state = state, and calls:</p>
<p>OvmsPollers::PollSetState(state)</p>
<p>This immediately sets OvmsPollers::m_poll_state = state, and queues a request to set the lowest level states.</p>
<p>When the request is processed, it loops through the buses. For each it calls:</p>
<p>OvmsPoller::Do_PollSetState(state)</p>
<p>This sets this instance's OvmsPoller::m_poll_state = state, and updates some associated variables.</p>
<p><br></p>
<p>What is the logic behind having so many poll states?</p>
<p>Chris</p>
<p><br></p>
<p><br></p>
<div id="m_-24875279472122829m_3161061741579093096m_-8899647840017961276v1v1v1v1_rc_sig"></div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
OvmsDev mailing list<br>
<a href="mailto:OvmsDev@lists.openvehicles.com" rel="noreferrer" target="_blank">OvmsDev@lists.openvehicles.com</a><br>
<a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" rel="noreferrer noreferrer" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br>
</blockquote></div>