matth-x / MicroOcpp

OCPP 1.6 client for microcontrollers
MIT License
341 stars 149 forks source link

Get timeout status in every request #358

Open HaninMoAnwar opened 2 months ago

HaninMoAnwar commented 2 months ago

I want to check if timeout occurred in any request in my application layer. I didn't find any API does that. So, I was enforced to add a flag inside RequestQueue::loop to be fired when timeout occurs. image

I want to know if the library doesn't support an API for timeout detection or not. In addition, I wander about how library handle the timeout exception, does it print on serial only or take an action ? Thanks in advance.

HaninMoAnwar commented 2 months ago

I've found that timeout is handled by onTimeoutListener callback only for authorize, startTransaction, and stopTransaction requests. image Do other requests have this callback or not ? I yes, how can I use it in my project ?

HaninMoAnwar commented 2 months ago

We as EvFlash Compony, handled this issue by setting onTimeoutListener, onReceiveConfListener callbacks for each request and pass App handler functions to these listeners, just to track connectivity status in our application layer . And here is an example : image If you're @matth-x interested in our handling to this issue, please don't hesitate to contact with me.