[Ovmsdev] Levels of poller states

Chris Box chris8086 at ee.eclipse1.net
Sun Feb 23 21:24:47 HKT 2025


Hi everyone

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.

What is the semantic difference between these?

OvmsVehicle::m_poll_state

OvmsPollers::m_poll_state

OvmsPoller::m_poll_state

To me it appears the first two duplicate each other, and I'm not sure 
why.

The third one is a little different as it's per poller (i.e. per bus).

If I follow how changes are propagated to these for my car, I see:

OvmsVehicle::PollSetState(state)

This immediately sets OvmsVehicle::m_poll_state = state, and calls:

OvmsPollers::PollSetState(state)

This immediately sets OvmsPollers::m_poll_state = state, and queues a 
request to set the lowest level states.

When the request is processed, it loops through the buses. For each it 
calls:

OvmsPoller::Do_PollSetState(state)

This sets this instance's OvmsPoller::m_poll_state = state, and updates 
some associated variables.

What is the logic behind having so many poll states?

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20250223/d85988e1/attachment.htm>


More information about the OvmsDev mailing list